Commit 28b5cc39d0a2d9939f70b4c980a31d9b27fc1e4c
1 parent
03864ae4
修复更新推流状态sql错误
Showing
4 changed files
with
9 additions
and
11 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEventLister.java
| ... | ... | @@ -65,7 +65,6 @@ public class PlatformNotRegisterEventLister implements ApplicationListener<Platf |
| 65 | 65 | } |
| 66 | 66 | // 查询是否有推流, 如果有则都停止 |
| 67 | 67 | List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServer(event.getPlatformGbID()); |
| 68 | - logger.info("[ 平台未注册事件 ] 停止[ {} ]的所有推流size", sendRtpItems.size()); | |
| 69 | 68 | if (sendRtpItems != null && sendRtpItems.size() > 0) { |
| 70 | 69 | logger.info("[ 平台未注册事件 ] 停止[ {} ]的所有推流", event.getPlatformGbID()); |
| 71 | 70 | for (SendRtpItem sendRtpItem : sendRtpItems) { | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java
| ... | ... | @@ -66,10 +66,8 @@ public class MobilePositionSubscribeHandlerTask implements ISubscribeTask { |
| 66 | 66 | for (DeviceChannel deviceChannel : gbStreams) { |
| 67 | 67 | String gbId = deviceChannel.getChannelId(); |
| 68 | 68 | GPSMsgInfo gpsMsgInfo = redisCatchStorage.getGpsMsgInfo(gbId); |
| 69 | - if (gpsMsgInfo != null) { // 无最新位置不发送 | |
| 70 | - if (logger.isDebugEnabled()) { | |
| 71 | - logger.debug("无最新位置不发送"); | |
| 72 | - } | |
| 69 | + // 无最新位置不发送 | |
| 70 | + if (gpsMsgInfo != null) { | |
| 73 | 71 | // 经纬度都为0不发送 |
| 74 | 72 | if (gpsMsgInfo.getLng() == 0 && gpsMsgInfo.getLat() == 0) { |
| 75 | 73 | continue; | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/RedisGpsMsgListener.java
| ... | ... | @@ -25,6 +25,7 @@ public class RedisGpsMsgListener implements MessageListener { |
| 25 | 25 | |
| 26 | 26 | @Override |
| 27 | 27 | public void onMessage(@NotNull Message message, byte[] bytes) { |
| 28 | + // TODO 加消息队列 | |
| 28 | 29 | GPSMsgInfo gpsMsgInfo = JSON.parseObject(message.getBody(), GPSMsgInfo.class); |
| 29 | 30 | redisCatchStorage.updateGpsMsgInfo(gpsMsgInfo); |
| 30 | 31 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java
| ... | ... | @@ -125,16 +125,16 @@ public interface StreamPushMapper { |
| 125 | 125 | "where sp.status = 1 and (gs.app, gs.stream) in (" + |
| 126 | 126 | "<foreach collection='offlineStreams' item='item' separator=','>" + |
| 127 | 127 | "(#{item.app}, #{item.stream}) " + |
| 128 | - ")</foreach>" + | |
| 129 | - "</script>") | |
| 128 | + "</foreach>" + | |
| 129 | + ")</script>") | |
| 130 | 130 | List<GbStream> getOnlinePusherForGbInList(List<StreamPushItemFromRedis> offlineStreams); |
| 131 | 131 | |
| 132 | 132 | @Update("<script> "+ |
| 133 | 133 | "UPDATE stream_push SET status=0 where (app, stream) in (" + |
| 134 | 134 | "<foreach collection='offlineStreams' item='item' separator=','>" + |
| 135 | 135 | "(#{item.app}, #{item.stream}) " + |
| 136 | - ")</foreach>" + | |
| 137 | - "</script>") | |
| 136 | + "</foreach>" + | |
| 137 | + ")</script>") | |
| 138 | 138 | void offline(List<StreamPushItemFromRedis> offlineStreams); |
| 139 | 139 | |
| 140 | 140 | @Select("<script> "+ |
| ... | ... | @@ -150,8 +150,8 @@ public interface StreamPushMapper { |
| 150 | 150 | "UPDATE stream_push SET status=1 where (app, stream) in (" + |
| 151 | 151 | "<foreach collection='onlineStreams' item='item' separator=','>" + |
| 152 | 152 | "(#{item.app}, #{item.stream}) " + |
| 153 | - ")</foreach>" + | |
| 154 | - "</script>") | |
| 153 | + "</foreach>" + | |
| 154 | + ")</script>") | |
| 155 | 155 | void online(List<StreamPushItemFromRedis> onlineStreams); |
| 156 | 156 | |
| 157 | 157 | @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") | ... | ... |