提交航线管理逻辑和接口
This commit is contained in:
parent
762a21e46f
commit
5a7f2fe825
|
|
@ -22,6 +22,11 @@
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-core</artifactId>
|
<artifactId>ruoyi-common-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
/**
|
/**
|
||||||
* 航线服务
|
* 航线服务
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author 拓恒
|
||||||
* @date 2026-01-17
|
* @date 2026-01-17
|
||||||
*/
|
*/
|
||||||
@FeignClient(contextId = "remoteAirlineService", value = ServiceNameConstants.AIRLINE_SERVICE, fallbackFactory = RemoteAirlineFallbackFactory.class)
|
@FeignClient(contextId = "remoteAirlineService", value = ServiceNameConstants.AIRLINE_SERVICE, fallbackFactory = RemoteAirlineFallbackFactory.class)
|
||||||
|
|
@ -22,10 +22,11 @@ public interface RemoteAirlineService
|
||||||
/**
|
/**
|
||||||
* 根据ID查询航线信息
|
* 根据ID查询航线信息
|
||||||
*
|
*
|
||||||
* @param id 航线ID
|
* @param groupId 航线ID
|
||||||
* @param source 请求来源
|
* @param source 请求来源
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@GetMapping("/airline/temp/{id}")
|
// TODO
|
||||||
R<AirlineTempVO> getAirlineById(@PathVariable("id") String id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
@GetMapping("/airline/{groupId}")
|
||||||
|
R<AirlineTempVO> getAirlineByGroupId(@PathVariable("groupId") String groupId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
package com.ruoyi.airline.api.domain;
|
||||||
|
/**
|
||||||
|
* 航线航点VO
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-01-17
|
||||||
|
*/
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AirLinePointVO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
/**
|
||||||
|
* 序号
|
||||||
|
*/
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动作id
|
||||||
|
*/
|
||||||
|
private Integer command;
|
||||||
|
/**
|
||||||
|
* 经纬度 +-180
|
||||||
|
*/
|
||||||
|
private String lat;
|
||||||
|
/**
|
||||||
|
* 经纬度 +-90
|
||||||
|
*/
|
||||||
|
private String lon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高度
|
||||||
|
*/
|
||||||
|
private Integer alt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 悬停时间s
|
||||||
|
*/
|
||||||
|
private String loiterTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相机俯仰角
|
||||||
|
*/
|
||||||
|
private String cameraPitch;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相机滚动角
|
||||||
|
*/
|
||||||
|
private String cameraRoll;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相机偏航角
|
||||||
|
*/
|
||||||
|
private String cameraYaw;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 挂载控制 1 相机
|
||||||
|
*/
|
||||||
|
private Integer sessionControl;
|
||||||
|
/**
|
||||||
|
* 相机指令 1 拍照
|
||||||
|
*/
|
||||||
|
private Integer shootCommand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绝对变焦 目前 1-10
|
||||||
|
*/
|
||||||
|
private Integer zoomAbsolute;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 转动方向 -1逆时针 1相对机场方向 (硬件定义的)
|
||||||
|
*/
|
||||||
|
private Integer rotateDirection;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.ruoyi.airline.api.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 航线数据VO
|
||||||
|
* Controller 层视图对象,用于返回给前端的数据结构
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-01-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AirlineDataVO {
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 航班号
|
||||||
|
*/
|
||||||
|
private String flightNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 起飞城市
|
||||||
|
*/
|
||||||
|
private String departureCity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 到达城市
|
||||||
|
*/
|
||||||
|
private String arrivalCity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 空气速度
|
||||||
|
*/
|
||||||
|
private Double airspeed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 速度
|
||||||
|
*/
|
||||||
|
private Double velocity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 垂直速度
|
||||||
|
*/
|
||||||
|
private Double vspeed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 水平速度
|
||||||
|
*/
|
||||||
|
private Double hspeed;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AirlineDataVO{" +
|
||||||
|
"id=" + id +
|
||||||
|
", flightNumber='" + flightNumber + '\'' +
|
||||||
|
", departureCity='" + departureCity + '\'' +
|
||||||
|
", arrivalCity='" + arrivalCity + '\'' +
|
||||||
|
", airspeed=" + airspeed +
|
||||||
|
", velocity=" + velocity +
|
||||||
|
", vspeed=" + vspeed +
|
||||||
|
", hspeed=" + hspeed +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.ruoyi.airline.api.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 航线分组明细
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class AirlineFileGroupInfoVO extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* id,主键,用于order by 排序
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
private Long groupId;
|
||||||
|
|
||||||
|
AirlineFileVO airlineFileVO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("groupId", getGroupId())
|
||||||
|
.append("airlineFileVO", airlineFileVO.toString())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.ruoyi.airline.api.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 航线分组
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class AirlineFileGroupVO extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
private Long groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组名称
|
||||||
|
*/
|
||||||
|
private String groupName;
|
||||||
|
/**
|
||||||
|
* 用户ID,分组自带用户归属。 后期权限都是基于用户ID进行
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("groupId", getGroupId())
|
||||||
|
.append("groupName", getGroupName())
|
||||||
|
.append("userId", getUserId())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.ruoyi.airline.api.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 航线文件VO
|
||||||
|
* Controller 层视图对象,用于返回给前端的数据结构
|
||||||
|
*
|
||||||
|
* @author 拓恒
|
||||||
|
* @date 2026-01-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AirlineFileVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* waypoint文件地址
|
||||||
|
*/
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原始航线url
|
||||||
|
*/
|
||||||
|
private String origFileUrl;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 航线类型:1,航点航线;2,指点航线;3,指面航线
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 航线点列表
|
||||||
|
*/
|
||||||
|
private List<AirLinePointVO> linePointDtoList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1 启用 0 停用
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* kmz航线的全局高度
|
||||||
|
*/
|
||||||
|
private Integer djiRthAltitude;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
package com.ruoyi.airline.api.factory;
|
package com.ruoyi.airline.api.factory;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.R;
|
|
||||||
import com.ruoyi.airline.api.RemoteAirlineService;
|
import com.ruoyi.airline.api.RemoteAirlineService;
|
||||||
import com.ruoyi.airline.api.domain.AirlineTempVO;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
|
@ -23,13 +22,6 @@ public class RemoteAirlineFallbackFactory implements FallbackFactory<RemoteAirli
|
||||||
public RemoteAirlineService create(Throwable throwable)
|
public RemoteAirlineService create(Throwable throwable)
|
||||||
{
|
{
|
||||||
log.error("航线服务调用失败:{}", throwable.getMessage());
|
log.error("航线服务调用失败:{}", throwable.getMessage());
|
||||||
return new RemoteAirlineService()
|
return (id, source) -> R.fail("获取航线信息失败:" + throwable.getMessage());
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public R<AirlineTempVO> getAirlineById(String id, String source)
|
|
||||||
{
|
|
||||||
return R.fail("获取航线信息失败:" + throwable.getMessage());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue