From 4a22611320f7016d98a37dda57ef1ca4ea9489ec Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 11 三月 2022 09:54:35 +0800 Subject: [PATCH] 优化目录订阅时父节点的更新 --- src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java index 08f4b26..fe71e42 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java @@ -14,6 +14,7 @@ import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorager; import com.genersoft.iot.vmp.storager.dao.*; +import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo; import com.genersoft.iot.vmp.utils.node.ForestNodeMerger; import com.genersoft.iot.vmp.vmanager.bean.DeviceChannelTree; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; @@ -41,7 +42,7 @@ @Component public class VideoManagerStoragerImpl implements IVideoManagerStorager { - private Logger logger = LoggerFactory.getLogger(VideoManagerStoragerImpl.class); + private final Logger logger = LoggerFactory.getLogger(VideoManagerStoragerImpl.class); @Autowired EventPublisher eventPublisher; @@ -170,6 +171,7 @@ }else { deviceChannelMapper.update(channel); } + deviceChannelMapper.updateChannelSubCount(deviceId,channel.getParentId()); } @Override @@ -283,7 +285,8 @@ logger.debug("[鐩綍鏌ヨ]鏀跺埌鐨勬暟鎹瓨鍦ㄩ噸澶嶏細 {}" , stringBuilder); } try { - int cleanChannelsResult = deviceChannelMapper.cleanChannelsByDeviceId(deviceId); +// int cleanChannelsResult = deviceChannelMapper.cleanChannelsByDeviceId(deviceId); + int cleanChannelsResult = deviceChannelMapper.cleanChannelsNotInList(deviceId, channels); int limitCount = 300; boolean result = cleanChannelsResult < 0; if (!result && channels.size() > 0) { @@ -716,7 +719,7 @@ try { if (streamProxyMapper.add(streamProxyItem) > 0) { if (!StringUtils.isEmpty(streamProxyItem.getGbId())) { - if (gbStreamMapper.add(streamProxyItem) <= 0) { + if (gbStreamMapper.add(streamProxyItem) < 0) { //浜嬪姟鍥炴粴 dataSourceTransactionManager.rollback(transactionStatus); return false; @@ -1104,4 +1107,9 @@ public PlatformCatalog queryDefaultCatalogInPlatform(String platformId) { return catalogMapper.selectDefaultByPlatFormId(platformId); } + + @Override + public List<ChannelSourceInfo> getChannelSource(String platformId, String gbId) { + return platformMapper.getChannelSource(platformId, gbId); + } } -- Gitblit v1.8.0