修复删除的设备无法重新注册的问题
This commit is contained in:
parent
21a96ad20f
commit
b4dadf6c51
@ -117,9 +117,10 @@ public class DeviceServiceImpl implements IDeviceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 第一次上线 或则设备之前是离线状态--进行通道同步和设备信息查询
|
// 第一次上线 或则设备之前是离线状态--进行通道同步和设备信息查询
|
||||||
if (device.getCreateTime() == null) {
|
if (deviceInDb == null) {
|
||||||
device.setOnLine(true);
|
device.setOnLine(true);
|
||||||
device.setCreateTime(now);
|
device.setCreateTime(now);
|
||||||
|
device.setUpdateTime(now);
|
||||||
logger.info("[设备上线,首次注册]: {},查询设备信息以及通道信息", device.getDeviceId());
|
logger.info("[设备上线,首次注册]: {},查询设备信息以及通道信息", device.getDeviceId());
|
||||||
deviceMapper.add(device);
|
deviceMapper.add(device);
|
||||||
redisCatchStorage.updateDevice(device);
|
redisCatchStorage.updateDevice(device);
|
||||||
@ -525,6 +526,9 @@ public class DeviceServiceImpl implements IDeviceService {
|
|||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
dataSourceTransactionManager.rollback(transactionStatus);
|
dataSourceTransactionManager.rollback(transactionStatus);
|
||||||
}
|
}
|
||||||
|
if (result) {
|
||||||
|
redisCatchStorage.removeDevice(deviceId);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user