Commit d45e0e9e authored by 赵啸非's avatar 赵啸非

添加设备上线和下线的业务日志记录

parent 66135cf2
...@@ -239,7 +239,7 @@ public class DeviceApiController { ...@@ -239,7 +239,7 @@ public class DeviceApiController {
entity.setOnlineTime(new Date()); entity.setOnlineTime(new Date());
entity.setDeviceStatus(DeviceStatusEnum.在线.getValue()); entity.setDeviceStatus(DeviceStatusEnum.在线.getValue());
Long lpush = cacheService.lpush(RedisKey.KEY_DEVICE_ONLINE_QUEUE, entity); Long lpush = cacheService.lpush(RedisKey.KEY_DEVICE_ONLINE_QUEUE, entity);
log.info("lpush:{}",lpush); //log.info("lpush:{}",lpush);
//deviceService.getDeviceDao().update(deviceEntity); //deviceService.getDeviceDao().update(deviceEntity);
rsp.setData(deviceResp); rsp.setData(deviceResp);
......
...@@ -289,6 +289,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -289,6 +289,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
deviceEntity.setUpdateTime(new Date()); deviceEntity.setUpdateTime(new Date());
deviceEntity.setUpdateUserId(getContextUserId(context)); deviceEntity.setUpdateUserId(getContextUserId(context));
this.getDeviceDao().update(deviceEntity); this.getDeviceDao().update(deviceEntity);
this.putCache(deviceEntity.getId().toString(),deviceEntity);
PlatformEntity platformEntity = platformService.getCache(deviceEntity.getPlatformId() == null ? "-1" : deviceEntity.getPlatformId().toString()); PlatformEntity platformEntity = platformService.getCache(deviceEntity.getPlatformId() == null ? "-1" : deviceEntity.getPlatformId().toString());
ProductEntity productEntity = productService.getCache(deviceEntity.getProductId() == null ? "-1" : deviceEntity.getProductId().toString()); ProductEntity productEntity = productService.getCache(deviceEntity.getProductId() == null ? "-1" : deviceEntity.getProductId().toString());
if (enabled == YesNoEnum.YES.getValue()) { if (enabled == YesNoEnum.YES.getValue()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment