From bea63f67e75ea6c38d946c2ee463260fcf815f87 Mon Sep 17 00:00:00 2001
From: Fang <costa11@qq.com>
Date: 星期一, 07 三月 2022 14:21:29 +0800
Subject: [PATCH] Merge branch '648540858:wvp-28181-2.0' into wvp-28181-2.0

---
 src/main/java/com/genersoft/iot/vmp/gb28181/task/GPSSubscribeTask.java |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/task/GPSSubscribeTask.java b/src/main/java/com/genersoft/iot/vmp/gb28181/task/GPSSubscribeTask.java
index ce990a0..25dc75b 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/task/GPSSubscribeTask.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/task/GPSSubscribeTask.java
@@ -36,7 +36,6 @@
 
         SubscribeInfo subscribe = redisCatchStorage.getSubscribe(key);
         if (subscribe != null) {
-            System.out.println("鍙戦�丟PS娑堟伅");
             ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(platformId);
             if (parentPlatform == null || parentPlatform.isStatus()) {
                 // TODO 鏆傛椂鍙鐞嗚棰戞祦鐨勫洖澶�,鍚庣画澧炲姞瀵瑰浗鏍囪澶囩殑鏀寔
@@ -45,15 +44,24 @@
                     for (GbStream gbStream : gbStreams) {
                         String gbId = gbStream.getGbId();
                         GPSMsgInfo gpsMsgInfo = redisCatchStorage.getGpsMsgInfo(gbId);
-                        if (gpsMsgInfo != null && gbStream.isStatus()) {
-                            // 鍙戦�丟PS娑堟伅
-                            sipCommanderForPlatform.sendMobilePosition(parentPlatform, gpsMsgInfo, subscribe);
+                        if (gbStream.isStatus()) {
+                            if (gpsMsgInfo != null) {
+                                // 鍙戦�丟PS娑堟伅
+                                sipCommanderForPlatform.sendNotifyMobilePosition(parentPlatform, gpsMsgInfo, subscribe);
+                            }else {
+                                // 娌℃湁鍦╮edis鎵惧埌鏂扮殑娑堟伅灏变娇鐢ㄦ暟鎹簱鐨勬秷鎭�
+                                gpsMsgInfo = new GPSMsgInfo();
+                                gpsMsgInfo.setId(gbId);
+                                gpsMsgInfo.setLat(gbStream.getLongitude());
+                                gpsMsgInfo.setLng(gbStream.getLongitude());
+                                // 鍙戦�丟PS娑堟伅
+                                sipCommanderForPlatform.sendNotifyMobilePosition(parentPlatform, gpsMsgInfo, subscribe);
+                            }
                         }
+
                     }
                 }
             }
         }
-
-
     }
 }

--
Gitblit v1.8.0