Commit 8ad9e5cd authored by 田涛's avatar 田涛

bug修复

parent 98b0b20c
......@@ -232,6 +232,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
} else {
throw new YeeException("不可编辑的状态");
}
if (planDetail.getIsDelete() == null) {
planDetail.setIsDelete(false);
}
PlanDetail planEntity = new PlanDetail();
BeanUtils.copyProperties(planDetail, planEntity);
planDetailDao.saveAndFlush(planEntity);
......@@ -242,13 +245,13 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
planDocDao.save(planDoc);
planRule.setPlanId(planId);
planDoc.setIsDelete(false);
planRule.setIsDelete(false);
planRuleDao.deleteByPlanId(planId);
planRuleDao.save(planRule);
planEquipment.forEach(equipment -> {
equipment.setPlanId(planId);
planDoc.setIsDelete(false);
equipment.setIsDelete(false);
});
planEquipmentDao.deleteByPlanId(planId);
planEquipmentDao.saveAll(planEquipment);
......@@ -287,9 +290,10 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
List<PlanDetail> planDetailList = planDetailDao.getPlanDetailsByIdInAndIsDelete(idList, false);
if (!planDetailList.isEmpty()) {
planDetailList.forEach(plan -> {
if (ContingencyPlanStatusEnum.getEnum(plan.getStatus()) != ContingencyPlanStatusEnum.DRAFT
&& ContingencyPlanStatusEnum.getEnum(plan.getStatus()) != ContingencyPlanStatusEnum.AVAILABLE
&& ContingencyPlanStatusEnum.getEnum(plan.getStatus()) != ContingencyPlanStatusEnum.NOAVAILABLE) {
ContingencyPlanStatusEnum status = ContingencyPlanStatusEnum.getEnum(plan.getStatus());
if (status != ContingencyPlanStatusEnum.DRAFT
&& status != ContingencyPlanStatusEnum.AVAILABLE
&& status != ContingencyPlanStatusEnum.NOAVAILABLE) {
throw new YeeException("包含不可启用的状态");
}
plan.setStatus(ContingencyPlanStatusEnum.AVAILABLE.getCode());
......
......@@ -19,7 +19,7 @@ import java.util.Map;
public interface IContingencyPlanService {
String DELETE_SYNC_PLAN_DOC = "DELETE_SYNC_PLAN_DOC";
String DELETE_SYNC_PLAN_RULE = "DELETE_SYNC_PLAN_RULE";
String DELETE_SYNC_PLAN_RULE = "urule/package/remove";
String DELETE_SYNC_PLAN_EQUIP = "DELETE_SYNC_PLAN_EQUIP";
String planStart(ContingencyPlanParamVo vo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment