Commit 8fdd10d1c2723ead1d2c3b232f64f292ba3ce1cc

Authored by che_shuai
1 parent d48f89ee

修复在国标级联选择通道时,如果添加通道到跟平台根目录(即平台本身),无法触发目录变更事件问题.详见 https://github.com/648540858/w…

…vp-GB28181-pro/issues/958
src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java
@@ -126,7 +126,15 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { @@ -126,7 +126,15 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
126 List<DeviceChannel> deviceChannelList = new ArrayList<>(); 126 List<DeviceChannel> deviceChannelList = new ArrayList<>();
127 if (channelReduces.size() > 0){ 127 if (channelReduces.size() > 0){
128 PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId); 128 PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId);
129 - if (catalog == null || !catalogId.equals(platform.getDeviceGBId())) { 129 + if (catalog == null && catalogId.equals(platform.getDeviceGBId())) {
  130 + for (ChannelReduce channelReduce : channelReduces) {
  131 + DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId());
  132 + deviceChannel.setParental(0);
  133 + deviceChannel.setCivilCode(platform.getServerGBDomain());
  134 + deviceChannelList.add(deviceChannel);
  135 + }
  136 + return deviceChannelList;
  137 + } else if (catalog == null || !catalogId.equals(platform.getDeviceGBId())) {
130 logger.warn("未查询到目录{}的信息", catalogId); 138 logger.warn("未查询到目录{}的信息", catalogId);
131 return null; 139 return null;
132 } 140 }