From 28b5cc39d0a2d9939f70b4c980a31d9b27fc1e4c Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期二, 19 七月 2022 14:27:30 +0800 Subject: [PATCH] 修复更新推流状态sql错误 --- src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java | 12 ++++++------ src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java | 6 ++---- src/main/java/com/genersoft/iot/vmp/service/impl/RedisGpsMsgListener.java | 1 + src/main/java/com/genersoft/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEventLister.java | 1 - 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEventLister.java b/src/main/java/com/genersoft/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEventLister.java index 14ed76a..56bdeb5 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEventLister.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEventLister.java @@ -65,7 +65,6 @@ } // 鏌ヨ鏄惁鏈夋帹娴侊紝 濡傛灉鏈夊垯閮藉仠姝� List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServer(event.getPlatformGbID()); - logger.info("[ 骞冲彴鏈敞鍐屼簨浠� ] 鍋滄[ {} ]鐨勬墍鏈夋帹娴乻ize", sendRtpItems.size()); if (sendRtpItems != null && sendRtpItems.size() > 0) { logger.info("[ 骞冲彴鏈敞鍐屼簨浠� ] 鍋滄[ {} ]鐨勬墍鏈夋帹娴�", event.getPlatformGbID()); for (SendRtpItem sendRtpItem : sendRtpItems) { 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 0bad048..7edee4d 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 @@ -66,10 +66,8 @@ for (DeviceChannel deviceChannel : gbStreams) { String gbId = deviceChannel.getChannelId(); GPSMsgInfo gpsMsgInfo = redisCatchStorage.getGpsMsgInfo(gbId); - if (gpsMsgInfo != null) { // 鏃犳渶鏂颁綅缃笉鍙戦�� - if (logger.isDebugEnabled()) { - logger.debug("鏃犳渶鏂颁綅缃笉鍙戦��"); - } + // 鏃犳渶鏂颁綅缃笉鍙戦�� + if (gpsMsgInfo != null) { // 缁忕含搴﹂兘涓�0涓嶅彂閫� if (gpsMsgInfo.getLng() == 0 && gpsMsgInfo.getLat() == 0) { continue; diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/RedisGpsMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/impl/RedisGpsMsgListener.java index be21401..7482833 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/RedisGpsMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/RedisGpsMsgListener.java @@ -25,6 +25,7 @@ @Override public void onMessage(@NotNull Message message, byte[] bytes) { + // TODO 鍔犳秷鎭槦鍒� GPSMsgInfo gpsMsgInfo = JSON.parseObject(message.getBody(), GPSMsgInfo.class); redisCatchStorage.updateGpsMsgInfo(gpsMsgInfo); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java index 895316d..4f2fbe2 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java @@ -125,16 +125,16 @@ "where sp.status = 1 and (gs.app, gs.stream) in (" + "<foreach collection='offlineStreams' item='item' separator=','>" + "(#{item.app}, #{item.stream}) " + - ")</foreach>" + - "</script>") + "</foreach>" + + ")</script>") List<GbStream> getOnlinePusherForGbInList(List<StreamPushItemFromRedis> offlineStreams); @Update("<script> "+ "UPDATE stream_push SET status=0 where (app, stream) in (" + "<foreach collection='offlineStreams' item='item' separator=','>" + "(#{item.app}, #{item.stream}) " + - ")</foreach>" + - "</script>") + "</foreach>" + + ")</script>") void offline(List<StreamPushItemFromRedis> offlineStreams); @Select("<script> "+ @@ -150,8 +150,8 @@ "UPDATE stream_push SET status=1 where (app, stream) in (" + "<foreach collection='onlineStreams' item='item' separator=','>" + "(#{item.app}, #{item.stream}) " + - ")</foreach>" + - "</script>") + "</foreach>" + + ")</script>") void online(List<StreamPushItemFromRedis> onlineStreams); @Select("SELECT gs.* FROM stream_push sp left join gb_stream gs on sp.app = gs.app AND sp.stream = gs.stream where sp.status = 1") -- Gitblit v1.8.0