xiangpei
2024-04-28 387d3aca6fab1a07618bb8342ee522b3da2db9b1
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java
@@ -56,6 +56,7 @@
        BeanUtils.copyProperties(checkTemplate, checkTemplateQuery);
        List<Integer> deptIds = JSONArray.parseArray(checkTemplate.getDeptId(), Integer.class);
        checkTemplateQuery.setDeptId(deptIds)
                .setAdjustCoefficient(checkTemplate.getAdjustCoefficient()+"")
                .setAlarmScore(checkTemplate.getAlarmScore()+"");
        //查询规则权重
        List<CheckTemplateRule> templateRuleList = checkTemplateRuleMapper.selectListByTemplateId(checkTemplate.getId());
@@ -88,7 +89,8 @@
            List<Integer> deptIds = JSONArray.parseArray(template.getDeptId(), Integer.class);
            CheckTemplateQuery checkTemplateQuery = new CheckTemplateQuery();
            BeanUtils.copyProperties(template, checkTemplateQuery);
            checkTemplateQuery.setDeptId(deptIds);
            checkTemplateQuery.setDeptId(deptIds)
                    .setAdjustCoefficient(template.getAdjustCoefficient()+"");
            checkTemplateList.add(checkTemplateQuery);
        }
@@ -118,6 +120,7 @@
        checkTemplate.setDeptId(JSONArray.toJSONString(deptId))
                .setUpdateUserName(username)
                .setCreateUserName(username)
                .setAdjustCoefficient(new BigDecimal(checkTemplateDTO.getAdjustCoefficient()+""))
                //不填报警分数---->零分---->不报警
                .setAlarmScore(new BigDecimal(checkTemplateDTO.getAlarmScore() == null? "":checkTemplateDTO.getAlarmScore()));
        int i = checkTemplateMapper.insertCheckTemplate(checkTemplate);
@@ -167,7 +170,8 @@
        checkTemplate.setUpdateUserName(SecurityUtils.getUsername());
        List<Integer> deptId = checkTemplateDTO.getDeptId();
        Collections.sort(deptId);
        checkTemplate.setDeptId(JSONArray.toJSONString(deptId));
        checkTemplate.setDeptId(JSONArray.toJSONString(deptId))
                .setAdjustCoefficient(new BigDecimal(checkTemplateDTO.getAdjustCoefficient()+""));
        int i = checkTemplateMapper.updateCheckTemplate(checkTemplate);
        /** t_template_rule修改权重 */
        //先删除原数据