|
@@ -355,30 +355,32 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
|
|
|
throw new ServiceException("子任务,不能删除");
|
|
throw new ServiceException("子任务,不能删除");
|
|
|
} else {
|
|
} else {
|
|
|
if (monitoringRetrievalPlan.getCreateType() == 0) {
|
|
if (monitoringRetrievalPlan.getCreateType() == 0) {
|
|
|
- QueryWrapper queryWrapper = new QueryWrapper();
|
|
|
|
|
- queryWrapper.eq(PARENT_ID, monitoringRetrievalPlan.getId());
|
|
|
|
|
- List<TMonitoringRetrievalPlan> list = tMonitoringRetrievalPlanMapper.selectList(queryWrapper);
|
|
|
|
|
- list.add(monitoringRetrievalPlan);
|
|
|
|
|
- for (TMonitoringRetrievalPlan p : list) {
|
|
|
|
|
- CoreMonitoringRetrievalTask coreMonitoringRetrievalTask = new CoreMonitoringRetrievalTask();
|
|
|
|
|
- coreMonitoringRetrievalTask.setPlanId(p.getId());
|
|
|
|
|
- coreMonitoringRetrievalTask.setStatus("0");
|
|
|
|
|
- //根据计划查询未完成的任务
|
|
|
|
|
- List<CoreMonitoringRetrievalTask> coreMonitoringRetrievalTasks = iCoreMonitoringRetrievalTaskService.selectCoreMonitoringRetrievalTaskList(coreMonitoringRetrievalTask);
|
|
|
|
|
- List<Long> collect = coreMonitoringRetrievalTasks.stream().map(CoreMonitoringRetrievalTask::getId).distinct().collect(Collectors.toList());
|
|
|
|
|
- if (CollectionUtils.isNotEmpty(collect)) {
|
|
|
|
|
- Long[] arr = new Long[collect.size()];
|
|
|
|
|
- collect.toArray(arr);
|
|
|
|
|
- iCoreMonitoringRetrievalTaskService.deleteCoreMonitoringRetrievalTaskByIds(arr);
|
|
|
|
|
- }
|
|
|
|
|
- //删除带调阅任务
|
|
|
|
|
- // iCoreMonitoringRetrievalTaskService.deleteWaitTaskByPlanId(p.getId());
|
|
|
|
|
- p.setIsDeleted(2L);
|
|
|
|
|
- i = tMonitoringRetrievalPlanMapper.updateTMonitoringRetrievalPlan(p);
|
|
|
|
|
- if (i < 1) {
|
|
|
|
|
- return i;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// QueryWrapper queryWrapper = new QueryWrapper();
|
|
|
|
|
+// queryWrapper.eq(PARENT_ID, monitoringRetrievalPlan.getId());
|
|
|
|
|
+// List<TMonitoringRetrievalPlan> list = tMonitoringRetrievalPlanMapper.selectList(queryWrapper);
|
|
|
|
|
+// list.add(monitoringRetrievalPlan);
|
|
|
|
|
+// List<Long> planIds = new ArrayList<>();
|
|
|
|
|
+// for (TMonitoringRetrievalPlan p : list) {
|
|
|
|
|
+// CoreMonitoringRetrievalTask coreMonitoringRetrievalTask = new CoreMonitoringRetrievalTask();
|
|
|
|
|
+// coreMonitoringRetrievalTask.setPlanId(p.getId());
|
|
|
|
|
+// coreMonitoringRetrievalTask.setStatus("0");
|
|
|
|
|
+// //根据计划查询未完成的任务
|
|
|
|
|
+// List<CoreMonitoringRetrievalTask> coreMonitoringRetrievalTasks = iCoreMonitoringRetrievalTaskService.selectCoreMonitoringRetrievalTaskList(coreMonitoringRetrievalTask);
|
|
|
|
|
+// List<Long> collect = coreMonitoringRetrievalTasks.stream().map(CoreMonitoringRetrievalTask::getId).distinct().collect(Collectors.toList());
|
|
|
|
|
+// if (CollectionUtils.isNotEmpty(collect)) {
|
|
|
|
|
+// planIds.addAll(collect);
|
|
|
|
|
+// }
|
|
|
|
|
+// p.setIsDeleted(2L);
|
|
|
|
|
+// i = tMonitoringRetrievalPlanMapper.updateTMonitoringRetrievalPlan(p);
|
|
|
|
|
+// if (i < 1) {
|
|
|
|
|
+// return i;
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// Long[] arr = new Long[planIds.size()];
|
|
|
|
|
+// planIds.toArray(arr);
|
|
|
|
|
+// iCoreMonitoringRetrievalTaskService.deleteCoreMonitoringRetrievalTaskByIds(arr);
|
|
|
|
|
+ i = tMonitoringRetrievalPlanMapper.updatePlan(monitoringRetrievalPlan);
|
|
|
|
|
+ iCoreMonitoringRetrievalTaskService.deleteWaitTaskByPlanId(id);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|