增加设备通道数为0时自动发起更新通道

pull/647/head
648540858 2022-10-18 23:03:33 +08:00
parent f9ae4cfdbe
commit 84c60381cc
1 changed files with 5 additions and 0 deletions

View File

@ -118,6 +118,7 @@ public class DeviceServiceImpl implements IDeviceService {
} }
sync(device); sync(device);
}else { }else {
if(device.getOnline() == 0){ if(device.getOnline() == 0){
device.setOnline(1); device.setOnline(1);
device.setCreateTime(now); device.setCreateTime(now);
@ -132,6 +133,10 @@ public class DeviceServiceImpl implements IDeviceService {
sync(device); sync(device);
// TODO 如果设备下的通道级联到了其他平台那么需要发送事件或者notify给上级平台 // TODO 如果设备下的通道级联到了其他平台那么需要发送事件或者notify给上级平台
}else { }else {
if (deviceChannelMapper.queryAllChannels(device.getDeviceId()).size() == 0) {
sync(device);
}
deviceMapper.update(device); deviceMapper.update(device);
redisCatchStorage.updateDevice(device); redisCatchStorage.updateDevice(device);
} }