Commit 715ecb1d64a4d85482dbfdedfc6c11f44a5da282

Authored by 648540858
1 parent f6893cf9

修复设备缺失的数据

src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
@@ -73,10 +73,18 @@ public class DeviceServiceImpl implements IDeviceService { @@ -73,10 +73,18 @@ public class DeviceServiceImpl implements IDeviceService {
73 if (deviceInRedis != null && deviceInDb == null) { 73 if (deviceInRedis != null && deviceInDb == null) {
74 // redis 存在脏数据 74 // redis 存在脏数据
75 redisCatchStorage.clearCatchByDeviceId(device.getDeviceId()); 75 redisCatchStorage.clearCatchByDeviceId(device.getDeviceId());
  76 +
  77 + }
  78 + if (device.getCreateTime() == null) {
76 device.setCreateTime(now); 79 device.setCreateTime(now);
77 } 80 }
  81 + if (device.getRegisterTime() == null) {
  82 + device.setRegisterTime(now);
  83 + }
  84 + if(device.getUpdateTime() == null) {
  85 + device.setUpdateTime(now);
  86 + }
78 device.setOnline(1); 87 device.setOnline(1);
79 - device.setRegisterTime(now);  
80 88
81 // 第一次上线 89 // 第一次上线
82 if (device.getCreateTime() == null) { 90 if (device.getCreateTime() == null) {