From 8a82a71ded7459549e0c3448944fef97239e8fcb Mon Sep 17 00:00:00 2001
From: Lawrence <1934378145@qq.com>
Date: 星期四, 17 十二月 2020 14:49:34 +0800
Subject: [PATCH] 增加本平台配置查询接口,方便上级级联参数填写
---
src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java | 44 ++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java
index 765dc82..99c7f06 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/redis/VideoManagerRedisStoragerImpl.java
@@ -8,6 +8,7 @@
import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.conf.MediaServerConfig;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
+import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -288,7 +289,7 @@
// devices.add((Device)redis.get((String)deviceIdList.get(i)));
device =(Device)redis.get((String)deviceIdList.get(i));
if (redis.scan(VideoManagerConstants.KEEPLIVEKEY_PREFIX+device.getDeviceId()).size() == 0){
- outline(device.getDeviceId());
+ // outline(device.getDeviceId());
}
devices.add(device);
}
@@ -297,7 +298,7 @@
// devices.add((Device)redis.get(VideoManagerConstants.DEVICE_PREFIX+deviceIds[i]));
device = (Device)redis.get(VideoManagerConstants.DEVICE_PREFIX+deviceIds[i]);
if (redis.scan(VideoManagerConstants.KEEPLIVEKEY_PREFIX+device.getDeviceId()).size() == 0){
- outline(device.getDeviceId());
+ // outline(device.getDeviceId());
}
devices.add(device);
}
@@ -554,7 +555,46 @@
List<Object> playLeys = redis.scan(String.format("%S_*_%s_%s", VideoManagerConstants.PLAY_BLACK_PREFIX,
deviceId,
code));
+ if (playLeys == null || playLeys.size() == 0) {
+ playLeys = redis.scan(String.format("%S_*_*_%s", VideoManagerConstants.PLAY_BLACK_PREFIX,
+ deviceId));
+ }
if (playLeys == null || playLeys.size() == 0) return null;
return (StreamInfo)redis.get(playLeys.get(0).toString());
}
+
+ @Override
+ public boolean updateParentPlatform(ParentPlatform parentPlatform) {
+
+ // 瀛樺偍device
+ return redis.set(VideoManagerConstants.PLATFORM_PREFIX + parentPlatform.getDeviceGBId(), parentPlatform);
+ }
+
+ @Override
+ public boolean deleteParentPlatform(ParentPlatform parentPlatform) {
+ return redis.del(VideoManagerConstants.PLATFORM_PREFIX + parentPlatform.getDeviceGBId());
+ }
+
+ @Override
+ public PageResult<ParentPlatform> queryParentPlatformList(int page, int count) {
+ PageResult pageResult = new PageResult<Device>();
+ pageResult.setPage(page);
+ pageResult.setCount(count);
+ List<ParentPlatform> resultData = new ArrayList<>();
+ List<Object> parentPlatformList = redis.scan(VideoManagerConstants.PLATFORM_PREFIX + "*");
+ pageResult.setTotal(parentPlatformList.size());
+ int maxCount = (page + 1)* count;
+ for (int i = page * count; i < (pageResult.getTotal() > maxCount ? maxCount : pageResult.getTotal() ); i++) {
+ ParentPlatform parentPlatform =(ParentPlatform)redis.get((String)parentPlatformList.get(i));
+ resultData.add(parentPlatform);
+
+ }
+ pageResult.setData(resultData);
+ return pageResult;
+ }
+
+ @Override
+ public ParentPlatform queryParentPlatById(String platformGbId) {
+ return (ParentPlatform)redis.get(VideoManagerConstants.PLATFORM_PREFIX + platformGbId);
+ }
}
--
Gitblit v1.8.0