Merge pull request #645 from IKangXu/wvp-28181-2.0

优化 国标设备中通道内查看的逻辑,保证与分屏与电子地图中树结构的数据一致
This commit is contained in:
648540858
2022-10-18 22:18:49 +08:00
committed by GitHub
2 changed files with 21 additions and 8 deletions

View File

@@ -362,10 +362,10 @@ public class DeviceServiceImpl implements IDeviceService {
return null;
}
// 使用行政区划展示树
if (parentId.length() > 10) {
// TODO 可能是行政区划与业务分组混杂的情形
return null;
}
// if (parentId.length() > 10) {
// // TODO 可能是行政区划与业务分组混杂的情形
// return null;
// }
if (parentId.length() == 10 ) {
if (onlyCatalog) {
@@ -380,7 +380,18 @@ public class DeviceServiceImpl implements IDeviceService {
List<DeviceChannel> channelsForCivilCode = deviceChannelMapper.getChannelsWithCivilCodeAndLength(deviceId, parentId, parentId.length() + 2);
if (!onlyCatalog) {
List<DeviceChannel> channels = deviceChannelMapper.getChannelsByCivilCode(deviceId, parentId);
channelsForCivilCode.addAll(channels);
for(DeviceChannel channel : channels) {
boolean flag = false;
for(DeviceChannel deviceChannel : channelsForCivilCode) {
if(channel.getChannelId().equals(deviceChannel.getChannelId())) {
flag = true;
}
}
if(!flag) {
channelsForCivilCode.add(channel);
}
}
}
List<BaseTree<DeviceChannel>> trees = transportChannelsToTree(channelsForCivilCode, parentId);
return trees;