From 59c79c08e100ada25616697b8bc85d266a680813 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 16 二月 2022 15:13:16 +0800
Subject: [PATCH] 修复级联通道回复错误

---
 src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java |   30 +++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 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 ac278a7..54a3c57 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
@@ -13,6 +13,8 @@
 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.utils.node.ForestNodeMerger;
+import com.genersoft.iot.vmp.vmanager.bean.DeviceChannelTree;
 import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -329,6 +331,11 @@
 	}
 
 	@Override
+	public List<DeviceChannelTree> tree(String deviceId) {
+		return ForestNodeMerger.merge(deviceChannelMapper.tree(deviceId));
+	}
+
+	@Override
 	public List<DeviceChannel> queryChannelsByDeviceId(String deviceId) {
 		return deviceChannelMapper.queryChannels(deviceId, null,null, null, null);
 	}
@@ -568,16 +575,16 @@
 
 	@Override
 	public PageInfo<ChannelReduce> queryAllChannelList(int page, int count, String query, Boolean online,
-													   Boolean channelType, String platformId, Boolean inPlatform) {
+													   Boolean channelType, String platformId, String catalogId) {
 		PageHelper.startPage(page, count);
-		List<ChannelReduce> all = deviceChannelMapper.queryChannelListInAll(query, online, channelType, platformId, inPlatform);
+		List<ChannelReduce> all = deviceChannelMapper.queryChannelListInAll(query, online, channelType, platformId, catalogId);
 		return new PageInfo<>(all);
 	}
 
 	@Override
 	public List<ChannelReduce> queryChannelListInParentPlatform(String platformId) {
 
-		return deviceChannelMapper.queryChannelListInAll(null, null, null, platformId, true);
+		return deviceChannelMapper.queryChannelListInAll(null, null, null, platformId, platformId);
 	}
 
 	@Override
@@ -679,6 +686,7 @@
 		streamProxyItem.setStatus(true);
 		String now = this.format.format(System.currentTimeMillis());
 		streamProxyItem.setCreateTime(now);
+		streamProxyItem.setCreateStamp(System.currentTimeMillis());
 		try {
 			if (gbStreamMapper.add(streamProxyItem)<0 || streamProxyMapper.add(streamProxyItem) < 0) {
 				//浜嬪姟鍥炴粴
@@ -814,9 +822,11 @@
 					streamPushItem.setCatalogId(parentPlatform.getCatalogId());
 					streamPushItem.setPlatformId(parentPlatform.getServerGBId());
 					String stream = streamPushItem.getStream();
-					StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), stream, parentPlatform.getServerGBId());
+					StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), stream,
+							parentPlatform.getServerGBId());
 					if (streamProxyItems == null) {
 						platformGbStreamMapper.add(streamPushItem);
+						eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), streamPushItem, CatalogEvent.ADD);
 					}
 				}
 			}
@@ -857,8 +867,8 @@
 	}
 
 	@Override
-	public List<StreamProxyItem> getStreamProxyListForEnableInMediaServer(String id, boolean enable) {
-		return streamProxyMapper.selectForEnableInMediaServer(id, enable);
+	public List<StreamProxyItem> getStreamProxyListForEnableInMediaServer(String id, boolean enable, boolean status) {
+		return streamProxyMapper.selectForEnableInMediaServer(id, enable, status);
 	}
 
 
@@ -1018,7 +1028,8 @@
 		deviceChannel.setParental(1);
 		deviceChannel.setParentId(catalog.getParentId());
 		deviceChannel.setRegisterWay(1);
-		deviceChannel.setCivilCode(sipConfig.getDomain());
+		// 琛屾斂鍖哄垝搴旇鏄疍omain鐨勫墠鍏綅
+		deviceChannel.setCivilCode(sipConfig.getDomain().substring(0, sipConfig.getDomain().length() - 2));
 		deviceChannel.setModel("live");
 		deviceChannel.setOwner("wvp-pro");
 		deviceChannel.setSecrecy("0");
@@ -1055,4 +1066,9 @@
 		platformGbStreamMapper.delByPlatformId(serverGBId);
 		platformChannelMapper.delByPlatformId(serverGBId);
 	}
+
+	@Override
+	public PlatformCatalog queryDefaultCatalogInPlatform(String platformId) {
+		return catalogMapper.selectDefaultByPlatFormId(platformId);
+	}
 }

--
Gitblit v1.8.0