zss
2024-06-21 3547641f25634eec4b6dcf379080e92ed5025ee1
解决工时排序问题+考评bug调试
已修改18个文件
115 ■■■■ 文件已修改
cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/StandardProductListMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/StandardTreeMapper.xml 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/controller/AuxiliaryOriginalHoursController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/controller/EvaluateCompetentController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/controller/EvaluateController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/controller/EvaluateLeaderController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/dto/AuxiliaryOriginalHoursDto.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryCorrectionHoursServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/EvaluateCompetentServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/EvaluateGroupServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/EvaluateLeaderServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/resources/mapper/EvaluateCompetentMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/resources/mapper/EvaluateGroupMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/resources/mapper/EvaluateLeaderMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/resources/mapper/EvaluateMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
system-run/src/main/java/com/yuanchu/mom/CodeGenerator.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/resources/mapper/StructureItemParameterMapper.xml
@@ -4,7 +4,9 @@
        "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,
@@ -54,7 +56,13 @@
        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">
inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardProductListServiceImpl.java
@@ -58,16 +58,19 @@
    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 {
@@ -255,6 +258,15 @@
            });
        }
        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) {
@@ -264,6 +276,12 @@
        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<>();
inspect-server/src/main/resources/mapper/StandardProductListMapper.xml
@@ -66,15 +66,23 @@
        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>
inspect-server/src/main/resources/mapper/StandardTreeMapper.xml
@@ -166,8 +166,13 @@
                      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">
@@ -202,8 +207,13 @@
               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">
@@ -252,8 +262,13 @@
                      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,
@@ -280,7 +295,8 @@
        </if>
    </select>
    <select id="selectPList" resultType="com.yuanchu.mom.dto.ProductDto">
        select p.name from structure_test_object sto
        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
performance-server/src/main/java/com/yuanchu/mom/controller/AuxiliaryOriginalHoursController.java
@@ -38,7 +38,7 @@
    @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);
    }
performance-server/src/main/java/com/yuanchu/mom/controller/EvaluateCompetentController.java
@@ -48,7 +48,7 @@
    @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);
    }
performance-server/src/main/java/com/yuanchu/mom/controller/EvaluateController.java
@@ -44,7 +44,7 @@
    @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);
    }
performance-server/src/main/java/com/yuanchu/mom/controller/EvaluateLeaderController.java
@@ -47,7 +47,7 @@
    @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);
    }
performance-server/src/main/java/com/yuanchu/mom/dto/AuxiliaryOriginalHoursDto.java
@@ -26,6 +26,7 @@
    @ExcelProperty(value = "1日")
    private Double oneHours;
    @ExcelIgnore
    private Integer one;
    @ApiModelProperty("2日工时")
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryCorrectionHoursServiceImpl.java
@@ -115,7 +115,7 @@
                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);
performance-server/src/main/java/com/yuanchu/mom/service/impl/EvaluateCompetentServiceImpl.java
@@ -52,7 +52,7 @@
        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);
performance-server/src/main/java/com/yuanchu/mom/service/impl/EvaluateGroupServiceImpl.java
@@ -43,7 +43,7 @@
        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);
performance-server/src/main/java/com/yuanchu/mom/service/impl/EvaluateLeaderServiceImpl.java
@@ -51,7 +51,7 @@
        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);
performance-server/src/main/resources/mapper/EvaluateCompetentMapper.xml
@@ -27,7 +27,7 @@
        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}
performance-server/src/main/resources/mapper/EvaluateGroupMapper.xml
@@ -25,7 +25,7 @@
        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}
performance-server/src/main/resources/mapper/EvaluateLeaderMapper.xml
@@ -25,7 +25,7 @@
        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}
performance-server/src/main/resources/mapper/EvaluateMapper.xml
@@ -20,15 +20,15 @@
        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>
system-run/src/main/java/com/yuanchu/mom/CodeGenerator.java
@@ -20,7 +20,7 @@
    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");