From f88c70d38ce1c9c0d04460d0c225373c84dc2eca Mon Sep 17 00:00:00 2001 From: dengming <dengming@ctfo.com> Date: 星期四, 10 三月 2022 17:27:07 +0800 Subject: [PATCH] 删除重复字段,channelId字段查询了两次 --- 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