修复更新推流状态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());
|
List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServer(event.getPlatformGbID());
|
||||||
logger.info("[ 平台未注册事件 ] 停止[ {} ]的所有推流size", sendRtpItems.size());
|
|
||||||
if (sendRtpItems != null && sendRtpItems.size() > 0) {
|
if (sendRtpItems != null && sendRtpItems.size() > 0) {
|
||||||
logger.info("[ 平台未注册事件 ] 停止[ {} ]的所有推流", event.getPlatformGbID());
|
logger.info("[ 平台未注册事件 ] 停止[ {} ]的所有推流", event.getPlatformGbID());
|
||||||
for (SendRtpItem sendRtpItem : sendRtpItems) {
|
for (SendRtpItem sendRtpItem : sendRtpItems) {
|
||||||
|
@ -66,10 +66,8 @@ public class MobilePositionSubscribeHandlerTask implements ISubscribeTask {
|
|||||||
for (DeviceChannel deviceChannel : gbStreams) {
|
for (DeviceChannel deviceChannel : gbStreams) {
|
||||||
String gbId = deviceChannel.getChannelId();
|
String gbId = deviceChannel.getChannelId();
|
||||||
GPSMsgInfo gpsMsgInfo = redisCatchStorage.getGpsMsgInfo(gbId);
|
GPSMsgInfo gpsMsgInfo = redisCatchStorage.getGpsMsgInfo(gbId);
|
||||||
if (gpsMsgInfo != null) { // 无最新位置不发送
|
// 无最新位置不发送
|
||||||
if (logger.isDebugEnabled()) {
|
if (gpsMsgInfo != null) {
|
||||||
logger.debug("无最新位置不发送");
|
|
||||||
}
|
|
||||||
// 经纬度都为0不发送
|
// 经纬度都为0不发送
|
||||||
if (gpsMsgInfo.getLng() == 0 && gpsMsgInfo.getLat() == 0) {
|
if (gpsMsgInfo.getLng() == 0 && gpsMsgInfo.getLat() == 0) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -25,6 +25,7 @@ public class RedisGpsMsgListener implements MessageListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(@NotNull Message message, byte[] bytes) {
|
public void onMessage(@NotNull Message message, byte[] bytes) {
|
||||||
|
// TODO 加消息队列
|
||||||
GPSMsgInfo gpsMsgInfo = JSON.parseObject(message.getBody(), GPSMsgInfo.class);
|
GPSMsgInfo gpsMsgInfo = JSON.parseObject(message.getBody(), GPSMsgInfo.class);
|
||||||
redisCatchStorage.updateGpsMsgInfo(gpsMsgInfo);
|
redisCatchStorage.updateGpsMsgInfo(gpsMsgInfo);
|
||||||
}
|
}
|
||||||
|
@ -125,16 +125,16 @@ public interface StreamPushMapper {
|
|||||||
"where sp.status = 1 and (gs.app, gs.stream) in (" +
|
"where sp.status = 1 and (gs.app, gs.stream) in (" +
|
||||||
"<foreach collection='offlineStreams' item='item' separator=','>" +
|
"<foreach collection='offlineStreams' item='item' separator=','>" +
|
||||||
"(#{item.app}, #{item.stream}) " +
|
"(#{item.app}, #{item.stream}) " +
|
||||||
")</foreach>" +
|
"</foreach>" +
|
||||||
"</script>")
|
")</script>")
|
||||||
List<GbStream> getOnlinePusherForGbInList(List<StreamPushItemFromRedis> offlineStreams);
|
List<GbStream> getOnlinePusherForGbInList(List<StreamPushItemFromRedis> offlineStreams);
|
||||||
|
|
||||||
@Update("<script> "+
|
@Update("<script> "+
|
||||||
"UPDATE stream_push SET status=0 where (app, stream) in (" +
|
"UPDATE stream_push SET status=0 where (app, stream) in (" +
|
||||||
"<foreach collection='offlineStreams' item='item' separator=','>" +
|
"<foreach collection='offlineStreams' item='item' separator=','>" +
|
||||||
"(#{item.app}, #{item.stream}) " +
|
"(#{item.app}, #{item.stream}) " +
|
||||||
")</foreach>" +
|
"</foreach>" +
|
||||||
"</script>")
|
")</script>")
|
||||||
void offline(List<StreamPushItemFromRedis> offlineStreams);
|
void offline(List<StreamPushItemFromRedis> offlineStreams);
|
||||||
|
|
||||||
@Select("<script> "+
|
@Select("<script> "+
|
||||||
@ -150,8 +150,8 @@ public interface StreamPushMapper {
|
|||||||
"UPDATE stream_push SET status=1 where (app, stream) in (" +
|
"UPDATE stream_push SET status=1 where (app, stream) in (" +
|
||||||
"<foreach collection='onlineStreams' item='item' separator=','>" +
|
"<foreach collection='onlineStreams' item='item' separator=','>" +
|
||||||
"(#{item.app}, #{item.stream}) " +
|
"(#{item.app}, #{item.stream}) " +
|
||||||
")</foreach>" +
|
"</foreach>" +
|
||||||
"</script>")
|
")</script>")
|
||||||
void online(List<StreamPushItemFromRedis> onlineStreams);
|
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")
|
@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