From acd767b47a4f78e905a3cbe89a4c82ffe88d73d9 Mon Sep 17 00:00:00 2001
From: hotcoffie <35990065+hotcoffie@users.noreply.github.com>
Date: 星期四, 21 四月 2022 10:04:50 +0800
Subject: [PATCH] Merge branch '648540858:wvp-28181-2.0' into wvp-28181-2.0
---
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
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 667a619..fbb6e38 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
@@ -238,12 +238,15 @@
@Override
public boolean resetChannels(String deviceId, List<DeviceChannel> deviceChannelList) {
+ if (deviceChannelList == null) {
+ return false;
+ }
TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
// 鏁版嵁鍘婚噸
List<DeviceChannel> channels = new ArrayList<>();
StringBuilder stringBuilder = new StringBuilder();
Map<String, Integer> subContMap = new HashMap<>();
- if (deviceChannelList.size() > 1) {
+ if (deviceChannelList != null && deviceChannelList.size() > 1) {
// 鏁版嵁鍘婚噸
Set<String> gbIdSet = new HashSet<>();
for (DeviceChannel deviceChannel : deviceChannelList) {
@@ -300,6 +303,7 @@
dataSourceTransactionManager.commit(transactionStatus); //鎵嬪姩鎻愪氦
return true;
}catch (Exception e) {
+ e.printStackTrace();
dataSourceTransactionManager.rollback(transactionStatus);
return false;
}
@@ -415,10 +419,9 @@
TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
boolean result = false;
try {
- if (platformChannelMapper.delChannelForDeviceId(deviceId) <0 // 鍒犻櫎涓庡浗鏍囧钩鍙扮殑鍏宠仈
- || deviceChannelMapper.cleanChannelsByDeviceId(deviceId) < 0 // 鍒犻櫎浠栫殑閫氶亾
- || deviceMapper.del(deviceId) < 0 // 绉婚櫎璁惧淇℃伅
- ) {
+ platformChannelMapper.delChannelForDeviceId(deviceId);
+ deviceChannelMapper.cleanChannelsByDeviceId(deviceId);
+ if ( deviceMapper.del(deviceId) < 0 ) {
//浜嬪姟鍥炴粴
dataSourceTransactionManager.rollback(transactionStatus);
}
@@ -445,8 +448,6 @@
device.setOnline(1);
logger.info("鏇存柊璁惧鍦ㄧ嚎: " + deviceId);
redisCatchStorage.updateDevice(device);
- List<DeviceChannel> deviceChannelList = deviceChannelMapper.queryOnlineChannelsByDeviceId(deviceId);
- eventPublisher.catalogEventPublish(null, deviceChannelList, CatalogEvent.ON);
return deviceMapper.update(device) > 0;
}
@@ -519,6 +520,12 @@
@Override
public boolean updateParentPlatform(ParentPlatform parentPlatform) {
int result = 0;
+ if (parentPlatform.getCatalogGroup() == 0) {
+ parentPlatform.setCatalogGroup(1);
+ }
+ if (parentPlatform.getAdministrativeDivision() == null) {
+ parentPlatform.setAdministrativeDivision(parentPlatform.getAdministrativeDivision());
+ }
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
if (parentPlatform.getId() == null ) {
if (parentPlatform.getCatalogId() == null) {
@@ -538,6 +545,7 @@
parentPlatformCatch.setId(parentPlatform.getServerGBId());
redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId());
}
+
result = platformMapper.updateParentPlatform(parentPlatform);
}
// 鏇存柊缂撳瓨
@@ -1073,7 +1081,7 @@
deviceChannel.setParentId(catalog.getParentId());
deviceChannel.setRegisterWay(1);
// 琛屾斂鍖哄垝搴旇鏄疍omain鐨勫墠鍏綅
- deviceChannel.setCivilCode(parentPlatByServerGBId.getDeviceGBId().substring(0,6));
+ deviceChannel.setCivilCode(parentPlatByServerGBId.getAdministrativeDivision());
deviceChannel.setModel("live");
deviceChannel.setOwner("wvp-pro");
deviceChannel.setSecrecy("0");
--
Gitblit v1.8.0