修复更新推流状态sql错误
This commit is contained in:
parent
03864ae46f
commit
28b5cc39d0
@ -65,7 +65,6 @@ public class PlatformNotRegisterEventLister implements ApplicationListener<Platf
|
||||
}
|
||||
// 查询是否有推流, 如果有则都停止
|
||||
List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServer(event.getPlatformGbID());
|
||||
logger.info("[ 平台未注册事件 ] 停止[ {} ]的所有推流size", sendRtpItems.size());
|
||||
if (sendRtpItems != null && sendRtpItems.size() > 0) {
|
||||
logger.info("[ 平台未注册事件 ] 停止[ {} ]的所有推流", event.getPlatformGbID());
|
||||
for (SendRtpItem sendRtpItem : sendRtpItems) {
|
||||
|
@ -66,10 +66,8 @@ public class MobilePositionSubscribeHandlerTask implements ISubscribeTask {
|
||||
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;
|
||||
|
@ -25,6 +25,7 @@ public class RedisGpsMsgListener implements MessageListener {
|
||||
|
||||
@Override
|
||||
public void onMessage(@NotNull Message message, byte[] bytes) {
|
||||
// TODO 加消息队列
|
||||
GPSMsgInfo gpsMsgInfo = JSON.parseObject(message.getBody(), GPSMsgInfo.class);
|
||||
redisCatchStorage.updateGpsMsgInfo(gpsMsgInfo);
|
||||
}
|
||||
|
@ -125,16 +125,16 @@ public interface StreamPushMapper {
|
||||
"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 @@ public interface StreamPushMapper {
|
||||
"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")
|
||||
|
Loading…
Reference in New Issue
Block a user