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

更新下发消息为线程池发送

parent 9f845e72
...@@ -177,7 +177,7 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi ...@@ -177,7 +177,7 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi
condition.setOnlineTime(new Date()); condition.setOnlineTime(new Date());
condition.setDeviceStatus(DeviceStatusEnum.在线.getValue()); condition.setDeviceStatus(DeviceStatusEnum.在线.getValue());
cacheService.lpush(RedisKey.KEY_DEVICE_UPDATE_QUEUE,deviceEntity); cacheService.lpush(RedisKey.KEY_DEVICE_UPDATE_QUEUE,condition);
// deviceService.update(deviceEntity); // deviceService.update(deviceEntity);
PlatformEntity platformEntity = platformService.getCache(deviceEntity.getPlatformId().toString()); PlatformEntity platformEntity = platformService.getCache(deviceEntity.getPlatformId().toString());
......
...@@ -78,9 +78,11 @@ public class DeviceStatTaskImpl implements ITaskExcuteService { ...@@ -78,9 +78,11 @@ public class DeviceStatTaskImpl implements ITaskExcuteService {
if (ObjectUtils.isEmpty(item.getDeviceCode())) return null; if (ObjectUtils.isEmpty(item.getDeviceCode())) return null;
boolean exists = cacheService.exists(RedisKey.KEY_DEVICE_ONLINE_CACHE + item.getDeviceCode()); boolean exists = cacheService.exists(RedisKey.KEY_DEVICE_ONLINE_CACHE + item.getDeviceCode());
if (!exists) { if (!exists) {
item.setDeviceStatus(DeviceStatusEnum.离线.getValue()); DeviceEntity condition = new DeviceEntity();
item.setOfflineTime(new Date()); condition.setId(item.getId());
return item; condition.setDeviceStatus(DeviceStatusEnum.离线.getValue());
condition.setOfflineTime(new Date());
return condition;
} }
return null; return null;
}).filter(f -> f != null).collect(Collectors.toList()); }).filter(f -> f != null).collect(Collectors.toList());
......
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