Commit 91515f1b05aca0073b5dd3d4e2b3855d9b69066b
1 parent
93d69d54
添加行政区划功能,修复目录发送数量统计的BUG
Showing
7 changed files
with
20 additions
and
14 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java
| ... | ... | @@ -29,7 +29,6 @@ public class MobilePositionSubscribeHandlerTask implements ISubscribeTask { |
| 29 | 29 | private String key; |
| 30 | 30 | |
| 31 | 31 | public MobilePositionSubscribeHandlerTask(IRedisCatchStorage redisCatchStorage, ISIPCommanderForPlatform sipCommanderForPlatform, IVideoManagerStorage storager, String platformId, String sn, String key, SubscribeHolder subscribeInfo) { |
| 32 | - System.out.println("MobilePositionSubscribeHandlerTask 初始化"); | |
| 33 | 32 | this.redisCatchStorage = redisCatchStorage; |
| 34 | 33 | this.storager = storager; |
| 35 | 34 | this.platform = storager.queryParentPlatByServerGBId(platformId); | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| ... | ... | @@ -293,12 +293,11 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 293 | 293 | } |
| 294 | 294 | try { |
| 295 | 295 | List<DeviceChannel> deviceChannels; |
| 296 | - if (index + parentPlatform.getCatalogGroup() < channels.size() - 1) { | |
| 296 | + if (index + parentPlatform.getCatalogGroup() < channels.size()) { | |
| 297 | 297 | deviceChannels = channels.subList(index, index + parentPlatform.getCatalogGroup()); |
| 298 | 298 | }else { |
| 299 | 299 | deviceChannels = channels.subList(index, channels.size()); |
| 300 | 300 | } |
| 301 | - | |
| 302 | 301 | String catalogXml = getCatalogXml(deviceChannels, sn, parentPlatform, channels.size()); |
| 303 | 302 | // callid |
| 304 | 303 | CallIdHeader callIdHeader = parentPlatform.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| ... | ... | @@ -445,7 +444,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 445 | 444 | return true; |
| 446 | 445 | } |
| 447 | 446 | List<DeviceChannel> channels; |
| 448 | - if (index + parentPlatform.getCatalogGroup() < deviceChannels.size() - 1) { | |
| 447 | + if (index + parentPlatform.getCatalogGroup() < deviceChannels.size()) { | |
| 449 | 448 | channels = deviceChannels.subList(index, index + parentPlatform.getCatalogGroup()); |
| 450 | 449 | }else { |
| 451 | 450 | channels = deviceChannels.subList(index, deviceChannels.size()); |
| ... | ... | @@ -579,7 +578,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 579 | 578 | return true; |
| 580 | 579 | } |
| 581 | 580 | List<DeviceChannel> channels; |
| 582 | - if (index + parentPlatform.getCatalogGroup() < deviceChannels.size() - 1) { | |
| 581 | + if (index + parentPlatform.getCatalogGroup() < deviceChannels.size()) { | |
| 583 | 582 | channels = deviceChannels.subList(index, index + parentPlatform.getCatalogGroup()); |
| 584 | 583 | }else { |
| 585 | 584 | channels = deviceChannels.subList(index, deviceChannels.size()); | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java
| ... | ... | @@ -79,7 +79,7 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple |
| 79 | 79 | deviceChannel.setParental(1); |
| 80 | 80 | deviceChannel.setParentId(catalog.getParentId()); |
| 81 | 81 | deviceChannel.setRegisterWay(1); |
| 82 | - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); | |
| 82 | + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | |
| 83 | 83 | deviceChannel.setModel("live"); |
| 84 | 84 | deviceChannel.setOwner("wvp-pro"); |
| 85 | 85 | deviceChannel.setSecrecy("0"); |
| ... | ... | @@ -116,7 +116,7 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple |
| 116 | 116 | deviceChannel.setStatus(1); |
| 117 | 117 | deviceChannel.setParentId(gbStream.getCatalogId()); |
| 118 | 118 | deviceChannel.setRegisterWay(1); |
| 119 | - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); | |
| 119 | + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | |
| 120 | 120 | deviceChannel.setModel("live"); |
| 121 | 121 | deviceChannel.setOwner("wvp-pro"); |
| 122 | 122 | deviceChannel.setParental(0); | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java
| ... | ... | @@ -93,7 +93,7 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem |
| 93 | 93 | deviceChannel.setParental(1); |
| 94 | 94 | deviceChannel.setParentId(catalog.getParentId()); |
| 95 | 95 | deviceChannel.setRegisterWay(1); |
| 96 | - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); | |
| 96 | + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | |
| 97 | 97 | deviceChannel.setModel("live"); |
| 98 | 98 | deviceChannel.setOwner("wvp-pro"); |
| 99 | 99 | deviceChannel.setSecrecy("0"); |
| ... | ... | @@ -130,7 +130,7 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem |
| 130 | 130 | deviceChannel.setStatus(1); |
| 131 | 131 | deviceChannel.setParentId(gbStream.getCatalogId()); |
| 132 | 132 | deviceChannel.setRegisterWay(1); |
| 133 | - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); | |
| 133 | + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | |
| 134 | 134 | deviceChannel.setModel("live"); |
| 135 | 135 | deviceChannel.setOwner("wvp-pro"); |
| 136 | 136 | deviceChannel.setParental(0); | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
| ... | ... | @@ -420,9 +420,6 @@ public class StreamPushServiceImpl implements IStreamPushService { |
| 420 | 420 | continue; |
| 421 | 421 | } |
| 422 | 422 | streamPushItemForPlatform.setPlatformId(platFormInfoArray[0]); |
| 423 | - if (platFormInfoArray[0].equals("34020000002110000001")) { | |
| 424 | - System.out.println(111); | |
| 425 | - } | |
| 426 | 423 | List<GbStream> gbStreamList = platformForEvent.get(platFormInfoArray[0]); |
| 427 | 424 | if (gbStreamList == null) { |
| 428 | 425 | gbStreamList = new ArrayList<>(); | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
| ... | ... | @@ -524,7 +524,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { |
| 524 | 524 | parentPlatform.setCatalogGroup(1); |
| 525 | 525 | } |
| 526 | 526 | if (parentPlatform.getAdministrativeDivision() == null) { |
| 527 | - parentPlatform.setAdministrativeDivision(parentPlatform.getDeviceGBId().substring(0,6)); | |
| 527 | + parentPlatform.setAdministrativeDivision(parentPlatform.getAdministrativeDivision()); | |
| 528 | 528 | } |
| 529 | 529 | ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId()); |
| 530 | 530 | if (parentPlatform.getId() == null ) { |
| ... | ... | @@ -1081,7 +1081,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { |
| 1081 | 1081 | deviceChannel.setParentId(catalog.getParentId()); |
| 1082 | 1082 | deviceChannel.setRegisterWay(1); |
| 1083 | 1083 | // 行政区划应该是Domain的前八位 |
| 1084 | - deviceChannel.setCivilCode(parentPlatByServerGBId.getDeviceGBId().substring(0,6)); | |
| 1084 | + deviceChannel.setCivilCode(parentPlatByServerGBId.getAdministrativeDivision()); | |
| 1085 | 1085 | deviceChannel.setModel("live"); |
| 1086 | 1086 | deviceChannel.setOwner("wvp-pro"); |
| 1087 | 1087 | deviceChannel.setSecrecy("0"); | ... | ... |
web_src/src/components/dialog/platformEdit.vue
| ... | ... | @@ -44,6 +44,9 @@ |
| 44 | 44 | <el-form-item label="SIP认证用户名" prop="username"> |
| 45 | 45 | <el-input v-model="platform.username"></el-input> |
| 46 | 46 | </el-form-item> |
| 47 | + <el-form-item label="行政区划" prop="administrativeDivision"> | |
| 48 | + <el-input v-model="platform.administrativeDivision" clearable></el-input> | |
| 49 | + </el-form-item> | |
| 47 | 50 | <el-form-item label="SIP认证密码" prop="password"> |
| 48 | 51 | <el-input v-model="platform.password" ></el-input> |
| 49 | 52 | </el-form-item> |
| ... | ... | @@ -153,6 +156,7 @@ export default { |
| 153 | 156 | shareAllLiveStream: false, |
| 154 | 157 | startOfflinePush: false, |
| 155 | 158 | catalogGroup: 1, |
| 159 | + administrativeDivision: null, | |
| 156 | 160 | }, |
| 157 | 161 | rules: { |
| 158 | 162 | name: [{ required: true, message: "请输入平台名称", trigger: "blur" }], |
| ... | ... | @@ -190,6 +194,7 @@ export default { |
| 190 | 194 | that.platform.devicePort = res.data.devicePort; |
| 191 | 195 | that.platform.username = res.data.username; |
| 192 | 196 | that.platform.password = res.data.password; |
| 197 | + that.platform.administrativeDivision = res.data.username.substr(0, 6); | |
| 193 | 198 | }).catch(function (error) { |
| 194 | 199 | console.log(error); |
| 195 | 200 | }); |
| ... | ... | @@ -216,6 +221,7 @@ export default { |
| 216 | 221 | this.platform.catalogId = platform.catalogId; |
| 217 | 222 | this.platform.startOfflinePush = platform.startOfflinePush; |
| 218 | 223 | this.platform.catalogGroup = platform.catalogGroup; |
| 224 | + this.platform.administrativeDivision = platform.administrativeDivision; | |
| 219 | 225 | this.onSubmit_text = "保存"; |
| 220 | 226 | this.saveUrl = "/api/platform/save"; |
| 221 | 227 | } |
| ... | ... | @@ -230,6 +236,10 @@ export default { |
| 230 | 236 | deviceGBIdChange: function () { |
| 231 | 237 | |
| 232 | 238 | this.platform.username = this.platform.deviceGBId ; |
| 239 | + if (this.platform.administrativeDivision == null) { | |
| 240 | + this.platform.administrativeDivision = this.platform.deviceGBId.substr(0, 6); | |
| 241 | + } | |
| 242 | + | |
| 233 | 243 | }, |
| 234 | 244 | onSubmit: function () { |
| 235 | 245 | var that = this; |
| ... | ... | @@ -270,6 +280,7 @@ export default { |
| 270 | 280 | rtcp: false, |
| 271 | 281 | name: null, |
| 272 | 282 | serverGBId: null, |
| 283 | + administrativeDivision: null, | |
| 273 | 284 | serverGBDomain: null, |
| 274 | 285 | serverIP: null, |
| 275 | 286 | serverPort: null, | ... | ... |