Commit 9b75af45 by gdj

修复设备列表bug2

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