设置作业架次
This commit is contained in:
parent
8dabee82ac
commit
04c6f23da7
|
|
@ -91,6 +91,8 @@ public class BufferDeviceImpl implements IBufferDeviceService
|
|||
Device airDevice = deviceDomain.selectDeviceByDeviceId(aircraft.getDeviceId());
|
||||
dto.setAircraftIotId(airDevice.getIotDeviceId());
|
||||
|
||||
|
||||
|
||||
List<AircraftPayload> aircraftPayloads =
|
||||
aircraftPayloadDomain.selectAircraftPayloadByAircraftId(aircraft.getAircraftId());
|
||||
|
||||
|
|
@ -115,6 +117,10 @@ public class BufferDeviceImpl implements IBufferDeviceService
|
|||
* 设置无人机状态
|
||||
*/
|
||||
dto.setAircraftStatus(aircraftDetailDTO.getAircraftStatus());
|
||||
/**
|
||||
* 设置作业架次
|
||||
*/
|
||||
dto.setMissionCount(aircraftDetailDTO.getMissionCount());
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -134,11 +140,11 @@ public class BufferDeviceImpl implements IBufferDeviceService
|
|||
|
||||
|
||||
|
||||
private DockDetailDTO getChangeAbleDockDetailDTO(String deviceIotId)
|
||||
private DockDetailDTO getChangeAbleDockDetailDTO(String dockerDeviceIotId)
|
||||
{
|
||||
DockDetailDTO dto = new DockDetailDTO();
|
||||
AttributeMap attributeMap = thingsBoardDomain.getPredefinedDeviceAttributes(deviceIotId);
|
||||
TelemetryMap telemetryMap = thingsBoardDomain.getPredefinedDeviceTelemetry(deviceIotId);
|
||||
AttributeMap attributeMap = thingsBoardDomain.getPredefinedDeviceAttributes(dockerDeviceIotId);
|
||||
TelemetryMap telemetryMap = thingsBoardDomain.getPredefinedDeviceTelemetry(dockerDeviceIotId);
|
||||
|
||||
// 根据 MODE_CODE 设置机场状态
|
||||
// MODE_CODE 定义: {"0":"空闲中","1":"现场调试","2":"远程调试","3":"固件升级中","4":"作业中","5":"待标定"}
|
||||
|
|
@ -168,6 +174,8 @@ public class BufferDeviceImpl implements IBufferDeviceService
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
|
@ -210,7 +218,9 @@ public class BufferDeviceImpl implements IBufferDeviceService
|
|||
String aircraftStatus = determineAircraftStatus(attributeMap, telemetryMap);
|
||||
dto.setAircraftStatus(aircraftStatus);
|
||||
|
||||
|
||||
// 从 TelemetryMap 中获取 total_flight_sorties 赋予 missionCount
|
||||
telemetryMap.get(DeviceTelemetry.Total_Flight_Sorties)
|
||||
.ifPresent(telemetryValue -> dto.setMissionCount(telemetryValue.getValue()));
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue