From 6e8cc24e64e1ac116dd4f2f49ed68339d9c8f058 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 26 Oct 2020 14:21:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E9=80=9A=E9=81=93=E6=95=B0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/storager/redis/VideoManagerRedisStoragerImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 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 e69a6451..e6a680b8 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 @@ -101,7 +101,7 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager { // 如果有父设备,更新父设备内子节点数 String parentId = channel.getParentId(); - if (!StringUtils.isEmpty(parentId)) { + if (!StringUtils.isEmpty(parentId) && !parentId.equals(deviceId)) { if (channelMap.get(parentId) == null) { channelMap.put(parentId, new HashSet()); @@ -111,8 +111,6 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager { DeviceChannel deviceChannel = queryChannel(deviceId, parentId); if (deviceChannel != null) { deviceChannel.setSubCount(channelMap.get(parentId).size()); -// redis.set(VideoManagerConstants.CACHEKEY_PREFIX+deviceId + "_" + deviceChannel.getChannelId(), -// deviceChannel); redis.set(VideoManagerConstants.CACHEKEY_PREFIX + deviceId + "_" + deviceChannel.getChannelId() + "_" + (deviceChannel.getStatus() == 1 ? "on":"off") + @@ -456,7 +454,6 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager { for (Device device : devices) { // 更新设备下的通道 HashMap> channelMap = new HashMap>(); -// List deviceChannelList = redis.keys(VideoManagerConstants.CACHEKEY_PREFIX + List deviceChannelList = redis.scan(VideoManagerConstants.CACHEKEY_PREFIX + device.getDeviceId() + "_" + "*"); if (deviceChannelList != null && deviceChannelList.size() > 0 ) { @@ -477,6 +474,7 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager { } deviceMap.put(device.getDeviceId(),channelMap); } + System.out.println(); } @Override