修改无人机的状态判断

This commit is contained in:
孙小云 2026-02-11 16:37:27 +08:00
parent 5e9111e879
commit a5e51849d9
1 changed files with 13 additions and 14 deletions

View File

@ -153,22 +153,21 @@ public class TuohengBufferDeviceImpl implements IBufferDeviceService {
dto.setAircraftManufacturer(device.getDeviceManufacturer());
// 查询无人机关联的机场获取机场SN用于从MachineStateManager获取状态
// String dockSn = null;
// List<DockAircraft> dockAircrafts = dockAircraftDomain.selectDockAircraftByAircraftId(aircraftId);
// if (!CollectionUtils.isEmpty(dockAircrafts)) {
// DockAircraft dockAircraft = dockAircrafts.get(0);
// Dock dock = dockDomain.selectDockByDockId(dockAircraft.getDockId());
// if (dock != null) {
// Device dockDevice = deviceDomain.selectDeviceByDeviceId(dock.getDeviceId());
// if (dockDevice != null) {
// dockSn = dockDevice.getDeviceSn();
// }
// }
// }
String dockSn = null;
List<DockAircraft> dockAircrafts = dockAircraftDomain.selectDockAircraftByAircraftId(aircraftId);
if (!CollectionUtils.isEmpty(dockAircrafts)) {
DockAircraft dockAircraft = dockAircrafts.get(0);
Dock dock = dockDomain.selectDockByDockId(dockAircraft.getDockId());
if (dock != null) {
Device dockDevice = deviceDomain.selectDeviceByDeviceId(dock.getDeviceId());
if (dockDevice != null) {
dockSn = dockDevice.getDeviceSn();
}
}
}
// 获取ThingsBoard数据并填充到DTO传入机场SN用于获取状态
// 这边的SN号是通用的
fillTuohengAircraftDetail(dto, device.getIotDeviceId(), device.getDeviceSn());
fillTuohengAircraftDetail(dto, device.getIotDeviceId(), dockSn);
return dto;
}