修复--重设通道多个设备注册下发生的sql错误修复

This commit is contained in:
chenjialing 2022-06-01 14:11:06 +08:00
parent 7620fb951c
commit dcef4809bd

View File

@ -25,6 +25,7 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.util.*; import java.util.*;
@ -195,7 +196,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
@Override @Override
public boolean resetChannels(String deviceId, List<DeviceChannel> deviceChannelList) { public boolean resetChannels(String deviceId, List<DeviceChannel> deviceChannelList) {
if (deviceChannelList == null) { if (CollectionUtils.isEmpty(deviceChannelList)) {
return false; return false;
} }
List<DeviceChannel> allChannelInPlay = deviceChannelMapper.getAllChannelInPlay(); List<DeviceChannel> allChannelInPlay = deviceChannelMapper.getAllChannelInPlay();
@ -246,6 +247,10 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
if (stringBuilder.length() > 0) { if (stringBuilder.length() > 0) {
logger.info("[目录查询]收到的数据存在重复: {}" , stringBuilder); logger.info("[目录查询]收到的数据存在重复: {}" , stringBuilder);
} }
if(CollectionUtils.isEmpty(channels)){
logger.info("通道重设,数据为空={}" , deviceChannelList);
return false;
}
try { try {
int cleanChannelsResult = deviceChannelMapper.cleanChannelsNotInList(deviceId, channels); int cleanChannelsResult = deviceChannelMapper.cleanChannelsNotInList(deviceId, channels);
int limitCount = 300; int limitCount = 300;