From 715ecb1d64a4d85482dbfdedfc6c11f44a5da282 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 11 May 2022 20:22:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BE=E5=A4=87=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/service/impl/DeviceServiceImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 ce211c3b..6fd171e9 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 @@ -73,10 +73,18 @@ public class DeviceServiceImpl implements IDeviceService { if (deviceInRedis != null && deviceInDb == null) { // redis 存在脏数据 redisCatchStorage.clearCatchByDeviceId(device.getDeviceId()); + + } + if (device.getCreateTime() == null) { device.setCreateTime(now); } + if (device.getRegisterTime() == null) { + device.setRegisterTime(now); + } + if(device.getUpdateTime() == null) { + device.setUpdateTime(now); + } device.setOnline(1); - device.setRegisterTime(now); // 第一次上线 if (device.getCreateTime() == null) {