소스 검색

删除标准,不删除任务

hfxc226 2 달 전
부모
커밋
1134bd6ba0
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      platform-service/src/main/java/com/platform/service/check/impl/CheckStandardServiceImpl.java

+ 8 - 0
platform-service/src/main/java/com/platform/service/check/impl/CheckStandardServiceImpl.java

@@ -102,6 +102,14 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
         weekend.weekendCriteria().andEqualTo(CheckProjectStandardRelation::getStandardId, id);
         relationMapper.deleteByExample(weekend);
 
+        // 删除:未执行、执行中的任务:
+        List<Integer> statusList = new ArrayList<>();
+        statusList.add(CheckJobStatusEnum.NOT_EXECUTE.getValue());
+        statusList.add(CheckJobStatusEnum.EXECUTING.getValue());
+        Weekend<CheckJob> checkJobWeekend = new Weekend<>(CheckJob.class);
+        checkJobWeekend.weekendCriteria().andEqualTo(CheckJob::getStandardId, id).andIn(CheckJob::getStatus, statusList);
+        checkJobMapper.deleteByExample(checkJobWeekend);
+
         // 删除标准任务:所有和这个标准一样的任务
         /*Weekend<CheckJob> checkJobWeekend = new Weekend<>(CheckJob.class);
         checkJobWeekend.weekendCriteria().andEqualTo(CheckJob::getStandardId, id);