|
@ -477,6 +477,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
LambdaQueryWrapper<DcDevice> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<DcDevice> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
if (StringUtils.isNotEmpty(dcExecuteAction.getDeviceList())) { |
|
|
if (StringUtils.isNotEmpty(dcExecuteAction.getDeviceList())) { |
|
|
String[] deviceList = dcExecuteAction.getDeviceList().split(UniversalEnum.COMMA.getValue()); |
|
|
String[] deviceList = dcExecuteAction.getDeviceList().split(UniversalEnum.COMMA.getValue()); |
|
|
|
|
|
queryWrapper.eq(DcDevice::getDeviceState,UniversalEnum.ONE.getValue()); |
|
|
queryWrapper.in(DcDevice::getIotDeviceId, deviceList); |
|
|
queryWrapper.in(DcDevice::getIotDeviceId, deviceList); |
|
|
dcDevices = dcDeviceService.list(queryWrapper); |
|
|
dcDevices = dcDeviceService.list(queryWrapper); |
|
|
} |
|
|
} |
|
@ -1331,7 +1332,10 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
*/ |
|
|
*/ |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Override |
|
|
@Override |
|
|
public int insertDcEmergencyPlans(DcEmergencyPlans dcEmergencyPlans) { |
|
|
public AjaxResult insertDcEmergencyPlans(DcEmergencyPlans dcEmergencyPlans) { |
|
|
|
|
|
if (parityBit(dcEmergencyPlans)) { |
|
|
|
|
|
return AjaxResult.error("存在相同类型的预案"); |
|
|
|
|
|
} |
|
|
dcEmergencyPlans.setCreateTime(DateUtils.getNowDate()); |
|
|
dcEmergencyPlans.setCreateTime(DateUtils.getNowDate()); |
|
|
List<DcExecuteAction> dcExecuteActionList = dataProcessing(dcEmergencyPlans); |
|
|
List<DcExecuteAction> dcExecuteActionList = dataProcessing(dcEmergencyPlans); |
|
|
// 插入事件预案表数据
|
|
|
// 插入事件预案表数据
|
|
@ -1339,7 +1343,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
dcExecuteActionList.forEach(dcExecuteAction -> dcExecuteAction.setEmergencyPlansId(dcEmergencyPlans.getId())); |
|
|
dcExecuteActionList.forEach(dcExecuteAction -> dcExecuteAction.setEmergencyPlansId(dcEmergencyPlans.getId())); |
|
|
// 插入执行操作表数据
|
|
|
// 插入执行操作表数据
|
|
|
dcExecuteActionList.forEach(dcExecuteAction -> dcExecuteAction.setCreateTime(DateUtils.getNowDate())); |
|
|
dcExecuteActionList.forEach(dcExecuteAction -> dcExecuteAction.setCreateTime(DateUtils.getNowDate())); |
|
|
return dcExecuteActionService.insertDcExecuteActionBatch(dcExecuteActionList); |
|
|
return AjaxResult.success(dcExecuteActionService.insertDcExecuteActionBatch(dcExecuteActionList)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -1350,7 +1354,10 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
*/ |
|
|
*/ |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Override |
|
|
@Override |
|
|
public int updateDcEmergencyPlans(DcEmergencyPlans dcEmergencyPlans) { |
|
|
public AjaxResult updateDcEmergencyPlans(DcEmergencyPlans dcEmergencyPlans) { |
|
|
|
|
|
if (parityBit(dcEmergencyPlans)) { |
|
|
|
|
|
return AjaxResult.error("存在相同类型的预案"); |
|
|
|
|
|
} |
|
|
dcEmergencyPlans.setUpdateTime(DateUtils.getNowDate()); |
|
|
dcEmergencyPlans.setUpdateTime(DateUtils.getNowDate()); |
|
|
List<DcExecuteAction> dcExecuteActionList = dataProcessing(dcEmergencyPlans); |
|
|
List<DcExecuteAction> dcExecuteActionList = dataProcessing(dcEmergencyPlans); |
|
|
// 修改执行操作表数据
|
|
|
// 修改执行操作表数据
|
|
@ -1391,7 +1398,15 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 修改事件预案表数据
|
|
|
// 修改事件预案表数据
|
|
|
return dcEmergencyPlansMapper.updateDcEmergencyPlans(dcEmergencyPlans); |
|
|
return AjaxResult.success(dcEmergencyPlansMapper.updateDcEmergencyPlans(dcEmergencyPlans)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 校验类型、子类不重复 |
|
|
|
|
|
*/ |
|
|
|
|
|
public boolean parityBit(DcEmergencyPlans dcEmergencyPlans) { |
|
|
|
|
|
List<DcEmergencyPlans> dcEmergencyPlansList = dcEmergencyPlansMapper.selectDcEmergencyPlansByOne(dcEmergencyPlans); |
|
|
|
|
|
return dcEmergencyPlansList.size() > 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|