Commit 0532363192ae662b027844276af266f2fe2b16dc

Authored by 648540858
1 parent 6b3732b8

优化国标级联注册机制

src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
@@ -339,7 +339,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -339,7 +339,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
339 }else { 339 }else {
340 catalogXml.append("<PTZType></PTZType>\r\n"); 340 catalogXml.append("<PTZType></PTZType>\r\n");
341 } 341 }
342 - catalogXml.append("<Status>" + (channel.getStatus() == 1?"ON":"OFF") + "</Status>\r\n"); 342 + catalogXml.append("<Status>" + (channel.isStatus() ?"ON":"OFF") + "</Status>\r\n");
343 343
344 catalogXml.append("<Longitude>" + 344 catalogXml.append("<Longitude>" +
345 (channel.getLongitudeWgs84() != 0? channel.getLongitudeWgs84():channel.getLongitude()) 345 (channel.getLongitudeWgs84() != 0? channel.getLongitudeWgs84():channel.getLongitude())
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
@@ -225,7 +225,7 @@ public class XmlUtil { @@ -225,7 +225,7 @@ public class XmlUtil {
225 }else { 225 }else {
226 logger.warn("[xml解析] 无法确定行政区划{}的上级行政区划", channelId); 226 logger.warn("[xml解析] 无法确定行政区划{}的上级行政区划", channelId);
227 } 227 }
228 - deviceChannel.setStatus(1); 228 + deviceChannel.setStatus(true);
229 return deviceChannel; 229 return deviceChannel;
230 }else { 230 }else {
231 if(channelId.length() != 20) { 231 if(channelId.length() != 20) {
@@ -284,7 +284,7 @@ public class XmlUtil { @@ -284,7 +284,7 @@ public class XmlUtil {
284 if (!ObjectUtils.isEmpty(address)) { 284 if (!ObjectUtils.isEmpty(address)) {
285 deviceChannel.setAddress(address); 285 deviceChannel.setAddress(address);
286 } 286 }
287 - deviceChannel.setStatus(1); 287 + deviceChannel.setStatus(true);
288 if (!ObjectUtils.isEmpty(registerWay)) { 288 if (!ObjectUtils.isEmpty(registerWay)) {
289 try { 289 try {
290 deviceChannel.setRegisterWay(Integer.parseInt(registerWay)); 290 deviceChannel.setRegisterWay(Integer.parseInt(registerWay));
@@ -298,7 +298,7 @@ public class XmlUtil { @@ -298,7 +298,7 @@ public class XmlUtil {
298 return deviceChannel; 298 return deviceChannel;
299 case 215: 299 case 215:
300 // 业务分组 300 // 业务分组
301 - deviceChannel.setStatus(1); 301 + deviceChannel.setStatus(true);
302 if (!ObjectUtils.isEmpty(parentID)) { 302 if (!ObjectUtils.isEmpty(parentID)) {
303 if (!parentID.trim().equalsIgnoreCase(device.getDeviceId())) { 303 if (!parentID.trim().equalsIgnoreCase(device.getDeviceId())) {
304 deviceChannel.setParentId(parentID); 304 deviceChannel.setParentId(parentID);
@@ -312,7 +312,7 @@ public class XmlUtil { @@ -312,7 +312,7 @@ public class XmlUtil {
312 break; 312 break;
313 case 216: 313 case 216:
314 // 虚拟组织 314 // 虚拟组织
315 - deviceChannel.setStatus(1); 315 + deviceChannel.setStatus(true);
316 if (!ObjectUtils.isEmpty(businessGroupID)) { 316 if (!ObjectUtils.isEmpty(businessGroupID)) {
317 deviceChannel.setBusinessGroupId(businessGroupID); 317 deviceChannel.setBusinessGroupId(businessGroupID);
318 } 318 }
@@ -476,13 +476,13 @@ public class XmlUtil { @@ -476,13 +476,13 @@ public class XmlUtil {
476 if (status != null) { 476 if (status != null) {
477 // ONLINE OFFLINE HIKVISION DS-7716N-E4 NVR的兼容性处理 477 // ONLINE OFFLINE HIKVISION DS-7716N-E4 NVR的兼容性处理
478 if (status.equals("ON") || status.equals("On") || status.equals("ONLINE") || status.equals("OK")) { 478 if (status.equals("ON") || status.equals("On") || status.equals("ONLINE") || status.equals("OK")) {
479 - deviceChannel.setStatus(1); 479 + deviceChannel.setStatus(true);
480 } 480 }
481 if (status.equals("OFF") || status.equals("Off") || status.equals("OFFLINE")) { 481 if (status.equals("OFF") || status.equals("Off") || status.equals("OFFLINE")) {
482 - deviceChannel.setStatus(0); 482 + deviceChannel.setStatus(false);
483 } 483 }
484 }else { 484 }else {
485 - deviceChannel.setStatus(1); 485 + deviceChannel.setStatus(true);
486 } 486 }
487 487
488 // 经度 488 // 经度
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
@@ -140,11 +140,11 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @@ -140,11 +140,11 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
140 if (allChannelMap.containsKey(deviceChannel.getChannelId())) { 140 if (allChannelMap.containsKey(deviceChannel.getChannelId())) {
141 deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId()); 141 deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId());
142 deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio()); 142 deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio());
143 - if (allChannelMap.get(deviceChannel.getChannelId()).getStatus() !=deviceChannel.getStatus()){ 143 + if (allChannelMap.get(deviceChannel.getChannelId()).isStatus() !=deviceChannel.isStatus()){
144 List<String> strings = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getChannelId()); 144 List<String> strings = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getChannelId());
145 if (!CollectionUtils.isEmpty(strings)){ 145 if (!CollectionUtils.isEmpty(strings)){
146 strings.forEach(platformId->{ 146 strings.forEach(platformId->{
147 - eventPublisher.catalogEventPublish(platformId, deviceChannel, deviceChannel.getStatus()==1?CatalogEvent.ON:CatalogEvent.OFF); 147 + eventPublisher.catalogEventPublish(platformId, deviceChannel, deviceChannel.isStatus()?CatalogEvent.ON:CatalogEvent.OFF);
148 }); 148 });
149 } 149 }
150 150