This commit is contained in:
hzj
2025-05-19 16:23:29 +08:00
parent b42cd61af6
commit ab268a4a20

View File

@@ -3880,7 +3880,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
preCommandDTOList.add(preCommandDTO); preCommandDTOList.add(preCommandDTO);
}else { }else {
//调用重启设备接口先删除设备,在重启设备 //调用重启设备接口先删除设备,在新增,在修改在重启设备
List<String> deleteDevIds = new ArrayList<>(); List<String> deleteDevIds = new ArrayList<>();
Map<String, List<PqsTerminalPushLogDTO>> collect = tempPqsTerminalPushLogDTOList.stream().collect(Collectors.groupingBy(PqsTerminalPushLogDTO::getOperateType)); Map<String, List<PqsTerminalPushLogDTO>> collect = tempPqsTerminalPushLogDTOList.stream().collect(Collectors.groupingBy(PqsTerminalPushLogDTO::getOperateType));
if(collect.containsKey(DeviceRebootType.DELETE_TERMINAL)){ if(collect.containsKey(DeviceRebootType.DELETE_TERMINAL)){
@@ -3900,36 +3900,45 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
preCommandDTOList.add(preCommandDTO); preCommandDTOList.add(preCommandDTO);
} }
if(collect.containsKey(DeviceRebootType.LEDGER_MODIFY)){
List<PqsTerminalPushLogDTO> pqsTerminalPushLogDTOList1 = collect.get(DeviceRebootType.LEDGER_MODIFY);
deleteDevIds = pqsTerminalPushLogDTOList1.stream().map(PqsTerminalPushLogDTO::getDevId).distinct().collect(Collectors.toList());
String devNameString = deleteDevIds.stream().map(temp->{return lineMap.get(temp).getName();}).collect(Collectors.joining(","));
PreCommandDTO preCommandDTO = new PreCommandDTO();
String guid = IdUtil.simpleUUID();
String command = "修改前置机:"+pqsTerminalPushLogDTO.getNodeName()+"下进程:"+processId+"下终端"+devNameString;
preCommandDTO.setGuid(guid);
preCommandDTO.setCommand(command);
preCommandDTO.setResult("2");
//调用重启进程接口
this.askRestartDevice(guid,pqsTerminalPushLogDTO.getNodeId(),deleteDevIds,DeviceRebootType.LEDGER_MODIFY,processId);
preCommandDTOList.add(preCommandDTO);
}
if(collect.containsKey(DeviceRebootType.ADD_TERMINAL)){ if(collect.containsKey(DeviceRebootType.ADD_TERMINAL)){
List<PqsTerminalPushLogDTO> pqsTerminalPushLogDTOList1 = collect.get(DeviceRebootType.ADD_TERMINAL); List<PqsTerminalPushLogDTO> pqsTerminalPushLogDTOList1 = collect.get(DeviceRebootType.ADD_TERMINAL);
deleteDevIds = pqsTerminalPushLogDTOList1.stream().map(PqsTerminalPushLogDTO::getDevId).distinct().collect(Collectors.toList()); List<String> addDevIds = pqsTerminalPushLogDTOList1.stream().map(PqsTerminalPushLogDTO::getDevId).distinct().collect(Collectors.toList());
String devNameString = deleteDevIds.stream().map(temp->{return lineMap.get(temp).getName();}).collect(Collectors.joining(",")); addDevIds.removeAll(deleteDevIds);
PreCommandDTO preCommandDTO = new PreCommandDTO(); if(!CollectionUtils.isEmpty(addDevIds)){
String guid = IdUtil.simpleUUID(); String devNameString = deleteDevIds.stream().map(temp->{return lineMap.get(temp).getName();}).collect(Collectors.joining(","));
String command = "新增前置机:"+pqsTerminalPushLogDTO.getNodeName()+"下进程:"+processId+"下终端"+devNameString; PreCommandDTO preCommandDTO = new PreCommandDTO();
preCommandDTO.setGuid(guid); String guid = IdUtil.simpleUUID();
preCommandDTO.setCommand(command); String command = "新增前置机:"+pqsTerminalPushLogDTO.getNodeName()+"下进程:"+processId+"下终端"+devNameString;
preCommandDTO.setResult("2"); preCommandDTO.setGuid(guid);
preCommandDTO.setCommand(command);
preCommandDTO.setResult("2");
//调用重启进程接口 //调用重启进程接口
this.askRestartDevice(guid,pqsTerminalPushLogDTO.getNodeId(),deleteDevIds,DeviceRebootType.ADD_TERMINAL,processId); this.askRestartDevice(guid,pqsTerminalPushLogDTO.getNodeId(),deleteDevIds,DeviceRebootType.ADD_TERMINAL,processId);
preCommandDTOList.add(preCommandDTO);
}
preCommandDTOList.add(preCommandDTO);
} }
if(collect.containsKey(DeviceRebootType.LEDGER_MODIFY)){
List<PqsTerminalPushLogDTO> pqsTerminalPushLogDTOList1 = collect.get(DeviceRebootType.LEDGER_MODIFY);
List<String> modifyDevIds = pqsTerminalPushLogDTOList1.stream().map(PqsTerminalPushLogDTO::getDevId).distinct().collect(Collectors.toList());
modifyDevIds.removeAll(deleteDevIds);
if(!CollectionUtils.isEmpty(modifyDevIds)){
String devNameString = modifyDevIds.stream().map(temp->{return lineMap.get(temp).getName();}).collect(Collectors.joining(","));
PreCommandDTO preCommandDTO = new PreCommandDTO();
String guid = IdUtil.simpleUUID();
String command = "修改前置机:"+pqsTerminalPushLogDTO.getNodeName()+"下进程:"+processId+"下终端"+devNameString;
preCommandDTO.setGuid(guid);
preCommandDTO.setCommand(command);
preCommandDTO.setResult("2");
//调用重启进程接口
this.askRestartDevice(guid,pqsTerminalPushLogDTO.getNodeId(),deleteDevIds,DeviceRebootType.LEDGER_MODIFY,processId);
preCommandDTOList.add(preCommandDTO);
}
}
} }
} }