From db865cc9cc7d65e80ea2084ea7c242d31d85eb2c Mon Sep 17 00:00:00 2001
From: 648540858 <456panlinlin>
Date: 星期四, 28 四月 2022 18:18:09 +0800
Subject: [PATCH] #453
---
src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java | 31 +++++++++++++------------------
1 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java b/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java
index 569a9b7..c495403 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java
@@ -24,56 +24,51 @@
private IVideoManagerStorage storager;
private ISIPCommanderForPlatform sipCommanderForPlatform;
private SubscribeHolder subscribeHolder;
- private String platformId;
+ private ParentPlatform platform;
private String sn;
private String key;
public MobilePositionSubscribeHandlerTask(IRedisCatchStorage redisCatchStorage, ISIPCommanderForPlatform sipCommanderForPlatform, IVideoManagerStorage storager, String platformId, String sn, String key, SubscribeHolder subscribeInfo) {
this.redisCatchStorage = redisCatchStorage;
this.storager = storager;
- this.platformId = platformId;
+ this.platform = storager.queryParentPlatByServerGBId(platformId);
this.sn = sn;
this.key = key;
this.sipCommanderForPlatform = sipCommanderForPlatform;
this.subscribeHolder = subscribeInfo;
}
- @Async
@Override
public void run() {
- logger.info("鎵цMobilePositionSubscribeHandlerTask");
- SubscribeInfo subscribe = subscribeHolder.getMobilePositionSubscribe(platformId);
+ if (platform == null) return;
+ SubscribeInfo subscribe = subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId());
if (subscribe != null) {
- ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(platformId);
- if (parentPlatform == null ) {
- logger.info("鍙戦�佽闃呮椂鏈壘鍒板钩鍙颁俊鎭細{}", platformId);
- return;
- }
- if (!parentPlatform.isStatus()) {
- logger.info("鍙戦�佽闃呮椂鍙戠幇骞冲彴宸茬粡绂荤嚎锛歿}", platformId);
- return;
- }
+
+// if (!parentPlatform.isStatus()) {
+// logger.info("鍙戦�佽闃呮椂鍙戠幇骞冲彴宸茬粡绂荤嚎锛歿}", platformId);
+// return;
+// }
// TODO 鏆傛椂鍙鐞嗚棰戞祦鐨勫洖澶�,鍚庣画澧炲姞瀵瑰浗鏍囪澶囩殑鏀寔
- List<GbStream> gbStreams = storager.queryGbStreamListInPlatform(platformId);
+ List<GbStream> gbStreams = storager.queryGbStreamListInPlatform(platform.getServerGBId());
if (gbStreams.size() == 0) {
- logger.info("鍙戦�佽闃呮椂鍙戠幇骞冲彴宸茬粡娌℃湁鍏宠仈鐨勭洿鎾祦锛歿}", platformId);
+ logger.info("鍙戦�佽闃呮椂鍙戠幇骞冲彴宸茬粡娌℃湁鍏宠仈鐨勭洿鎾祦锛歿}", platform.getServerGBId());
return;
}
for (GbStream gbStream : gbStreams) {
String gbId = gbStream.getGbId();
GPSMsgInfo gpsMsgInfo = redisCatchStorage.getGpsMsgInfo(gbId);
if (gpsMsgInfo != null) { // 鏃犳渶鏂颁綅缃笉鍙戦��
+ logger.info("鏃犳渶鏂颁綅缃笉鍙戦��");
// 缁忕含搴﹂兘涓�0涓嶅彂閫�
if (gpsMsgInfo.getLng() == 0 && gpsMsgInfo.getLat() == 0) {
continue;
}
// 鍙戦�丟PS娑堟伅
- sipCommanderForPlatform.sendNotifyMobilePosition(parentPlatform, gpsMsgInfo, subscribe);
+ sipCommanderForPlatform.sendNotifyMobilePosition(platform, gpsMsgInfo, subscribe);
}
}
}
- logger.info("缁撴潫鎵цMobilePositionSubscribeHandlerTask");
}
@Override
--
Gitblit v1.8.0