From 84c60381cc77a1f7fba206900ebcfed4918859d3 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 18 Oct 2022 23:03:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E5=A4=87=E9=80=9A?= =?UTF-8?q?=E9=81=93=E6=95=B0=E4=B8=BA0=E6=97=B6=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8F=91=E8=B5=B7=E6=9B=B4=E6=96=B0=E9=80=9A=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/service/impl/DeviceServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java index ca7da6f5..281df19b 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java @@ -118,6 +118,7 @@ public class DeviceServiceImpl implements IDeviceService { } sync(device); }else { + if(device.getOnline() == 0){ device.setOnline(1); device.setCreateTime(now); @@ -132,6 +133,10 @@ public class DeviceServiceImpl implements IDeviceService { sync(device); // TODO 如果设备下的通道级联到了其他平台,那么需要发送事件或者notify给上级平台 }else { + if (deviceChannelMapper.queryAllChannels(device.getDeviceId()).size() == 0) { + sync(device); + } + deviceMapper.update(device); redisCatchStorage.updateDevice(device); }