Browse Source

修改预案的修改操作

develop
Mr.Wang 7 months ago
parent
commit
537eb81aff
  1. 23
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

23
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -1051,23 +1051,17 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
public int updateDcEmergencyPlans(DcEmergencyPlans dcEmergencyPlans) {
dcEmergencyPlans.setUpdateTime(DateUtils.getNowDate());
List<DcExecuteAction> dcExecuteActionList = dataProcessing(dcEmergencyPlans);
// 修改事件预案表数据
dcEmergencyPlansMapper.updateDcEmergencyPlans(dcEmergencyPlans);
// 修改执行操作表数据
dcExecuteActionList.forEach(dcExecuteAction -> dcExecuteAction.setUpdateTime(DateUtils.getNowDate()));
// 过滤出删除掉的操作
String dcExecuteActionId = dcExecuteActionList.stream()
dcExecuteActionList.stream()
.filter(dcExecuteAction -> dcExecuteAction.getId() != null)
.map(DcExecuteAction::getEmergencyPlansId)
.map(String::valueOf)
.findFirst()
.orElse(null);
.forEach(dcExecuteAction -> dcExecuteAction.setUpdateTime(DateUtils.getNowDate()));
// 过滤出删除掉的操作
List<String> ids = dcExecuteActionList.stream()
.filter(dcExecuteAction -> dcExecuteAction.getId() != null)
.map(DcExecuteAction::getId)
.collect(Collectors.toList());
// 查询出事件预案关联的操作
List<String> dcExecuteActionIdList = dcExecuteActionService.selectDcExecuteActionByEmergencyPlansId(dcExecuteActionId);
List<String> dcExecuteActionIdList = dcExecuteActionService.selectDcExecuteActionByEmergencyPlansId(dcEmergencyPlans.getId().toString());
List<String> commonIds = new ArrayList<>(ids);
commonIds.retainAll(dcExecuteActionIdList);
@ -1087,8 +1081,15 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
insertDcExecuteActionList.forEach(dcExecuteAction -> dcExecuteAction.setCreateTime(DateUtils.getNowDate()));
dcExecuteActionService.insertDcExecuteActionBatch(insertDcExecuteActionList);
}
List<DcExecuteAction> updateDcExecuteAction = dcExecuteActionList.stream()
.filter(dcExecuteAction -> dcExecuteAction.getId() != null)
.collect(Collectors.toList());
if (updateDcExecuteAction.size() > 0) {
dcExecuteActionService.updateDcExecuteActionBatch(updateDcExecuteAction);
}
return dcExecuteActionService.updateDcExecuteActionBatch(dcExecuteActionList);
// 修改事件预案表数据
return dcEmergencyPlansMapper.updateDcEmergencyPlans(dcEmergencyPlans);
}
/**

Loading…
Cancel
Save