修改无人机的状态判断
This commit is contained in:
parent
5e9111e879
commit
a5e51849d9
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue