From e09e541c827157884e013ff0b50aa88b8b0f46be Mon Sep 17 00:00:00 2001
From: panlinlin <648540858@qq.com>
Date: 星期五, 15 一月 2021 17:47:58 +0800
Subject: [PATCH] 完成向上级联->点播--精简代码

---
 src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java |   20 +++++++++++++++++---
 1 files changed, 17 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 aed3026..aa83e3d 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
@@ -231,14 +231,14 @@
 	@Override
 	public boolean updateParentPlatform(ParentPlatform parentPlatform) {
 		int result = 0;
-		ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getDeviceGBId());
-		if ( platformMapper.getParentPlatById(parentPlatform.getDeviceGBId()) == null) {
+		ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
+		if ( platformMapper.getParentPlatById(parentPlatform.getServerGBId()) == null) {
 			result = platformMapper.addParentPlatform(parentPlatform);
 
 			if (parentPlatformCatch == null) {
 				parentPlatformCatch = new ParentPlatformCatch();
 				parentPlatformCatch.setParentPlatform(parentPlatform);
-				parentPlatformCatch.setId(parentPlatform.getDeviceGBId());
+				parentPlatformCatch.setId(parentPlatform.getServerGBId());
 			}
 		}else {
 			result = platformMapper.updateParentPlatform(parentPlatform);
@@ -249,9 +249,12 @@
 		return result > 0;
 	}
 
+	@Transactional
 	@Override
 	public boolean deleteParentPlatform(ParentPlatform parentPlatform) {
 		int result = platformMapper.delParentPlatform(parentPlatform);
+		// 鍒犻櫎鍏宠仈鐨勯�氶亾
+		patformChannelMapper.cleanChannelForGB(parentPlatform.getServerGBId());
 		return result > 0;
 	}
 
@@ -286,6 +289,11 @@
 		return new PageInfo<>(all);
 	}
 
+	@Override
+	public List<ChannelReduce> queryChannelListInParentPlatform(String platformId) {
+
+		return deviceChannelMapper.queryChannelListInAll(null, null, null, platformId, true);
+	}
 
 	@Override
 	public int updateChannelForGB(String platformId, List<ChannelReduce> channelReduces) {
@@ -321,4 +329,10 @@
 
 		return result;
 	}
+
+	@Override
+	public DeviceChannel queryChannelInParentPlatform(String platformId, String channelId) {
+		DeviceChannel channel = patformChannelMapper.queryChannelInParentPlatform(platformId, channelId);
+		return channel;
+	}
 }

--
Gitblit v1.8.0