Commit a4f6102a4f2b82dcd7bf53539a404a292477baaf

Authored by 648540858
Committed by GitHub
2 parents d48f89ee 8fdd10d1

Merge pull request #964 from DavidSche/wvp-28181-2.0

修复在国标级联选择通道时,如果添加通道到跟平台根目录(即平台本身),无法触发目录变更事件问题.详见 https://github.com/…
src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java
... ... @@ -126,7 +126,15 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
126 126 List<DeviceChannel> deviceChannelList = new ArrayList<>();
127 127 if (channelReduces.size() > 0){
128 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 138 logger.warn("未查询到目录{}的信息", catalogId);
131 139 return null;
132 140 }
... ...