From c547851487a8e24f93405ace3c0359d0d6790364 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 25 Jan 2022 19:38:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96zlm=E4=B8=8A=E7=BA=BF?= =?UTF-8?q?=E4=B8=8E=E4=B8=8B=E7=BA=BF=E8=BF=87=E6=97=B6=E9=80=9A=E9=81=93?= =?UTF-8?q?=E7=9A=84=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/service/impl/StreamPushServiceImpl.java | 8 +++++--- .../iot/vmp/storager/dao/StreamPushMapper.java | 13 ++++++++++++- src/main/resources/application-dev.yml | 2 +- src/main/resources/application-docker.yml | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java index d3d32499..948c61ad 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java @@ -118,7 +118,7 @@ public class StreamPushServiceImpl implements IStreamPushService { @Override public List getPushList(String mediaServerId) { - return streamPushMapper.selectAllByMediaServerId(mediaServerId); + return streamPushMapper.selectAllByMediaServerIdWithOutGbID(mediaServerId); } @Override @@ -204,7 +204,9 @@ public class StreamPushServiceImpl implements IStreamPushService { Map streamInfoPushItemMap = new HashMap<>(); if (pushList.size() > 0) { for (StreamPushItem streamPushItem : pushList) { - pushItemMap.put(streamPushItem.getApp() + streamPushItem.getStream(), streamPushItem); + if (StringUtils.isEmpty(streamPushItem.getGbId())) { + pushItemMap.put(streamPushItem.getApp() + streamPushItem.getStream(), streamPushItem); + } } } if (mediaItems.size() > 0) { @@ -268,7 +270,7 @@ public class StreamPushServiceImpl implements IStreamPushService { @Override public void zlmServerOffline(String mediaServerId) { - List streamPushItems = streamPushMapper.selectAllByMediaServerId(mediaServerId); + List streamPushItems = streamPushMapper.selectAllByMediaServerIdWithOutGbID(mediaServerId); // 移除没有GBId的推流 streamPushMapper.deleteWithoutGBId(mediaServerId); gbStreamMapper.deleteWithoutGBId("push", mediaServerId); 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 e072e274..08b7c827 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 @@ -32,6 +32,14 @@ public interface StreamPushMapper { @Delete("DELETE FROM stream_push WHERE app=#{app} AND stream=#{stream}") int del(String app, String stream); + @Delete("") + int delAllWithoutGBId(List streamPushItems); + @Delete("