| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.StructureItemParameterMapper"> |
| | | <delete id="removeNoSample"> |
| | | delete from structure_item_parameter where sample like concat('%',#{sample},'%') |
| | | delete |
| | | from structure_item_parameter |
| | | where sample like concat('%', #{sample}, '%') |
| | | </delete> |
| | | <select id="selectItemParameterList" resultType="com.yuanchu.mom.pojo.StructureItemParameter"> |
| | | select * from (select A.id, |
| | |
| | | WHEN code IS NULL THEN 1 |
| | | ELSE 0 |
| | | END, |
| | | CAST(code AS UNSIGNED) asc |
| | | CAST(code AS UNSIGNED), |
| | | case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | ,id asc |
| | | </select> |
| | | |
| | | <resultMap id="getInsProductions" type="map"> |
| | |
| | | public List<StandardProductList> selectStandardProductList(InsSample insSample) { |
| | | String[] models = insSample.getModel().split("-(?=[^-]*$)");//拆分最后一个【-】 |
| | | String[] factorys = insSample.getFactory().split(" - "); |
| | | List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1).eq(StandardProductList::getModel, models[0]).eq(StandardProductList::getSampleType, factorys[2])); |
| | | //List<StandardProductList> list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery().eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()).eq(StandardProductList::getState, 1).eq(StandardProductList::getModel, models[0]).eq(StandardProductList::getSampleType, factorys[2])); |
| | | List<StandardProductList> list = standardProductListMapper.selectDetail(insSample.getStandardMethodListId(), 1, models[0]); |
| | | if (list.size() == 0) { |
| | | if (Objects.equals(insSample.getFactory(), "") || insSample.getFactory() == null) { |
| | | return null; |
| | | } |
| | | String[] split = insSample.getFactory().split(" - "); |
| | | list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() |
| | | list = standardProductListMapper.selectDetail2(insSample.getStandardMethodListId(), 1, split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3]); |
| | | /* list = standardProductListMapper.selectList(Wrappers.<StandardProductList>lambdaQuery() |
| | | .eq(StandardProductList::getStandardMethodListId, insSample.getStandardMethodListId()) |
| | | .eq(StandardProductList::getState, 1) |
| | | .like(StandardProductList::getTree, split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3])); |
| | | .like(StandardProductList::getTree, split[0] + " - " + split[1] + " - " + split[2] + " - " + split[3]));*/ |
| | | |
| | | } |
| | | list = list.stream().filter(a -> { |
| | | try { |
| | |
| | | }); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Collections.sort(list, (o1, o2) -> { |
| | | String field1 = o1.getManHourGroup(); |
| | | String field2 = o2.getManHourGroup(); |
| | | |
| | | int num1 = extractNumber(field1); |
| | | int num2 = extractNumber(field2); |
| | | |
| | | return Integer.compare(num1, num2); |
| | | }); |
| | | try { |
| | | map.put("productList", list.subList((page - 1) * 50, page * 50)); |
| | | } catch (IndexOutOfBoundsException e) { |
| | |
| | | return map; |
| | | } |
| | | |
| | | private int extractNumber(String s) { |
| | | // 从字符串中提取数字的逻辑,这里假设字段的格式是 "text<number>" |
| | | String number = s.replaceAll("\\D", ""); |
| | | return Integer.parseInt(number); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<StandardProductList> selectStandardProductByMethodId(Integer id, String tree, Integer page, String laboratory, String item, String items) { |
| | | IPage<StandardProductList> iPage = new Page<>(); |
| | |
| | | where standard_method_list_id = #{standardMethodListId} |
| | | and state =#{state} |
| | | and model=#{model} |
| | | order by case when man_hour_group is NULL then 1 else 0 end, CAST(man_hour_group as UNSIGNED), |
| | | man_hour_group REGEXP '^[0-9]', id asc |
| | | order by case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | ,id asc |
| | | </select> |
| | | <select id="selectDetail2" resultType="com.yuanchu.mom.pojo.StandardProductList"> |
| | | select * from standard_product_list |
| | | where standard_method_list_id = #{standardMethodListId} |
| | | and state =#{state} |
| | | and tree=#{tree} |
| | | order by case when man_hour_group is NULL then 1 else 0 end, CAST(man_hour_group as UNSIGNED), |
| | | man_hour_group REGEXP '^[0-9]', id asc |
| | | order by case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | ,id asc |
| | | </select> |
| | | </mapper> |
| | |
| | | left join product p on p.object_id = sto.id |
| | | left join standard_tree st on st.sample_type = sto.specimen_name |
| | | and st.sample = p.name |
| | | order by l.id, CAST(sto.code AS DECIMAL), p.id, ISNULL(st.id), st.id |
| | | order by l.id, CAST(sto.code AS DECIMAL), p.id, ISNULL (st.id), st.id |
| | | </select> |
| | | |
| | | <select id="selectStandardProductById" resultType="com.yuanchu.mom.pojo.StandardProductList"> |
| | |
| | | or sample = '[]' |
| | | OR sample LIKE CONCAT('%[', #{tree}, ']%') |
| | | ) |
| | | order by case when man_hour_group is NULL then 1 else 0 end, CAST(man_hour_group as UNSIGNED), |
| | | man_hour_group REGEXP '^[0-9]', id asc |
| | | order by case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | |
| | | ,id asc |
| | | </select> |
| | | |
| | | <select id="selectStandardProductListByTree2" resultType="com.yuanchu.mom.pojo.StandardProductList"> |
| | |
| | | id structure_item_parameter_id |
| | | from structure_item_parameter |
| | | where sample LIKE CONCAT('%[', #{tree}, ']%') |
| | | order by case when man_hour_group is NULL then 1 else 0 end, CAST(man_hour_group as UNSIGNED), |
| | | man_hour_group REGEXP '^[0-9]', id asc |
| | | order by case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | |
| | | ,id asc |
| | | </select> |
| | | |
| | | <select id="getStandardTree2" resultMap="SampleTypeDto"> |
| | |
| | | or sample = '[]' |
| | | OR sample LIKE CONCAT('%', #{tree}, '%') |
| | | ) |
| | | order by case when man_hour_group is NULL then 1 else 0 end, CAST(man_hour_group as UNSIGNED), |
| | | man_hour_group REGEXP '^[0-9]', id asc |
| | | order by case when man_hour_group is NULL then 1 |
| | | when man_hour_group ='' then 1 else 0 end, |
| | | CASE |
| | | WHEN man_hour_group REGEXP '^[0-9]' THEN CAST(man_hour_group AS UNSIGNED) -- 如果以数字开头,则按照数字大小排序 |
| | | WHEN man_hour_group REGEXP '[0-9]+' THEN CAST(SUBSTRING(man_hour_group, 2)AS UNSIGNED) END -- 提取字母后面的数字部分 |
| | | |
| | | ,id asc |
| | | </select> |
| | | <select id="getStandardTree3" resultType="com.yuanchu.mom.dto.SampleDto"> |
| | | select model label, |
| | |
| | | </if> |
| | | </select> |
| | | <select id="selectPList" resultType="com.yuanchu.mom.dto.ProductDto"> |
| | | select p.name from structure_test_object sto |
| | | left join product p on p.object_id = sto.id |
| | | select p.name |
| | | from structure_test_object sto |
| | | left join product p on p.object_id = sto.id |
| | | where sto.specimen_name = #{name} |
| | | order by p.id |
| | | </select> |
| | |
| | | |
| | | @ValueClassify("工时管理") |
| | | @ApiOperation(value = "导出原始工时") |
| | | @GetMapping("/exportOriginalHours") |
| | | @PostMapping("/exportOriginalHours") |
| | | public void exportOriginalHours(@RequestParam("month") String month, @RequestParam("name") String name, @RequestParam("departLims") String departLims,HttpServletResponse response) throws IOException { |
| | | auxiliaryOriginalHoursService.exportWorkingHours(month,name,departLims,response); |
| | | } |
| | |
| | | |
| | | @ValueClassify("人员考评") |
| | | @ApiOperation(value = "导出主管打分") |
| | | @GetMapping("/exportEvaluateCompetent") |
| | | @PostMapping("/exportEvaluateCompetent") |
| | | public void exportEvaluateCompetent(@RequestParam("month") String month, @RequestParam("name") String name, @RequestParam("departLims") String departLims, HttpServletResponse response) throws IOException { |
| | | evaluateCompetentService.export(month, name, departLims, response); |
| | | } |
| | |
| | | |
| | | @ValueClassify("人员考评") |
| | | @ApiOperation(value = "导出考评") |
| | | @GetMapping("/exportEvaluate") |
| | | @PostMapping("/exportEvaluate") |
| | | public void exportEvaluate(@RequestParam("month") String month, @RequestParam("name") String name, @RequestParam("departLims") String departLims, HttpServletResponse response) throws IOException { |
| | | evaluateService.export(month, name, departLims, response); |
| | | } |
| | |
| | | |
| | | @ValueClassify("人员考评") |
| | | @ApiOperation(value = "导出组长打分") |
| | | @GetMapping("/exportEvaluateLeader") |
| | | @PostMapping("/exportEvaluateLeader") |
| | | public void exportEvaluateLeader(@RequestParam("month") String month, @RequestParam("name") String name, @RequestParam("departLims") String departLims, HttpServletResponse response) throws IOException { |
| | | evaluateLeaderService.export(month, name, departLims, response); |
| | | } |
| | |
| | | @ExcelProperty(value = "1日") |
| | | private Double oneHours; |
| | | |
| | | @ExcelIgnore |
| | | private Integer one; |
| | | |
| | | @ApiModelProperty("2日工时") |
| | |
| | | throw new RuntimeException("系统没有查到" + auxiliaryCorrectionHoursDto.getName() + "这个用户信息!"); |
| | | } |
| | | String regex = "\\d{4}-\\d{2}"; |
| | | if (Pattern.matches(regex,auxiliaryCorrectionHours.getMonth())) { |
| | | if (!Pattern.matches(regex,auxiliaryCorrectionHoursDto.getMonth())) { |
| | | throw new RuntimeException(auxiliaryCorrectionHoursDto.getMonth() + "格式不正确,月份格式应为yyyy-MM"); |
| | | } |
| | | BeanUtils.copyProperties(auxiliaryCorrectionHoursDto, auxiliaryCorrectionHours); |
| | |
| | | double newTotal = evaluateCompetent.getSkill() + evaluateCompetent.getCompliance() + evaluateCompetent.getPositive() + evaluateCompetent.getTidy() + evaluateCompetent.getDiscipline() + evaluateCompetent.getSolidarity() + evaluateCompetent.getProposal(); |
| | | EvaluateCompetent evaluateCompetent1 = evaluateCompetentMapper.selectById(evaluateCompetent.getId()); |
| | | Evaluate evaluate = evaluateMapper.selectById(evaluateCompetent.getEvaluateId()); |
| | | evaluate.setScore(evaluate.getScore() - evaluateCompetent1.getTotal() + newTotal); |
| | | evaluate.setScore(evaluate.getScore() - evaluateCompetent1.getTotal() * 0.5 + newTotal * 0.5); |
| | | evaluateMapper.updateById(evaluate); |
| | | evaluateCompetent.setTotal(newTotal); |
| | | evaluateCompetentMapper.updateById(evaluateCompetent); |
| | |
| | | double newTotal = evaluateGroup.getSeasonable() + evaluateGroup.getExact() + evaluateGroup.getSkill() + evaluateGroup.getPreserve() + evaluateGroup.getDiscipline() + evaluateGroup.getSolidarity() + evaluateGroup.getTidy(); |
| | | EvaluateGroup evaluateGroup1 = evaluateGroupMapper.selectById(evaluateGroup.getId()); |
| | | Evaluate evaluate = evaluateMapper.selectById(evaluateGroup.getEvaluateId()); |
| | | evaluate.setScore(evaluate.getScore() - evaluateGroup1.getTotal() + newTotal); |
| | | evaluate.setScore(evaluate.getScore() - evaluateGroup1.getTotal()*0.2 + newTotal*0.2); |
| | | evaluateMapper.updateById(evaluate); |
| | | evaluateGroup.setTotal(newTotal); |
| | | evaluateGroupMapper.updateById(evaluateGroup); |
| | |
| | | double newTotal = evaluateLeader.getSeasonable() + evaluateLeader.getExact() + evaluateLeader.getResponsibility() + evaluateLeader.getCompliance() + evaluateLeader.getPositive() + evaluateLeader.getSolidarity(); |
| | | EvaluateLeader evaluateLeader1 = evaluateLeaderMapper.selectById(evaluateLeader.getId()); |
| | | Evaluate evaluate = evaluateMapper.selectById(evaluateLeader.getEvaluateId()); |
| | | evaluate.setScore(evaluate.getScore() - evaluateLeader1.getTotal() + newTotal); |
| | | evaluate.setScore(evaluate.getScore() - evaluateLeader1.getTotal() * 0.3 + newTotal * 0.3); |
| | | evaluateMapper.updateById(evaluate); |
| | | evaluateLeader.setTotal(newTotal); |
| | | evaluateLeaderMapper.updateById(evaluateLeader); |
| | |
| | | from evaluate_competent ec |
| | | left join evaluate e on ec.evaluate_id = e.id |
| | | left join user u on e.user_id = u.id |
| | | left join department_lims dl on depart_lims_id like dl.id |
| | | left join department_lims dl on depart_lims_id like concat('%',dl.id,'%') |
| | | where 1=1 |
| | | <if test="month!=null and month!=''"> |
| | | and e.month=#{month} |
| | |
| | | from evaluate_group eg |
| | | left join evaluate e on eg.evaluate_id = e.id |
| | | left join user u on e.user_id = u.id |
| | | left join department_lims dl on depart_lims_id like dl.id |
| | | left join department_lims dl on depart_lims_id like concat('%',dl.id,'%') |
| | | where 1=1 |
| | | <if test="month!=null and month!=''"> |
| | | and e.month=#{month} |
| | |
| | | from evaluate_leader el |
| | | left join evaluate e on el.evaluate_id = e.id |
| | | left join user u on e.user_id = u.id |
| | | left join department_lims dl on depart_lims_id like dl.id |
| | | left join department_lims dl on depart_lims_id like concat('%',dl.id,'%') |
| | | where 1=1 |
| | | <if test="month!=null and month!=''"> |
| | | and e.month=#{month} |
| | |
| | | <result column="leaderTotal" property="leaderTotal"/> |
| | | </resultMap> |
| | | <select id="getPage" resultType="com.yuanchu.mom.pojo.Evaluate"> |
| | | select * from(select e.*, |
| | | select * from(select e.*, |
| | | account, |
| | | u.name name, |
| | | dl.name depart_lims, |
| | | ec.total competentTotal, |
| | | eg.total groupTotal, |
| | | el.total leaderTotal |
| | | ec.total*0.5 competentTotal, |
| | | eg.total*0.2 groupTotal, |
| | | el.total*0.3 leaderTotal |
| | | from evaluate e |
| | | left join evaluate_competent ec on e.id = ec.evaluate_id |
| | | left join evaluate_group eg on e.id = eg.evaluate_id |
| | | left join evaluate_leader el on e.id = el.evaluate_id |
| | | left join user u on e.user_id = u.id |
| | | left join department_lims dl on depart_lims_id like dl.id ) A |
| | | left join department_lims dl on depart_lims_id like concat('%',dl.id,'%') ) A |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | |
| | | public static String database_username = "root"; |
| | | public static String database_password= "123456"; |
| | | public static String author = "江苏鵷雏网络科技有限公司"; |
| | | public static String model_name = "/performance-server"; // 如果为分布式填子模块名称,如果不是分布式为空即可 |
| | | public static String model_name = "/cnas-server"; // 如果为分布式填子模块名称,如果不是分布式为空即可 |
| | | public static String setParent = "com.yuanchu.mom"; // 包路径 |
| | | public static void main(String[] args) { |
| | | String projectPath = System.getProperty("user.dir"); |