1.解决解决全景和台账管理,终端数量不一致问题

This commit is contained in:
wr
2025-11-19 14:58:37 +08:00
parent d48cf09119
commit b0ef851479
3 changed files with 4 additions and 11 deletions

View File

@@ -408,7 +408,7 @@ public class GeneralDeviceService {
return generalDeviceDTO;
}
// 提取该部门及其子部门所有监测点id
List<String> lineIds = deptLines.stream().map(DeptLine::getLineId).collect(Collectors.toList());
List<String> lineIds = deptLines.stream().map(DeptLine::getLineId).distinct().collect(Collectors.toList());
// 获取line详细数据 根据监测点id获取所有监测点 联查 pq_line、pq_line_detail
List<Line> lines = terminalBaseService.getLineByCondition(lineIds, deviceInfoParam);
// 返回空数据
@@ -417,17 +417,17 @@ public class GeneralDeviceService {
}
//1.筛选出母线id理论上监测点的pids中第六个id为母线id 联查: pq_line t1 ,pq_voltage t2
List<String> voltageIds=lines.stream().map(Line::getPid).collect(Collectors.toList());
List<String> voltageIds=lines.stream().map(Line::getPid).distinct().collect(Collectors.toList());
//再根据电压等级筛选合法母线信息
List<Line> voltages = terminalBaseService.getVoltageByCondition(voltageIds, deviceInfoParam.getScale());
//2.筛选出终端id理论上监测点的pids中第五个id为终端id
List<String> devIds=voltages.stream().map(Line::getPid).collect(Collectors.toList());
List<String> devIds=voltages.stream().map(Line::getPid).distinct().collect(Collectors.toList());
// 再根据终端条件筛选合法终端信息 联查pq_line t1,pq_device t2
List<Line> devices = terminalBaseService.getDeviceByCondition(devIds, deviceType, deviceInfoParam.getManufacturer());
//3.筛选出变电站id理论上监测点的pids中第四个id为变电站id 联查: pq_line t1 ,pq_substation t2
List<String> subIds=devices.stream().map(Line::getPid).collect(Collectors.toList());
List<String> subIds=devices.stream().map(Line::getPid).distinct().collect(Collectors.toList());
List<Line> sub = terminalBaseService.getSubByCondition(subIds, new ArrayList<>());
//筛选最终的数据