|
|
@ -301,7 +301,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
// 指定设备资源
|
|
|
|
// 根据设备id,获取设备集合
|
|
|
|
LambdaQueryWrapper<DcDevice> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
JSONObject otherConfig = JSON.parseObject(dcExecuteAction.getOtherConfig()); |
|
|
|
JSONObject otherConfig = JSON.parseObject(dcExecuteAction.getExecuteConfig()); |
|
|
|
List<String> deviceList = (List<String>) otherConfig.get("deviceList"); |
|
|
|
queryWrapper.in(DcDevice::getIotDeviceId, deviceList); |
|
|
|
dcDevices = dcDeviceService.list(queryWrapper); |
|
|
@ -576,7 +576,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
invokedFunction( |
|
|
|
dcEventAnDcEmergencyPlans.getOperationType(), |
|
|
|
dcDevices, |
|
|
|
JSON.parseObject(dcExecuteAction.getOtherConfig()), |
|
|
|
JSON.parseObject(dcExecuteAction.getExecuteConfig()), |
|
|
|
resultArray); |
|
|
|
|
|
|
|
// 记录操作过的设备id
|
|
|
@ -828,7 +828,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
dcEmergencyPlansMapper.updateDcEmergencyPlans(dcEmergencyPlans); |
|
|
|
// 修改执行操作表数据
|
|
|
|
dcExecuteActionList.forEach(dcExecuteAction -> dcExecuteAction.setUpdateTime(DateUtils.getNowDate())); |
|
|
|
// 过滤出删除掉的执行操作和恢复操作
|
|
|
|
// 过滤出删除掉的操作
|
|
|
|
String dcExecuteActionId = dcExecuteActionList.stream() |
|
|
|
.filter(dcExecuteAction -> dcExecuteAction.getId() != null) |
|
|
|
.map(DcExecuteAction::getEmergencyPlansId) |
|
|
@ -839,17 +839,16 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
.filter(dcExecuteAction -> dcExecuteAction.getId() != null) |
|
|
|
.map(DcExecuteAction::getId) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
// 查询出事件预案关联的执行操作和恢复操作
|
|
|
|
// 查询出事件预案关联的操作
|
|
|
|
List<String> dcExecuteActionIdList = dcExecuteActionService.selectDcExecuteActionByEmergencyPlansId(dcExecuteActionId); |
|
|
|
List<String> commonIds = new ArrayList<>(ids); |
|
|
|
commonIds.retainAll(dcExecuteActionIdList); |
|
|
|
|
|
|
|
// 删除后的执行操作id和恢复操作id
|
|
|
|
// 删除后的操作id
|
|
|
|
List<String> idsNotInDcExecuteActionIdList = new ArrayList<>(dcExecuteActionIdList); |
|
|
|
idsNotInDcExecuteActionIdList.removeAll(commonIds); |
|
|
|
// 根据执行操作id和恢复操作id,进行删除操作
|
|
|
|
// 根据操作id,进行删除操作
|
|
|
|
if (idsNotInDcExecuteActionIdList.size() > 0) { |
|
|
|
System.out.println("存在需要删除的数据"); |
|
|
|
dcExecuteActionService.deleteDcExecuteAction(idsNotInDcExecuteActionIdList); |
|
|
|
} |
|
|
|
|
|
|
@ -907,14 +906,10 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
* 数据处理 |
|
|
|
*/ |
|
|
|
public static List<DcExecuteAction> dataProcessing(DcEmergencyPlans dcEmergencyPlans) { |
|
|
|
// 过滤出执行操作数据
|
|
|
|
List<DcExecuteAction> dcExecuteActionOperationList = dcEmergencyPlans.getDcExecuteAction() |
|
|
|
.stream() |
|
|
|
.filter(dcExecuteAction -> dcExecuteAction.getActionType() == 1) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
List<DcExecuteAction> dcExecuteActionList = dcEmergencyPlans.getDcExecuteAction(); |
|
|
|
// 设备类型 数据处理
|
|
|
|
String deviceType = dcExecuteActionOperationList.stream() |
|
|
|
String deviceType = dcExecuteActionList.stream() |
|
|
|
.map(DcExecuteAction::getDeviceType) |
|
|
|
.distinct() |
|
|
|
.map(type -> Arrays.stream(DeviceTypeEnum.values()) |
|
|
@ -926,7 +921,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
.collect(Collectors.joining(",")); |
|
|
|
dcEmergencyPlans.setDeviceType(deviceType); |
|
|
|
// 可控设备 数据处理
|
|
|
|
List<DcExecuteAction> dcExecuteActionNewList = dcExecuteActionOperationList.stream() |
|
|
|
List<DcExecuteAction> dcExecuteActionNewList = dcExecuteActionList.stream() |
|
|
|
.filter(dcExecuteAction -> dcExecuteAction.getSearchRule() == 1) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
String controllableDevice = dcExecuteActionNewList.stream() |
|
|
@ -934,11 +929,12 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
.collect(Collectors.joining("、")); |
|
|
|
dcEmergencyPlans.setControllableDevice(controllableDevice); |
|
|
|
// 控制指令 数据处理
|
|
|
|
List<String> otherConfigList = dcExecuteActionOperationList.stream() |
|
|
|
List<String> otherConfigList = dcExecuteActionList.stream() |
|
|
|
.map(dcExecuteAction -> { |
|
|
|
JSONObject config = new JSONObject(); |
|
|
|
String otherConfig = dcExecuteAction.getOtherConfig(); |
|
|
|
JSONObject jsonObject = JSON.parseObject(otherConfig); |
|
|
|
// 执行操作配置
|
|
|
|
String executeConfig = dcExecuteAction.getExecuteConfig(); |
|
|
|
JSONObject jsonObject = JSON.parseObject(executeConfig); |
|
|
|
if (dcExecuteAction.getDeviceType() == DeviceTypeConstants.DRIVING_GUIDANCE) { |
|
|
|
// 行车诱导
|
|
|
|
config.put("controlModelName",jsonObject.get("controlModelName")); |
|
|
@ -950,7 +946,12 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService { |
|
|
|
}else if (dcExecuteAction.getDeviceType() == DeviceTypeConstants.VARIABLE_INFORMATION_FLAG || |
|
|
|
dcExecuteAction.getDeviceType() == DeviceTypeConstants.ROAD_SECTION_VOICE_BROADCASTING) { |
|
|
|
// 情报板/语音广播
|
|
|
|
config.put("content",jsonObject.get("content")); |
|
|
|
if (jsonObject.get("operationType").equals("1")) { |
|
|
|
config.put("content",jsonObject.get("content")); |
|
|
|
}else { |
|
|
|
config.put("operationType","智能发布"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else if (dcExecuteAction.getDeviceType() == DeviceTypeConstants.LASER_FATIGUE_AWAKENING) { |
|
|
|
// 激光疲劳唤醒
|
|
|
|