bug修改
This commit is contained in:
@@ -1442,22 +1442,6 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
.map(Line::getId)
|
.map(Line::getId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
this.removeByIds(deviceIds);
|
|
||||||
deviceMapper.deleteBatchIds(deviceIds);
|
|
||||||
devFuctionMapper.deleteBatchIds(deviceIds);
|
|
||||||
|
|
||||||
Map<String,Line> devMap = devices.stream().collect(Collectors.toMap(Line::getId,Function.identity()));
|
|
||||||
List<Device> deviceList = deviceMapper.selectList(new LambdaQueryWrapper<Device>().select(Device::getId,Device::getNodeId).in(Device::getId,deviceIds));
|
|
||||||
String userName= RequestUtil.getUserNickname();
|
|
||||||
Map<String,DictData> dictDataMap = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_TYPE.getCode()).getData().stream().collect(Collectors.toMap(DictData::getId, Function.identity()));
|
|
||||||
DictData dicDataByCode = dicDataFeignClient.getDicDataByCode(DicDataEnum.DEV_PARAMETER.getCode()).getData();
|
|
||||||
//
|
|
||||||
/* List<PqsTerminalLogs> pqsTerminalLogsList = new ArrayList<>();
|
|
||||||
deviceList.forEach(dev->{
|
|
||||||
Line devicePO = devMap.get(dev.getId());
|
|
||||||
devLogsCat(Param.DEL_ZN,null,devicePO,ledgerList.get(0),dev,pqsTerminalLogsList,dictDataMap,dicDataByCode,userName);
|
|
||||||
});*/
|
|
||||||
|
|
||||||
// 2. 对每个装置删除其下级
|
// 2. 对每个装置删除其下级
|
||||||
deviceIds.forEach(it-> deleteDeviceAndChildren(it,ledgerList,logsList,nodeMap));
|
deviceIds.forEach(it-> deleteDeviceAndChildren(it,ledgerList,logsList,nodeMap));
|
||||||
}
|
}
|
||||||
@@ -1469,19 +1453,16 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
|
|
||||||
this.removeById(deviceId);
|
this.removeById(deviceId);
|
||||||
deviceMapper.deleteById(deviceId);
|
deviceMapper.deleteById(deviceId);
|
||||||
|
devFuctionMapper.delete(new LambdaQueryWrapper<DevFuction>().eq(DevFuction::getLineId,deviceId));
|
||||||
|
|
||||||
|
|
||||||
// 1. 查询并删除所有母线
|
// 1. 查询并删除所有母线
|
||||||
List<Line> busbars = findChildren(deviceId);
|
List<Line> busbars = findChildren(deviceId);
|
||||||
if (CollectionUtil.isEmpty(busbars)) {
|
if (CollectionUtil.isEmpty(busbars)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> busbarIds = busbars.stream()
|
List<String> busbarIds = busbars.stream()
|
||||||
.map(Line::getId)
|
.map(Line::getId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
this.removeByIds(busbarIds);
|
this.removeByIds(busbarIds);
|
||||||
voltageMapper.deleteBatchIds(busbarIds);
|
voltageMapper.deleteBatchIds(busbarIds);
|
||||||
|
|
||||||
@@ -1495,9 +1476,6 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
voltageMapper.deleteById(busbarId);
|
voltageMapper.deleteById(busbarId);
|
||||||
// 1. 查询并删除所有监测点
|
// 1. 查询并删除所有监测点
|
||||||
List<Line> monitoringPoints = findChildren(busbarId);
|
List<Line> monitoringPoints = findChildren(busbarId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (CollectionUtil.isEmpty(monitoringPoints)) {
|
if (CollectionUtil.isEmpty(monitoringPoints)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1506,9 +1484,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
List<String> pointIds = monitoringPoints.stream()
|
List<String> pointIds = monitoringPoints.stream()
|
||||||
.map(Line::getId)
|
.map(Line::getId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
deleteMonitoringPoints(pointIds);
|
deleteMonitoringPoints(pointIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteMonitoringPoints(List<String> pointIds) {
|
private void deleteMonitoringPoints(List<String> pointIds) {
|
||||||
@@ -1583,7 +1559,6 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
default:
|
default:
|
||||||
throw new BusinessException(CommonResponseEnum.FAIL);
|
throw new BusinessException(CommonResponseEnum.FAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(CollUtil.isNotEmpty(logsLedger)){
|
if(CollUtil.isNotEmpty(logsLedger)){
|
||||||
terminalLogsCat(logsLedger,Param.DEL,allLogs,nodeMap);
|
terminalLogsCat(logsLedger,Param.DEL,allLogs,nodeMap);
|
||||||
for(PqsTerminalLogs pqsTerminalLogs: allLogs){
|
for(PqsTerminalLogs pqsTerminalLogs: allLogs){
|
||||||
|
|||||||
Reference in New Issue
Block a user