From 7e581e9d3a0e32be5e90e453f4283d70d895a634 Mon Sep 17 00:00:00 2001
From: panlinlin <648540858@qq.com>
Date: 星期五, 08 一月 2021 17:31:49 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into wvp-28181-2.0

---
 src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 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 366032c..b783238 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
@@ -4,6 +4,8 @@
 
 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
+import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch;
+import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper;
 import com.genersoft.iot.vmp.storager.dao.DeviceMapper;
 import com.genersoft.iot.vmp.storager.dao.ParentPlatformMapper;
@@ -31,6 +33,11 @@
 
 	@Autowired
     private ParentPlatformMapper platformMapper;
+
+	@Autowired
+    private IRedisCatchStorage redisCatchStorage;
+
+
 
 
 	/**
@@ -86,6 +93,16 @@
 		}
 	}
 
+	@Override
+	public void startPlay(String deviceId, String channelId, String streamId) {
+		deviceChannelMapper.startPlay(deviceId, channelId, streamId);
+	}
+
+	@Override
+	public void stopPlay(String deviceId, String channelId) {
+		deviceChannelMapper.stopPlay(deviceId, channelId);
+	}
+
 	/**
 	 * 鑾峰彇璁惧
 	 *
@@ -104,8 +121,6 @@
 		List<DeviceChannel> all = deviceChannelMapper.queryChannelsByDeviceId(deviceId, null, query, hasSubChannel, online);
 		return new PageInfo<>(all);
 	}
-
-
 
 	@Override
 	public List<DeviceChannel> queryChannelsByDeviceId(String deviceId) {
@@ -210,11 +225,21 @@
 	@Override
 	public boolean updateParentPlatform(ParentPlatform parentPlatform) {
 		int result = 0;
+		ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getDeviceGBId());
 		if ( platformMapper.getParentPlatById(parentPlatform.getDeviceGBId()) == null) {
 			result = platformMapper.addParentPlatform(parentPlatform);
+
+			if (parentPlatformCatch == null) {
+				parentPlatformCatch = new ParentPlatformCatch();
+				parentPlatformCatch.setParentPlatform(parentPlatform);
+				parentPlatformCatch.setId(parentPlatform.getDeviceGBId());
+			}
 		}else {
 			result = platformMapper.updateParentPlatform(parentPlatform);
 		}
+		// 鏇存柊缂撳瓨
+		parentPlatformCatch.setParentPlatform(parentPlatform);
+		redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
 		return result > 0;
 	}
 
@@ -236,5 +261,13 @@
 		return platformMapper.getParentPlatById(platformGbId);
 	}
 
+	@Override
+	public List<ParentPlatform> queryEnableParentPlatformList(boolean enable) {
+		return platformMapper.getEnableParentPlatformList(enable);
+	}
 
+	@Override
+	public void outlineForAllParentPlatform() {
+		platformMapper.outlineForAllParentPlatform();
+	}
 }

--
Gitblit v1.8.0