|
@ -551,6 +551,18 @@ public class DeviceServiceImpl implements IDeviceService { |
|
|
} |
|
|
} |
|
|
DeviceDTO device = devicesList.get(0); |
|
|
DeviceDTO device = devicesList.get(0); |
|
|
device.setStatus(deviceRedisService.checkDeviceOnline(sn)); |
|
|
device.setStatus(deviceRedisService.checkDeviceOnline(sn)); |
|
|
|
|
|
if (StringUtils.hasText(device.getChildDeviceSn())) { |
|
|
|
|
|
Optional<DeviceDTO> childOpt = this.getDeviceBySn(device.getChildDeviceSn()); |
|
|
|
|
|
childOpt.ifPresent(child -> { |
|
|
|
|
|
child.setStatus(deviceRedisService.checkDeviceOnline(child.getDeviceSn())); |
|
|
|
|
|
child.setWorkspaceName(device.getWorkspaceName()); |
|
|
|
|
|
device.setChildren(child); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
if(device.getProId() != null){ |
|
|
|
|
|
DeviceProEntity deviceProEntitie = deviceProMapper.selectOne(new LambdaQueryWrapper<DeviceProEntity>().eq(DeviceProEntity::getId, device.getProId())); |
|
|
|
|
|
device.setDeviceProEntity(deviceProEntitie); |
|
|
|
|
|
} |
|
|
return Optional.of(device); |
|
|
return Optional.of(device); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|