From dcef4809bd34ed711923fb5cf6bd65e13455abbd Mon Sep 17 00:00:00 2001 From: chenjialing <595168663@qq.com> Date: Wed, 1 Jun 2022 14:11:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D--=E9=87=8D=E8=AE=BE=E9=80=9A?= =?UTF-8?q?=E9=81=93=E5=A4=9A=E4=B8=AA=E8=AE=BE=E5=A4=87=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E4=B8=8B=E5=8F=91=E7=94=9F=E7=9A=84sql=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/storager/impl/VideoManagerStorageImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java index 3bb3d9f0..338bb779 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java @@ -25,6 +25,7 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import java.util.*; @@ -195,7 +196,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @Override public boolean resetChannels(String deviceId, List deviceChannelList) { - if (deviceChannelList == null) { + if (CollectionUtils.isEmpty(deviceChannelList)) { return false; } List allChannelInPlay = deviceChannelMapper.getAllChannelInPlay(); @@ -246,6 +247,10 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { if (stringBuilder.length() > 0) { logger.info("[目录查询]收到的数据存在重复: {}" , stringBuilder); } + if(CollectionUtils.isEmpty(channels)){ + logger.info("通道重设,数据为空={}" , deviceChannelList); + return false; + } try { int cleanChannelsResult = deviceChannelMapper.cleanChannelsNotInList(deviceId, channels); int limitCount = 300;