From 422ce8aebb1899fa4d3cc50194f35c78817058fb Mon Sep 17 00:00:00 2001
From: panlinlin <648540858@qq.com>
Date: 星期五, 08 一月 2021 11:04:29 +0800
Subject: [PATCH] 完成向上级联->选择通道-001
---
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java | 27 +++++++++++++++++++++++++--
1 files changed, 25 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..21dd031 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;
+
+
/**
@@ -104,8 +111,6 @@
List<DeviceChannel> all = deviceChannelMapper.queryChannelsByDeviceId(deviceId, null, query, hasSubChannel, online);
return new PageInfo<>(all);
}
-
-
@Override
public List<DeviceChannel> queryChannelsByDeviceId(String deviceId) {
@@ -210,11 +215,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 +251,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