|
|
@@ -878,17 +878,15 @@ public class DeviceServiceImpl implements IDeviceService {
|
|
|
List<DeviceDTO> result = new ArrayList<>();
|
|
|
LambdaQueryWrapper<DeviceEntity> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.eq( DeviceEntity::getWorkspaceId, workspaceId)
|
|
|
- .eq(DeviceEntity::getDomain,DeviceDomainEnum.DOCK);
|
|
|
+ .eq(DeviceEntity::getDomain,DeviceDomainEnum.DOCK.getDomain());
|
|
|
List<DeviceEntity> list = mapper.selectList(wrapper);
|
|
|
if(list.size() > 0) {
|
|
|
for(DeviceEntity device : list) {
|
|
|
- boolean parentFlg = deviceRedisService.checkDeviceOnline(device.getDeviceSn());
|
|
|
- if(parentFlg) {
|
|
|
- if(deviceRedisService.checkDeviceOnline(device.getChildSn())){
|
|
|
- Optional<DeviceDTO> deviceDTO = getDeviceBySn(device.getDeviceSn());
|
|
|
- result.add(deviceDTO.get());
|
|
|
- }
|
|
|
+ DeviceDTO deviceDTO = getDeviceBySn(device.getDeviceSn()).get();
|
|
|
+ if(null != device.getChildSn()) {
|
|
|
+ deviceDTO.setChildren(getDeviceBySn(device.getChildSn()).get());
|
|
|
}
|
|
|
+ result.add(deviceDTO);
|
|
|
}
|
|
|
}
|
|
|
return result;
|