浏览代码

Merge branch 'master' into 'master'

增加指标自评分与内审得分

See merge request lighter/web-server!118
huangshuhua 8 月之前
父节点
当前提交
b8484cacda

+ 10 - 0
src/main/java/thyyxxk/webserver/controller/targetmanagement/TargetManagementController.java

@@ -197,6 +197,16 @@ public class TargetManagementController {
         return service.updateTargetReportScore(score);
     }
 
+    @PostMapping("/updateTargetReportScoreByShf")
+    public ResultVo<Map<String, Object>> updateTargetReportScoreByShf(@RequestBody @Validated ZbReportCycleScore score){
+        return service.updateTargetReportScoreByShf(score);
+    }
+
+    @PostMapping("/returnTargetReportScoreByShf")
+    public ResultVo<Map<String, Object>> returnTargetReportScoreByShf(@RequestBody @Validated ZbReportCycleScore score){
+        return service.returnTargetReportScoreByShf(score);
+    }
+
     @PostMapping("/selectTargetReportScore")
     public ResultVo<ZbReportCycleScore> selectTargetReportScore(@RequestBody @Validated ZbReportCycleScore score){
         return service.selectTargetReportScore(score);

+ 35 - 0
src/main/java/thyyxxk/webserver/dao/his/targetmanagement/ZbReportCycleScoreDao.java

@@ -40,6 +40,21 @@ public interface ZbReportCycleScoreDao extends BaseMapper<ZbReportCycleScore> {
             "<if test=\"authorName != null and authorName != '' \">" +
             "author_name = #{authorName}, " +
             "</if>" +
+            "<if test=\"authorScore != null and authorScore != '' \">" +
+            "author_score = #{authorScore}, " +
+            "</if>" +
+            "<if test=\"mainId != null and mainId != '' \">" +
+            "main_id = #{mainId}, " +
+            "</if>" +
+            "<if test=\"mainName != null and mainName != '' \">" +
+            "main_name = #{mainName}, " +
+            "</if>" +
+            "<if test=\"yearRate != null and yearRate != '' \">" +
+            "year_rate = #{yearRate}, " +
+            "</if>" +
+            "<if test=\"flag != null and flag != '' \">" +
+            "flag = #{flag}, " +
+            "</if>" +
             "</trim>" +
             "where id = #{id} and report_cycle = #{reportCycle} " +
             "</script>")
@@ -61,4 +76,24 @@ public interface ZbReportCycleScoreDao extends BaseMapper<ZbReportCycleScore> {
     @Select(" select * from zb_report_cycle_score where report_cycle = #{reportCycle} ")
     List<ZbReportCycleScore> selectTargetDictScoreByReportCycle(@Param("reportCycle") String reportCycle);
 
+    @Update("<script>" +
+            "update zb_report_cycle_score " +
+            "<trim prefix=\"set\" suffixOverrides=\",\">" +
+            "<if test=\"reportScore != null \">" +
+            "report_score = #{reportScore}, " +
+            "</if>" +
+            "<if test=\"mainId != null and mainId != '' \">" +
+            "main_id = #{mainId}, " +
+            "</if>" +
+            "<if test=\"mainName != null and mainName != '' \">" +
+            "main_name = #{mainName}, " +
+            "</if>" +
+            "<if test=\"flag != null and flag != '' \">" +
+            "flag = #{flag}, " +
+            "</if>" +
+            "</trim>" +
+            "where id = #{id} and report_cycle = #{reportCycle} " +
+            "</script>")
+    int returnTargetReportScoreById(ZbReportCycleScore score);
+
 }

+ 21 - 1
src/main/java/thyyxxk/webserver/entity/highreport/ZbReportCycleScore.java

@@ -30,7 +30,7 @@ public class ZbReportCycleScore {
      */
     private String reportCycle;
     /**
-     * 指标(年度)周期得分
+     * 指标(年度)周期得分-审核得分
      */
     private String reportScore;
     /**
@@ -45,5 +45,25 @@ public class ZbReportCycleScore {
      * 操作人姓名
      */
     private String authorName;
+    /**
+     * 操作人自评分
+     */
+    private String authorScore;
+    /**
+     * 审核人id
+     */
+    private String mainId;
+    /**
+     * 审核人姓名
+     */
+    private String mainName;
+    /**
+     * 年均增长率(计算公式:power(第四年结果值/第一年结果值, 1/3) - 1) 其中 power 是 excel 中的函数
+     */
+    private String yearRate;
+    /**
+     * 状态(1:自评状态,2:内审状态,3:取消审核状态,9:固化状态)
+     */
+    private String flag;
 
 }

+ 74 - 4
src/main/java/thyyxxk/webserver/service/targetmanagement/TargetManagementService.java

@@ -326,11 +326,11 @@ public class TargetManagementService {
         ReportBaseInfo reportMom = dao.selectReportBaseInfoByCalcId(dto.getMomId());
 
         if(null ==  reportChild && null == reportMom){
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, dto.getName() + "计算-分子或分母指标都不存在,请联系管理员!");
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "【" + dto.getName() + "】计算-分子和分母指标都不存在,请指定!");
         }
 
         if(null ==  dto.getStartTime() || null == dto.getEndTime()){
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, dto.getName() + "查询时间不存在,请检查!");
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "【" + dto.getName() + "查询时间不存在,请检查!");
         }
 
         // 处理时间(1.时间跨度需要一年一年查询结果; 2.查询时间格式为年月日时分秒: yyyy-MM-DD 24H:mm:ss)
