Commit c9164330424180cc8b35f4c4adc3e4a57101f812

Authored by 648540858
1 parent 18ad5022

优化更新通道中父结点的判断

src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
@@ -112,7 +112,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent @@ -112,7 +112,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
112 logger.info("[收到目录订阅]:但是解析失败 {}", new String(evt.getRequest().getRawContent())); 112 logger.info("[收到目录订阅]:但是解析失败 {}", new String(evt.getRequest().getRawContent()));
113 continue; 113 continue;
114 } 114 }
115 - if (channel.getParentId().equals(sipConfig.getId())) { 115 + if (channel.getParentId() != null && channel.getParentId().equals(sipConfig.getId())) {
116 channel.setParentId(null); 116 channel.setParentId(null);
117 } 117 }
118 channel.setDeviceId(device.getDeviceId()); 118 channel.setDeviceId(device.getDeviceId());
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
@@ -417,7 +417,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements @@ -417,7 +417,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
417 logger.info("[收到目录订阅]:但是解析失败 {}", new String(evt.getRequest().getRawContent())); 417 logger.info("[收到目录订阅]:但是解析失败 {}", new String(evt.getRequest().getRawContent()));
418 continue; 418 continue;
419 } 419 }
420 - if (channel.getParentId().equals(sipConfig.getId())) { 420 + if (channel.getParentId() != null && channel.getParentId().equals(sipConfig.getId())) {
421 channel.setParentId(null); 421 channel.setParentId(null);
422 } 422 }
423 channel.setDeviceId(device.getDeviceId()); 423 channel.setDeviceId(device.getDeviceId());
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java
@@ -116,18 +116,18 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp @@ -116,18 +116,18 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
116 if (channelDeviceElement == null) { 116 if (channelDeviceElement == null) {
117 continue; 117 continue;
118 } 118 }
119 - DeviceChannel deviceChannel = XmlUtil.channelContentHandler(itemDevice, device, null, civilCodeFileConf);  
120 - if (deviceChannel == null) { 119 + DeviceChannel channel = XmlUtil.channelContentHandler(itemDevice, device, null, civilCodeFileConf);
  120 + if (channel == null) {
121 logger.info("[收到目录订阅]:但是解析失败 {}", new String(evt.getRequest().getRawContent())); 121 logger.info("[收到目录订阅]:但是解析失败 {}", new String(evt.getRequest().getRawContent()));
122 continue; 122 continue;
123 } 123 }
124 - if (deviceChannel.getParentId().equals(sipConfig.getId())) {  
125 - deviceChannel.setParentId(null); 124 + if (channel.getParentId() != null && channel.getParentId().equals(sipConfig.getId())) {
  125 + channel.setParentId(null);
126 } 126 }
127 - SipUtils.updateGps(deviceChannel, device.getGeoCoordSys());  
128 - deviceChannel.setDeviceId(take.getDevice().getDeviceId()); 127 + SipUtils.updateGps(channel, device.getGeoCoordSys());
  128 + channel.setDeviceId(take.getDevice().getDeviceId());
129 129
130 - channelList.add(deviceChannel); 130 + channelList.add(channel);
131 } 131 }
132 int sn = Integer.parseInt(snElement.getText()); 132 int sn = Integer.parseInt(snElement.getText());
133 catalogDataCatch.put(take.getDevice().getDeviceId(), sn, sumNum, take.getDevice(), channelList); 133 catalogDataCatch.put(take.getDevice().getDeviceId(), sn, sumNum, take.getDevice(), channelList);