Commit 1553b39b4547418774ab2bd6da72f75bfd14b972

Authored by 648540858
1 parent fb977546

修复级联的国标通道无经纬度问题

src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannelInPlatform.java 0 → 100644
  1 +package com.genersoft.iot.vmp.gb28181.bean;
  2 +
  3 +public class DeviceChannelInPlatform extends DeviceChannel{
  4 +
  5 + private String platFormId;
  6 + private String catalogId;
  7 +
  8 + public String getPlatFormId() {
  9 + return platFormId;
  10 + }
  11 +
  12 + public void setPlatFormId(String platFormId) {
  13 + this.platFormId = platFormId;
  14 + }
  15 +
  16 + public String getCatalogId() {
  17 + return catalogId;
  18 + }
  19 +
  20 + public void setCatalogId(String catalogId) {
  21 + this.catalogId = catalogId;
  22 + }
  23 +}
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java
... ... @@ -64,10 +64,10 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple
64 64 Element snElement = rootElement.element("SN");
65 65 String sn = snElement.getText();
66 66 // 准备回复通道信息
67   - List<ChannelReduce> channelReduces = storager.queryChannelListInParentPlatform(parentPlatform.getServerGBId());
  67 + List<DeviceChannelInPlatform> deviceChannels = storager.queryChannelListInParentPlatform(parentPlatform.getServerGBId());
68 68 // 查询关联的直播通道
69 69 List<GbStream> gbStreams = storager.queryGbStreamListInPlatform(parentPlatform.getServerGBId());
70   - int size = channelReduces.size() + gbStreams.size();
  70 + int size = deviceChannels.size() + gbStreams.size();
