a-tuoheng-device/src/main/java/com/ruoyi/device/service/FlightService.java

95 lines
2.4 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.ruoyi.device.service;
import com.ruoyi.device.mapper.entity.FlightEntity;
import com.ruoyi.task.api.enums.StatusEnum;
import java.util.Map;
/**
* 飞行服务接口
*
* @author ruoyi
* @date 2026-02-25
*/
public interface FlightService
{
public Long currentRunningTask(String sn);
public Long createClickTakeOffTask(String sn, String url);
/**
* 获取或创建飞行记录通过messageID匹配
* 如果存在相同messageID的飞行记录返回该记录
* 如果不存在或messageID不同创建新记录
*
* @param deviceSn 设备SN号
* @param messageId 消息ID对应flightIdExternal
* @return 飞行记录
*/
// FlightEntity getOrCreateFlightByMessageId(String deviceSn, String messageId);
// /**
// * 获取最新的飞行记录(包括已返航的)
// * 用于WebSocket推送
// *
// * @param deviceSn 设备SN号
// * @return 飞行记录
// */
// FlightEntity getLatestFlight(String deviceSn);
// /**
// * 更新飞行ID外部ID
// *
// * @param flightId 飞行ID
// * @param flightIdExternal 外部飞行ID
// */
// void updateFlightIdExternal(Long flightId, String flightIdExternal);
/**
* 更新飞行状态
*
* @param flightId 飞行ID
* @param status 状态:自检中、飞行中、已返航
*/
void updateFlightStatus(Long flightId, StatusEnum status);
// /**
// * 更新返航时间
// *
// * @param flightId 飞行ID
// */
// void updateReturnTime(Long flightId);
/**
* 获取飞行记录和日志用于WebSocket推送
*
* @param deviceSn 设备SN号
* @return 飞行记录和日志
*/
Map<String, Object> getLatestFlightWithLogs(String deviceSn);
/**
* 保存自检日志
*
* @param logEntity 自检日志实体
*/
void insertPreCheckLog(com.ruoyi.device.mapper.entity.PreCheckLogEntity logEntity);
/**
* 保存飞行日志
*
* @param logEntity 飞行日志实体
*/
void insertFlightLog(com.ruoyi.device.mapper.entity.FlightLogEntity logEntity);
/**
* 检查飞行记录是否有飞行日志
*
* @param flightId 飞行ID
* @return true=有飞行日志已起飞false=无飞行日志(未起飞)
*/
boolean hasFlightLog(Long flightId);
}