Browse Source

优化审核流程

hsh 9 months ago
parent
commit
17b58da8cb

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

@@ -202,6 +202,11 @@ public class TargetManagementController {
         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);

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

@@ -76,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);
+
 }

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

@@ -62,7 +62,7 @@ public class ZbReportCycleScore {
      */
     private String yearRate;
     /**
-     * 状态(1:自评状态,2:内审状态,9:固化状态)
+     * 状态(1:自评状态,2:内审状态,3:取消审核状态,9:固化状态)
      */
     private String flag;
 

+ 34 - 1
src/main/java/thyyxxk/webserver/service/targetmanagement/TargetManagementService.java

@@ -1028,13 +1028,15 @@ public class TargetManagementService {
         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());
-        score.setFlag("2");
         int num = scoreDao.updateTargetReportScoreById(score);
         if(num > 0){
             resultMap.put("cg", "更新指标周期内审得分成功!");
@@ -1042,6 +1044,37 @@ public class TargetManagementService {
         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);
+    }
+
     /**
      * @Description 查询指标周期得分
      * @Author hsh