处理机场飞行控制数据

This commit is contained in:
孙小云 2026-02-28 15:45:59 +08:00
parent a4950f3d0e
commit 67f465b364
2 changed files with 6 additions and 1 deletions

View File

@ -22,7 +22,7 @@ public class FlightEntity extends BaseEntity
/** 外部飞行ID (来自MQTT的taskId) */ /** 外部飞行ID (来自MQTT的taskId) */
private String flightIdExternal; private String flightIdExternal;
/** 状态:自检中、飞行中、已返航 */ /** 状态:HOME ERROR CHECKING FLYING */
private String status; private String status;
/** 返航时间 */ /** 返航时间 */

View File

@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -95,6 +96,10 @@ public class FlightLogCallback implements IDroneRealTimeCallback {
String statusText = result != null && result ? "自检成功" : "自检失败"; String statusText = result != null && result ? "自检成功" : "自检失败";
String logContent = check + " " + value + " " + statusText; String logContent = check + " " + value + " " + statusText;
if(Boolean.FALSE.equals(result)){
flightService.updateFlightStatus(flight.getFlightId(), "ERROR");
}
logEntity.setLogContent(logContent); logEntity.setLogContent(logContent);
logEntity.setSuccess(result != null ? result : false); logEntity.setSuccess(result != null ? result : false);