@@ -977,7 +977,7 @@ public class TargetManagementService {
     }
 
     /**
-     * @Description 更新指标周期得分
+     * @Description 更新指标周期得分-自评分
      * @Author hsh
      * @param score 指标周期得分详情
      * @return map
@@ -994,14 +994,83 @@ public class TargetManagementService {
         UserInfo user = redis.getUserInfoByCode(TokenUtil.getInstance().getTokenUserId());
         score.setAuthorId(user.getCode().trim());
         score.setAuthorName(user.getName().trim());
+        score.setFlag("1");
         int num;
         if(null != s){
+            if("2".equals(s.getFlag())){
+                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标已经内审不能再次更新指标周期自评分,请确认!");
+            }
             num = scoreDao.updateTargetReportScoreById(score);
         } else {
             num = scoreDao.insert(score);
         }
         if(num > 0){
-            resultMap.put("cg", "更新指标周期得分成功!");
+            resultMap.put("cg", "更新指标周期自评分成功!");
+        }
+        return ResultVoUtil.success(resultMap);
+    }
+
+    /**
+     * @Description 更新指标周期得分-内审得分
+     * @Author hsh
+     * @param score 指标周期得分详情
+     * @return map
+     * @Date 2024/12/30 16:45
+     */
+    public ResultVo<Map<String, Object>> updateTargetReportScoreByShf(ZbReportCycleScore score){
+        Map<String, Object> resultMap = new HashMap<>();
+        String id = score.getId();
+        String reportCycle = score.getReportCycle();
+        if(StringUtil.isBlank(id) || StringUtil.isBlank(reportCycle)){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标id或年度周期信息不全,请检查!");
+        }
+        ZbReportCycleScore s = scoreDao.selectZbReportCycleScoreByReportCycle(id, reportCycle);
+        if(null == s){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标报表得分信息不存在,请检查!");
+        }
+        if("3".equals(s.getFlag())){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标报表退审后未进行自评分不能进行审核,请检查!");
+        }
+        if(!("1".equals(s.getFlag()) || "2".equals(s.getFlag()))){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标报表未进行自评分不能进行审核,请检查!");
+        }
+        UserInfo user = redis.getUserInfoByCode(TokenUtil.getInstance().getTokenUserId());
+        score.setMainId(user.getCode().trim());
+        score.setMainName(user.getName().trim());
+        int num = scoreDao.updateTargetReportScoreById(score);
+        if(num > 0){
+            resultMap.put("cg", "更新指标周期内审得分成功!");
+        }
+        return ResultVoUtil.success(resultMap);
+    }
+
+    /**
+     * @Description 取消审核指标周期得分-内审得分
+     * @Author hsh
+     * @param score 指标周期得分详情
+     * @return map
+     * @Date 2024/12/30 16:45
+     */
+    public ResultVo<Map<String, Object>> returnTargetReportScoreByShf(ZbReportCycleScore score){
+        Map<String, Object> resultMap = new HashMap<>();
+        String id = score.getId();
+        String reportCycle = score.getReportCycle();
+        if(StringUtil.isBlank(id) || StringUtil.isBlank(reportCycle)){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标id或年度周期信息不全,请检查!");
+        }
+        ZbReportCycleScore s = scoreDao.selectZbReportCycleScoreByReportCycle(id, reportCycle);
+        if(null == s){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标报表得分信息不存在,请检查!");
+        }
+        if(!"2".equals(s.getFlag())){
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "指标报表未进行审核不能取消审核,请检查!");
+        }
+        UserInfo user = redis.getUserInfoByCode(TokenUtil.getInstance().getTokenUserId());
+        score.setMainId(user.getCode().trim());
+        score.setMainName(user.getName().trim());
+        int num = scoreDao.returnTargetReportScoreById(score);
+        if(num > 0){
+            resultMap.put("cg", "取消审核指标周期内审得分成功!");
         }
         return ResultVoUtil.success(resultMap);
     }
@@ -1032,6 +1101,7 @@ public class TargetManagementService {
     public ResultVo<Map<String, Object>> selectScoreCyclePermissions(){
         Map<String, Object> resultMap = new HashMap<>();
         String permissions = scoreDao.selectScoreCyclePermissions();
+        resultMap.put("qx", permissions);
         if("N".equals(permissions)){
             // 不做计算指标得分的权限限制
             resultMap.put("permissions", 0);