71 71 // 回复目录信息
72 72 List<PlatformCatalog> catalogs = storager.queryCatalogInPlatform(parentPlatform.getServerGBId());
73 73 if (catalogs.size() > 0) {
... ... @@ -96,14 +96,14 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple
96 96 }
97 97 }
98 98 // 回复级联的通道
99   - if (channelReduces.size() > 0) {
100   - for (ChannelReduce channelReduce : channelReduces) {
101   - if (channelReduce.getCatalogId().equals(parentPlatform.getServerGBId())) {
102   - channelReduce.setCatalogId(parentPlatform.getDeviceGBId());
  99 + if (deviceChannels.size() > 0) {
  100 + for (DeviceChannelInPlatform channel : deviceChannels) {
  101 + if (channel.getCatalogId().equals(parentPlatform.getServerGBId())) {
  102 + channel.setCatalogId(parentPlatform.getDeviceGBId());
103 103 }
104   - DeviceChannel deviceChannel = storager.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId());
  104 + DeviceChannel deviceChannel = storager.queryChannel(channel.getDeviceId(), channel.getChannelId());
105 105 deviceChannel.setParental(0);
106   - deviceChannel.setParentId(channelReduce.getCatalogId());
  106 + deviceChannel.setParentId(channel.getCatalogId());
107 107 deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0, 6));
108 108 cmderFroPlatform.catalogQuery(deviceChannel, parentPlatform, sn, fromHeader.getTag(), size);
109 109 // 防止发送过快
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java
... ... @@ -67,12 +67,12 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem
67 67 Element snElement = rootElement.element("SN");
68 68 String sn = snElement.getText();
69 69 // 准备回复通道信息
70   - List<ChannelReduce> channelReduces = storager.queryChannelListInParentPlatform(parentPlatform.getServerGBId());
  70 + List<DeviceChannelInPlatform> deviceChannelInPlatforms = storager.queryChannelListInParentPlatform(parentPlatform.getServerGBId());
71 71 // 查询关联的直播通道
72 72 List<GbStream> gbStreams = storager.queryGbStreamListInPlatform(parentPlatform.getServerGBId());
73 73 // 回复目录信息
74 74 List<PlatformCatalog> catalogs = storager.queryCatalogInPlatform(parentPlatform.getServerGBId());
75   - int size = catalogs.size() + channelReduces.size() + gbStreams.size();
  75 + int size = catalogs.size() + deviceChannelInPlatforms.size() + gbStreams.size();
76 76 if (catalogs.size() > 0) {
77 77 for (PlatformCatalog catalog : catalogs) {
78 78 if (catalog.getParentId().equals(parentPlatform.getServerGBId())) {
... ... @@ -99,14 +99,14 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem
99 99 }
100 100 }
101 101 // 回复级联的通道
102   - if (channelReduces.size() > 0) {
103   - for (ChannelReduce channelReduce : channelReduces) {
104   - if (channelReduce.getCatalogId().equals(parentPlatform.getServerGBId())) {
105   - channelReduce.setCatalogId(parentPlatform.getDeviceGBId());
  102 + if (deviceChannelInPlatforms.size() > 0) {
  103 + for (DeviceChannelInPlatform channel : deviceChannelInPlatforms) {
  104 + if (channel.getCatalogId().equals(parentPlatform.getServerGBId())) {
  105 + channel.setCatalogId(parentPlatform.getDeviceGBId());
106 106 }
107   - DeviceChannel deviceChannel = storager.queryChannel(channelReduce.getDeviceId(), channelReduce.getChannelId());
  107 + DeviceChannel deviceChannel = storager.queryChannel(channel.getDeviceId(), channel.getChannelId());
108 108 deviceChannel.setParental(0);
109   - deviceChannel.setParentId(channelReduce.getCatalogId());
  109 + deviceChannel.setParentId(channel.getCatalogId());
110 110 deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0, 6));
111 111 cmderFroPlatform.catalogQuery(deviceChannel, parentPlatform, sn, fromHeader.getTag(), size);
112 112 // 防止发送过快
... ...
src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorager.java
... ... @@ -245,7 +245,7 @@ public interface IVideoManagerStorager {
245 245 /**
246 246 * 查询设备的通道信息
247 247 */
248   - List<ChannelReduce> queryChannelListInParentPlatform(String platformId);
  248 + List<DeviceChannelInPlatform> queryChannelListInParentPlatform(String platformId);
249 249  
250 250  
251 251 /**
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
1 1 package com.genersoft.iot.vmp.storager.dao;
2 2  
3 3 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
  4 +import com.genersoft.iot.vmp.gb28181.bean.DeviceChannelInPlatform;
4 5 import com.genersoft.iot.vmp.vmanager.bean.DeviceChannelTree;
5 6 import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
6 7 import org.apache.ibatis.annotations.*;
... ... @@ -114,22 +115,15 @@ public interface DeviceChannelMapper {
114 115  
115 116 @Select(value = {" <script>" +
116 117 "SELECT " +
117   - " dc.id,\n" +
118   - " dc.channelId,\n" +
119   - " dc.deviceId,\n" +
120   - " dc.name,\n" +
121   - " de.manufacturer,\n" +
122   - " de.hostAddress,\n" +
123   - " dc.subCount,\n" +
  118 + " dc.*,\n" +
124 119 " pgc.platformId as platformId,\n" +
125 120 " pgc.catalogId as catalogId " +
126 121 " FROM device_channel dc " +
127   - " LEFT JOIN device de ON dc.deviceId = de.deviceId " +
128 122 " LEFT JOIN platform_gb_channel pgc on pgc.deviceChannelId = dc.id " +
129 123 " WHERE pgc.platformId = #{platformId} " +
130 124 " ORDER BY dc.deviceId, dc.channelId ASC" +
131 125 " </script>"})
132   - List<ChannelReduce> queryChannelByPlatformId(String platformId);
  126 + List<DeviceChannelInPlatform> queryChannelByPlatformId(String platformId);
133 127  
134 128  
135 129 @Select("SELECT * FROM device_channel WHERE channelId=#{channelId}")
... ...
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
... ... @@ -612,9 +612,9 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
612 612 }
613 613  
614 614 @Override
615   - public List<ChannelReduce> queryChannelListInParentPlatform(String platformId) {
  615 + public List<DeviceChannelInPlatform> queryChannelListInParentPlatform(String platformId) {
616 616  
617   - return deviceChannelMapper.queryChannelByPlatformId( platformId);
  617 + return deviceChannelMapper.queryChannelByPlatformId(platformId);
618 618 }
619 619  
620 620 @Override
... ...