Procházet zdrojové kódy

删除标准,不删除任务

hfxc226 před 2 měsíci
rodič
revize
1134bd6ba0

+ 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);