Commit 394c40d8bb29b8e40fc7978ea638f1592b03d617

Authored by 648540858
1 parent 4bda14b0

修复目录订阅的状态异常

src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
@@ -203,12 +203,6 @@ public class XmlUtil { @@ -203,12 +203,6 @@ public class XmlUtil {
203 return null; 203 return null;
204 } 204 }
205 deviceChannel.setChannelId(channelId); 205 deviceChannel.setChannelId(channelId);
206 - int channelTypeCode = Integer.parseInt(channelId.substring(10, 13));  
207 - if (channelTypeCode == 136 || channelTypeCode == 137 || channelTypeCode == 138) {  
208 - deviceChannel.setHasAudio(true);  
209 - }else {  
210 - deviceChannel.setHasAudio(false);  
211 - }  
212 if (event != null && !event.equals(CatalogEvent.ADD) && !event.equals(CatalogEvent.UPDATE)) { 206 if (event != null && !event.equals(CatalogEvent.ADD) && !event.equals(CatalogEvent.UPDATE)) {
213 // 除了ADD和update情况下需要识别全部内容, 207 // 除了ADD和update情况下需要识别全部内容,
214 return deviceChannel; 208 return deviceChannel;
@@ -217,17 +211,26 @@ public class XmlUtil { @@ -217,17 +211,26 @@ public class XmlUtil {
217 ChannelType channelType = ChannelType.Other; 211 ChannelType channelType = ChannelType.Other;
218 if (channelId.length() <= 8) { 212 if (channelId.length() <= 8) {
219 channelType = ChannelType.CivilCode; 213 channelType = ChannelType.CivilCode;
  214 + deviceChannel.setHasAudio(false);
220 }else { 215 }else {
221 if (channelId.length() == 20) { 216 if (channelId.length() == 20) {
222 int code = Integer.parseInt(channelId.substring(10, 13)); 217 int code = Integer.parseInt(channelId.substring(10, 13));
223 switch (code){ 218 switch (code){
224 case 215: 219 case 215:
225 channelType = ChannelType.BusinessGroup; 220 channelType = ChannelType.BusinessGroup;
  221 + deviceChannel.setHasAudio(false);
226 break; 222 break;
227 case 216: 223 case 216:
228 channelType = ChannelType.VirtualOrganization; 224 channelType = ChannelType.VirtualOrganization;
  225 + deviceChannel.setHasAudio(false);
  226 + break;
  227 + case 136:
  228 + case 137:
  229 + case 138:
  230 + deviceChannel.setHasAudio(true);
229 break; 231 break;
230 default: 232 default:
  233 + deviceChannel.setHasAudio(false);
231 break; 234 break;
232 235
233 } 236 }
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
@@ -19,11 +19,11 @@ public interface DeviceChannelMapper { @@ -19,11 +19,11 @@ public interface DeviceChannelMapper {
19 @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " + 19 @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " +
20 "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + 20 "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
21 "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " + 21 "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
22 - "longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId, gpsTime) " + 22 + "longitudeWgs84, latitudeWgs84, hasAudio, createTime, updateTime, businessGroupId, gpsTime) " +
23 "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + 23 "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," +
24 "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + 24 "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " +
25 "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, " + 25 "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, " +
26 - "${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84},'${createTime}', '${updateTime}', '${businessGroupId}', '${gpsTime}')") 26 + "${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84}, ${hasAudio}, '${createTime}', '${updateTime}', '${businessGroupId}', '${gpsTime}')")
27 int add(DeviceChannel channel); 27 int add(DeviceChannel channel);
28 28
29 @Update(value = {" <script>" + 29 @Update(value = {" <script>" +
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
@@ -133,7 +133,6 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @@ -133,7 +133,6 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
133 deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId()); 133 deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId());
134 deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio()); 134 deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio());
135 } 135 }
136 -  
137 channels.add(deviceChannel); 136 channels.add(deviceChannel);
138 if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) { 137 if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) {
139 if (subContMap.get(deviceChannel.getParentId()) == null) { 138 if (subContMap.get(deviceChannel.getParentId()) == null) {