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) {