Commit 0532363192ae662b027844276af266f2fe2b16dc
1 parent
6b3732b8
优化国标级联注册机制
Showing
3 changed files
with
10 additions
and
10 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| ... | ... | @@ -339,7 +339,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 339 | 339 | }else { |
| 340 | 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 | 344 | catalogXml.append("<Longitude>" + |
| 345 | 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 | 225 | }else { |
| 226 | 226 | logger.warn("[xml解析] 无法确定行政区划{}的上级行政区划", channelId); |
| 227 | 227 | } |
| 228 | - deviceChannel.setStatus(1); | |
| 228 | + deviceChannel.setStatus(true); | |
| 229 | 229 | return deviceChannel; |
| 230 | 230 | }else { |
| 231 | 231 | if(channelId.length() != 20) { |
| ... | ... | @@ -284,7 +284,7 @@ public class XmlUtil { |
| 284 | 284 | if (!ObjectUtils.isEmpty(address)) { |
| 285 | 285 | deviceChannel.setAddress(address); |
| 286 | 286 | } |
| 287 | - deviceChannel.setStatus(1); | |
| 287 | + deviceChannel.setStatus(true); | |
| 288 | 288 | if (!ObjectUtils.isEmpty(registerWay)) { |
| 289 | 289 | try { |
| 290 | 290 | deviceChannel.setRegisterWay(Integer.parseInt(registerWay)); |
| ... | ... | @@ -298,7 +298,7 @@ public class XmlUtil { |
| 298 | 298 | return deviceChannel; |
| 299 | 299 | case 215: |
| 300 | 300 | // 业务分组 |
| 301 | - deviceChannel.setStatus(1); | |
| 301 | + deviceChannel.setStatus(true); | |
| 302 | 302 | if (!ObjectUtils.isEmpty(parentID)) { |
| 303 | 303 | if (!parentID.trim().equalsIgnoreCase(device.getDeviceId())) { |
| 304 | 304 | deviceChannel.setParentId(parentID); |
| ... | ... | @@ -312,7 +312,7 @@ public class XmlUtil { |
| 312 | 312 | break; |
| 313 | 313 | case 216: |
| 314 | 314 | // 虚拟组织 |
| 315 | - deviceChannel.setStatus(1); | |
| 315 | + deviceChannel.setStatus(true); | |
| 316 | 316 | if (!ObjectUtils.isEmpty(businessGroupID)) { |
| 317 | 317 | deviceChannel.setBusinessGroupId(businessGroupID); |
| 318 | 318 | } |
| ... | ... | @@ -476,13 +476,13 @@ public class XmlUtil { |
| 476 | 476 | if (status != null) { |
| 477 | 477 | // ONLINE OFFLINE HIKVISION DS-7716N-E4 NVR的兼容性处理 |
| 478 | 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 | 481 | if (status.equals("OFF") || status.equals("Off") || status.equals("OFFLINE")) { |
| 482 | - deviceChannel.setStatus(0); | |
| 482 | + deviceChannel.setStatus(false); | |
| 483 | 483 | } |
| 484 | 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 | 140 | if (allChannelMap.containsKey(deviceChannel.getChannelId())) { |
| 141 | 141 | deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId()); |
| 142 | 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 | 144 | List<String> strings = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getChannelId()); |
| 145 | 145 | if (!CollectionUtils.isEmpty(strings)){ |
| 146 | 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 | ... | ... |