Commit 394c40d8bb29b8e40fc7978ea638f1592b03d617
1 parent
4bda14b0
修复目录订阅的状态异常
Showing
3 changed files
with
11 additions
and
9 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
| ... | ... | @@ -203,12 +203,6 @@ public class XmlUtil { |
| 203 | 203 | return null; |
| 204 | 204 | } |
| 205 | 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 | 206 | if (event != null && !event.equals(CatalogEvent.ADD) && !event.equals(CatalogEvent.UPDATE)) { |
| 213 | 207 | // 除了ADD和update情况下需要识别全部内容, |
| 214 | 208 | return deviceChannel; |
| ... | ... | @@ -217,17 +211,26 @@ public class XmlUtil { |
| 217 | 211 | ChannelType channelType = ChannelType.Other; |
| 218 | 212 | if (channelId.length() <= 8) { |
| 219 | 213 | channelType = ChannelType.CivilCode; |
| 214 | + deviceChannel.setHasAudio(false); | |
| 220 | 215 | }else { |
| 221 | 216 | if (channelId.length() == 20) { |
| 222 | 217 | int code = Integer.parseInt(channelId.substring(10, 13)); |
| 223 | 218 | switch (code){ |
| 224 | 219 | case 215: |
| 225 | 220 | channelType = ChannelType.BusinessGroup; |
| 221 | + deviceChannel.setHasAudio(false); | |
| 226 | 222 | break; |
| 227 | 223 | case 216: |
| 228 | 224 | channelType = ChannelType.VirtualOrganization; |
| 225 | + deviceChannel.setHasAudio(false); | |
| 226 | + break; | |
| 227 | + case 136: | |
| 228 | + case 137: | |
| 229 | + case 138: | |
| 230 | + deviceChannel.setHasAudio(true); | |
| 229 | 231 | break; |
| 230 | 232 | default: |
| 233 | + deviceChannel.setHasAudio(false); | |
| 231 | 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 | 19 | @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " + |
| 20 | 20 | "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + |
| 21 | 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 | 23 | "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + |
| 24 | 24 | "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + |
| 25 | 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 | 27 | int add(DeviceChannel channel); |
| 28 | 28 | |
| 29 | 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 | 133 | deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId()); |
| 134 | 134 | deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio()); |
| 135 | 135 | } |
| 136 | - | |
| 137 | 136 | channels.add(deviceChannel); |
| 138 | 137 | if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) { |
| 139 | 138 | if (subContMap.get(deviceChannel.getParentId()) == null) { | ... | ... |