Commit 719d702f by gdj

修复设备列表bug2

parent 859dfe19
...@@ -670,9 +670,11 @@ public class DeviceServiceImpl extends ServiceImpl<IDeviceMapper, DeviceEntity> ...@@ -670,9 +670,11 @@ public class DeviceServiceImpl extends ServiceImpl<IDeviceMapper, DeviceEntity>
DeviceDTO device = devicesList.get(0); DeviceDTO device = devicesList.get(0);
device.setStatus(deviceRedisService.checkDeviceOnline(sn)); device.setStatus(deviceRedisService.checkDeviceOnline(sn));
// 查询 无人机 // 查询 无人机
List<DeviceDTO> childrenList = this.getDevicesByParams(DeviceQueryParam.builder().deviceSn(device.getChildDeviceSn()).build()); if (StringUtils.hasText(device.getChildDeviceSn())) {
if (!childrenList.isEmpty()) { List<DeviceDTO> childrenList = this.getDevicesByParams(DeviceQueryParam.builder().deviceSn(device.getChildDeviceSn()).build());
device.setChildren(childrenList.get(0)); if (!childrenList.isEmpty()) {
device.setChildren(childrenList.get(0));
}
} }
return Optional.of(device); return Optional.of(device);
} }
......
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