jiangbiao пре 1 година
родитељ
комит
416fb22337

+ 1 - 1
master/src/main/java/com/ruoyi/project/training/bccnew/service/impl/TTsApproveServiceImpl.java

@@ -161,7 +161,7 @@ public class TTsApproveServiceImpl implements ITTsApproveService {
                 .claim(taskId, userId);
         taskService.addComment(taskId, processInstancesId, devTask.getComment());
         taskService.complete(taskId, param);
-        tTsNewService.updateTTsNew(tTsNew,null,null);
+        tTsNewService.updateTTsNew(tTsNew);
         return AjaxResult.success();
     }
 

+ 77 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/service/impl/TTsNewServiceImpl.java

@@ -207,6 +207,83 @@ public class TTsNewServiceImpl implements ITTsNewService {
      */
     @Override
     public int updateTTsNew(TTsNew tTsNew) {
+        TTsNew tsNew = tTsNewMapper.selectTTsNewById(tTsNew.getNewId());
+        if (tTsNew.getPlanStatus() == 1) {
+            TTsFirstplan tTsFirstplan = new TTsFirstplan();
+            tTsFirstplan.setNewId(tTsNew.getNewId());
+            for (TTsFirstplan tsFirstplan : tTsFirstplanMapper.selectTTsFirstplanListByNewId(tTsFirstplan)) {
+                tsFirstplan.setPlanStatus(1L);
+                tTsFirstplanMapper.updateTTsFirstplan(tsFirstplan);
+            }
+            if (tsNew.getPlanType() == 1) {
+                TTsLjplan entity = new TTsLjplan();
+                entity.setNewId(tTsNew.getNewId());
+                for (TTsLjplan item : tTsLjplanMapper.selectTTsLjplanListByNewId(entity)) {
+                    item.setPlanStatus(1L);
+                    tTsLjplanMapper.updateTTsLjplan(item);
+                }
+            } else if (tsNew.getPlanType() == 2) {
+                TTsYsplan entity = new TTsYsplan();
+                entity.setNewId(tTsNew.getNewId());
+                for (TTsYsplan item : tTsYsplanMapper.selectTTsYsplanListByNewId(entity)) {
+                    item.setPlanStatus(1L);
+                    tTsYsplanMapper.updateTTsYsplan(item);
+                }
+            } else if (tsNew.getPlanType() == 3) {
+                TTsFlplan entity = new TTsFlplan();
+                entity.setNewId(tTsNew.getNewId());
+                for (TTsFlplan item : tTsFlplanMapper.selectTTsFlplanListByNewId(entity)) {
+                    item.setPlanStatus(1L);
+                    tTsFlplanMapper.updateTTsFlplan(item);
+                }
+            } else if (tsNew.getPlanType() == 4) {
+                TTsFtplan entity = new TTsFtplan();
+                entity.setNewId(tTsNew.getNewId());
+                for (TTsFtplan item : tTsFtplanMapper.selectTTsFtplanListByNewId(entity)) {
+                    item.setPlanStatus(1L);
+                    tTsFtplanMapper.updateTTsFtplan(item);
+                }
+            }
+            tTsNewMapper.updateTTsNew(tTsNew);
+        }
+        if (tTsNew.getPlanStatus() == 3) {
+            TTsFirstplan tTsFirstplan = new TTsFirstplan();
+            tTsFirstplan.setNewId(tTsNew.getNewId());
+            for (TTsFirstplan tsFirstplan : tTsFirstplanMapper.selectTTsFirstplanListByNewId(tTsFirstplan)) {
+                tsFirstplan.setPlanStatus(3L);
+                tTsFirstplanMapper.updateTTsFirstplan(tsFirstplan);
+            }
+            if (tsNew.getPlanType() == 1) {
+                TTsLjplan entity = new TTsLjplan();
+                entity.setNewId(tTsNew.getNewId());
+                for (TTsLjplan item : tTsLjplanMapper.selectTTsLjplanListByNewId(entity)) {
+                    item.setPlanStatus(3L);
+                    tTsLjplanMapper.updateTTsLjplan(item);
+                }
+            } else if (tsNew.getPlanType() == 2) {
+                TTsYsplan entity = new TTsYsplan();
+                entity.setNewId(tTsNew.getNewId());
+                for (TTsYsplan item : tTsYsplanMapper.selectTTsYsplanListByNewId(entity)) {
+                    item.setPlanStatus(3L);
+                    tTsYsplanMapper.updateTTsYsplan(item);
+                }
+            } else if (tsNew.getPlanType() == 3) {
+                TTsFlplan entity = new TTsFlplan();
+                entity.setNewId(tTsNew.getNewId());
+                for (TTsFlplan item : tTsFlplanMapper.selectTTsFlplanListByNewId(entity)) {
+                    item.setPlanStatus(3L);
+                    tTsFlplanMapper.updateTTsFlplan(item);
+                }
+            } else if (tsNew.getPlanType() == 4) {
+                TTsFtplan entity = new TTsFtplan();
+                entity.setNewId(tTsNew.getNewId());
+                for (TTsFtplan item : tTsFtplanMapper.selectTTsFtplanListByNewId(entity)) {
+                    item.setPlanStatus(3L);
+                    tTsFtplanMapper.updateTTsFtplan(item);
+                }
+            }
+            tTsNewMapper.updateTTsNew(tTsNew);
+        }
         return tTsNewMapper.updateTTsNew(tTsNew);
     }
 

+ 1 - 0
master/src/main/resources/mybatis/training/bccnew/TTsFirstplanMapper.xml

@@ -66,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null "> and dept_id = #{deptId}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="planStatus != null "> and plan_status = #{planStatus}</if>
+            <if test="examId != null "> and exam_id = #{examId}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->