|
|
@@ -147,6 +147,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
|
|
|
list.add(plan);
|
|
|
List<Long> collect = list.stream().map(TMonitoringRetrievalPlan::getId).collect(Collectors.toList());
|
|
|
boolean isEdit = false;
|
|
|
+ //true禁止编辑,false可以编辑
|
|
|
boolean isComplete = true;
|
|
|
if (plan.getParentId() != null) {
|
|
|
isEdit = true;
|
|
|
@@ -154,15 +155,12 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
|
|
|
tMonitoringRetrievalPlanVO.setIsEdit(isEdit);
|
|
|
List<String> status = new ArrayList<>();
|
|
|
status.add("2");
|
|
|
- // status.add("3");
|
|
|
List<CoreMonitoringRetrievalTask> coreMonitoringRetrievalTasks = iCoreMonitoringRetrievalTaskService.selectAllTaskByPlanId(collect, status);
|
|
|
-
|
|
|
- if (CollectionUtils.isNotEmpty(coreMonitoringRetrievalTasks)&&plan.getPlanStatus()!=1) {
|
|
|
- isComplete = false;
|
|
|
+ if (CollectionUtils.isNotEmpty(coreMonitoringRetrievalTasks)) {
|
|
|
+ isComplete = true;
|
|
|
}
|
|
|
- if (plan.getPlanStatus()==0){
|
|
|
- isEdit=false;
|
|
|
- isComplete=false;
|
|
|
+ if (plan.getPlanStatus() == 0) {
|
|
|
+ isComplete = false;
|
|
|
}
|
|
|
tMonitoringRetrievalPlanVO.setIsComplete(isComplete);
|
|
|
return tMonitoringRetrievalPlanVO;
|
|
|
@@ -534,17 +532,17 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
|
|
|
coreMonitoringRetrievalTaskBuilderService.deleteAllTaskByPlanIds(collect);
|
|
|
}*/
|
|
|
|
|
|
- for (TMonitoringRetrievalPlan tMonitoringRetrievalPlan : list1) {
|
|
|
- if (!isComplete){
|
|
|
- tMonitoringRetrievalPlan.setPlanStatus(2);
|
|
|
- }
|
|
|
- tMonitoringRetrievalPlan.setIsDistribute("0");
|
|
|
- baseMapper.updateById(tMonitoringRetrievalPlan);
|
|
|
- //如果是无周期和全是未完成,删除计划
|
|
|
- if (plan.getPlanCycle().equals("0")||isComplete) {
|
|
|
- baseMapper.deleteById(tMonitoringRetrievalPlan.getId());
|
|
|
- }
|
|
|
+ for (TMonitoringRetrievalPlan tMonitoringRetrievalPlan : list1) {
|
|
|
+ if (!isComplete) {
|
|
|
+ tMonitoringRetrievalPlan.setPlanStatus(2);
|
|
|
+ }
|
|
|
+ tMonitoringRetrievalPlan.setIsDistribute("0");
|
|
|
+ baseMapper.updateById(tMonitoringRetrievalPlan);
|
|
|
+ //如果是无周期和全是未完成,删除计划
|
|
|
+ if (plan.getPlanCycle().equals("0") || isComplete) {
|
|
|
+ baseMapper.deleteById(tMonitoringRetrievalPlan.getId());
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
if (!plan.getPlanCycle().equals("0")) {
|
|
|
switch (plan.getPlanCycle()) {
|