Browse Source

Merge branch 'mh' of http://124.70.32.114:3100/woka/cesium-map-object into ctw

# Conflicts:
#	ruoyi-ui/src/views/cesiumMap/index.vue
lbj
ctw 2 months ago
parent
commit
14d86d9f99
  1. 104
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/RouteWaypointsController.java
  2. 194
      ruoyi-system/src/main/java/com/ruoyi/system/domain/RouteWaypoints.java
  3. 87
      ruoyi-system/src/main/java/com/ruoyi/system/domain/Routes.java
  4. 64
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/RouteWaypointsMapper.java
  5. 61
      ruoyi-system/src/main/java/com/ruoyi/system/service/IRouteWaypointsService.java
  6. 104
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RouteWaypointsServiceImpl.java
  7. 26
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RoutesServiceImpl.java
  8. 100
      ruoyi-system/src/main/resources/mapper/system/RouteWaypointsMapper.xml
  9. 7
      ruoyi-system/src/main/resources/mapper/system/RoutesMapper.xml
  10. 44
      ruoyi-ui/src/api/system/waypoints.js
  11. 318
      ruoyi-ui/src/views/cesiumMap/index.vue
  12. 381
      ruoyi-ui/src/views/system/waypoints/index.vue

104
ruoyi-admin/src/main/java/com/ruoyi/web/controller/RouteWaypointsController.java

@ -0,0 +1,104 @@
package com.ruoyi.web.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.RouteWaypoints;
import com.ruoyi.system.service.IRouteWaypointsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 航线具体航点明细Controller
*
* @author ruoyi
* @date 2026-01-21
*/
@RestController
@RequestMapping("/system/waypoints")
public class RouteWaypointsController extends BaseController
{
@Autowired
private IRouteWaypointsService routeWaypointsService;
/**
* 查询航线具体航点明细列表
*/
@PreAuthorize("@ss.hasPermi('system:waypoints:list')")
@GetMapping("/list")
public TableDataInfo list(RouteWaypoints routeWaypoints)
{
startPage();
List<RouteWaypoints> list = routeWaypointsService.selectRouteWaypointsList(routeWaypoints);
return getDataTable(list);
}
/**
* 导出航线具体航点明细列表
*/
@PreAuthorize("@ss.hasPermi('system:waypoints:export')")
@Log(title = "航线具体航点明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RouteWaypoints routeWaypoints)
{
List<RouteWaypoints> list = routeWaypointsService.selectRouteWaypointsList(routeWaypoints);
ExcelUtil<RouteWaypoints> util = new ExcelUtil<RouteWaypoints>(RouteWaypoints.class);
util.exportExcel(response, list, "航线具体航点明细数据");
}
/**
* 获取航线具体航点明细详细信息
*/
@PreAuthorize("@ss.hasPermi('system:waypoints:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(routeWaypointsService.selectRouteWaypointsById(id));
}
/**
* 新增航线具体航点明细
*/
@PreAuthorize("@ss.hasPermi('system:waypoints:add')")
@Log(title = "航线具体航点明细", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody RouteWaypoints routeWaypoints)
{
return toAjax(routeWaypointsService.insertRouteWaypoints(routeWaypoints));
}
/**
* 修改航线具体航点明细
*/
@PreAuthorize("@ss.hasPermi('system:waypoints:edit')")
@Log(title = "航线具体航点明细", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RouteWaypoints routeWaypoints)
{
return toAjax(routeWaypointsService.updateRouteWaypoints(routeWaypoints));
}
/**
* 删除航线具体航点明细
*/
@PreAuthorize("@ss.hasPermi('system:waypoints:remove')")
@Log(title = "航线具体航点明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(routeWaypointsService.deleteRouteWaypointsByIds(ids));
}
}

194
ruoyi-system/src/main/java/com/ruoyi/system/domain/RouteWaypoints.java

@ -0,0 +1,194 @@
package com.ruoyi.system.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 航线具体航点明细对象 route_waypoints
*
* @author ruoyi
* @date 2026-01-21
*/
public class RouteWaypoints extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 航点ID */
private Long id;
/** 所属航线ID (关联 routes.id) */
@Excel(name = "所属航线ID (关联 routes.id)")
private Long routeId;
/** 航点名称 (如: WP1) */
@Excel(name = "航点名称 (如: WP1)")
private String name;
/** 航点顺序 (从1开始递增) */
@Excel(name = "航点顺序 (从1开始递增)")
private Long seq;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal lat;
/** 经度 */
@Excel(name = "经度")
private BigDecimal lng;
/** 高度 (米) */
@Excel(name = "高度 (米)")
private Long alt;
/** 速度 (km/h) */
@Excel(name = "速度 (km/h)")
private Long speed;
/** 起始时间 (如: K+00:40:00) */
@Excel(name = "起始时间 (如: K+00:40:00)")
private String startTime;
/** 转弯角度 (用于计算转弯半径) */
@Excel(name = "转弯角度 (用于计算转弯半径)")
private Long turnAngle;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setRouteId(Long routeId)
{
this.routeId = routeId;
}
public Long getRouteId()
{
return routeId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setSeq(Long seq)
{
this.seq = seq;
}
public Long getSeq()
{
return seq;
}
public void setLat(BigDecimal lat)
{
this.lat = lat;
}
public BigDecimal getLat()
{
return lat;
}
public void setLng(BigDecimal lng)
{
this.lng = lng;
}
public BigDecimal getLng()
{
return lng;
}
public void setAlt(Long alt)
{
this.alt = alt;
}
public Long getAlt()
{
return alt;
}
public void setSpeed(Long speed)
{
this.speed = speed;
}
public Long getSpeed()
{
return speed;
}
public void setStartTime(String startTime)
{
this.startTime = startTime;
}
public String getStartTime()
{
return startTime;
}
public void setTurnAngle(Long turnAngle)
{
this.turnAngle = turnAngle;
}
public Long getTurnAngle()
{
return turnAngle;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("routeId", getRouteId())
.append("name", getName())
.append("seq", getSeq())
.append("lat", getLat())
.append("lng", getLng())
.append("alt", getAlt())
.append("speed", getSpeed())
.append("startTime", getStartTime())
.append("turnAngle", getTurnAngle())
.toString();
}
/** * 获取转弯半径 (该字段不在数据库中仅用于逻辑计算)
* 公式: R = V^2 / (g * tan(θ))
*/
public Double getTurnRadius()
{
// 安全校验:如果角度为0、速度为null,半径视为0
if (this.turnAngle == null || this.turnAngle == 0 || this.speed == null) {
return 0.0;
}
// 单位换算:速度从 km/h 转为 m/s
double v_mps = this.speed / 3.6;
// 单位换算:角度从 度(Degree) 转为 弧度(Radians)
double radians = Math.toRadians(this.turnAngle.doubleValue());
// 重力加速度 g
double g = 9.8;
// 计算半径
double radius = (v_mps * v_mps) / (g * Math.tan(radians));
return radius;
}
}

87
ruoyi-system/src/main/java/com/ruoyi/system/domain/Routes.java

@ -5,108 +5,105 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.List;
/**
* 实体部署与航线对象 routes
*
*
* @author ruoyi
* @date 2026-01-14
*/
public class Routes extends BaseEntity
{
public class Routes extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 路由ID */
/**
* 路由ID
*/
private Long id;
/** 归属方案ID */
/**
* 归属方案ID
*/
@Excel(name = "归属方案ID")
private Long scenarioId;
/** 使用的是库里哪个平台 (关联 platform_lib.id) */
/**
* 使用的是库里哪个平台 (关联 platform_lib.id)
*/
@Excel(name = "使用的是库里哪个平台 (关联 platform_lib.id)")
private Long platformId;
/** 名称 (如: 猎鹰01) */
/**
* 名称 (: 猎鹰01)
*/
@Excel(name = "名称 (如: 猎鹰01)")
private String callSign;
/** 实例属性JSON: 覆盖库里的默认值 (如当前初始油量, 挂载配置) */
/**
* 实例属性JSON: 覆盖库里的默认值 (如当前初始油量, 挂载配置)
*/
@Excel(name = "实例属性JSON: 覆盖库里的默认值 (如当前初始油量, 挂载配置)")
private String attributes;
/** 航点数据JSON数组: [{seq, k_offset, lat, lng, alt, speed, action...}] */
@Excel(name = "航点数据JSON数组: [{seq, k_offset, lat, lng, alt, speed, action...}]")
private String waypoints;
private List<RouteWaypoints> waypoints;
public void setId(Long id)
{
public void setId(Long id) {
this.id = id;
}
public Long getId()
{
public Long getId() {
return id;
}
public void setScenarioId(Long scenarioId)
{
public void setScenarioId(Long scenarioId) {
this.scenarioId = scenarioId;
}
public Long getScenarioId()
{
public Long getScenarioId() {
return scenarioId;
}
public void setPlatformId(Long platformId)
{
public void setPlatformId(Long platformId) {
this.platformId = platformId;
}
public Long getPlatformId()
{
public Long getPlatformId() {
return platformId;
}
public void setCallSign(String callSign)
{
public void setCallSign(String callSign) {
this.callSign = callSign;
}
public String getCallSign()
{
public String getCallSign() {
return callSign;
}
public void setAttributes(String attributes)
{
public void setAttributes(String attributes) {
this.attributes = attributes;
}
public String getAttributes()
{
public String getAttributes() {
return attributes;
}
public void setWaypoints(String waypoints)
{
this.waypoints = waypoints;
public List<RouteWaypoints> getWaypoints() {
return waypoints;
}
public String getWaypoints()
{
return waypoints;
public void setWaypoints(List<RouteWaypoints> waypoints) {
this.waypoints = waypoints;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("scenarioId", getScenarioId())
.append("platformId", getPlatformId())
.append("callSign", getCallSign())
.append("attributes", getAttributes())
.append("waypoints", getWaypoints())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("scenarioId", getScenarioId())
.append("platformId", getPlatformId())
.append("callSign", getCallSign())
.append("attributes", getAttributes())
.append("waypoints", getWaypoints())
.toString();
}
}

64
ruoyi-system/src/main/java/com/ruoyi/system/mapper/RouteWaypointsMapper.java

@ -0,0 +1,64 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.RouteWaypoints;
/**
* 航线具体航点明细Mapper接口
*
* @author ruoyi
* @date 2026-01-21
*/
public interface RouteWaypointsMapper
{
/**
* 查询航线具体航点明细
*
* @param id 航线具体航点明细主键
* @return 航线具体航点明细
*/
public RouteWaypoints selectRouteWaypointsById(Long id);
/**
* 查询航线具体航点明细列表
*
* @param routeWaypoints 航线具体航点明细
* @return 航线具体航点明细集合
*/
public List<RouteWaypoints> selectRouteWaypointsList(RouteWaypoints routeWaypoints);
/** 查询指定航线下最大的序号 */
public Integer selectMaxSeqByRouteId(Long routeId);
/**
* 新增航线具体航点明细
*
* @param routeWaypoints 航线具体航点明细
* @return 结果
*/
public int insertRouteWaypoints(RouteWaypoints routeWaypoints);
/**
* 修改航线具体航点明细
*
* @param routeWaypoints 航线具体航点明细
* @return 结果
*/
public int updateRouteWaypoints(RouteWaypoints routeWaypoints);
/**
* 删除航线具体航点明细
*
* @param id 航线具体航点明细主键
* @return 结果
*/
public int deleteRouteWaypointsById(Long id);
/**
* 批量删除航线具体航点明细
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteRouteWaypointsByIds(Long[] ids);
}

61
ruoyi-system/src/main/java/com/ruoyi/system/service/IRouteWaypointsService.java

@ -0,0 +1,61 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.RouteWaypoints;
/**
* 航线具体航点明细Service接口
*
* @author ruoyi
* @date 2026-01-21
*/
public interface IRouteWaypointsService
{
/**
* 查询航线具体航点明细
*
* @param id 航线具体航点明细主键
* @return 航线具体航点明细
*/
public RouteWaypoints selectRouteWaypointsById(Long id);
/**
* 查询航线具体航点明细列表
*
* @param routeWaypoints 航线具体航点明细
* @return 航线具体航点明细集合
*/
public List<RouteWaypoints> selectRouteWaypointsList(RouteWaypoints routeWaypoints);
/**
* 新增航线具体航点明细
*
* @param routeWaypoints 航线具体航点明细
* @return 结果
*/
public int insertRouteWaypoints(RouteWaypoints routeWaypoints);
/**
* 修改航线具体航点明细
*
* @param routeWaypoints 航线具体航点明细
* @return 结果
*/
public int updateRouteWaypoints(RouteWaypoints routeWaypoints);
/**
* 批量删除航线具体航点明细
*
* @param ids 需要删除的航线具体航点明细主键集合
* @return 结果
*/
public int deleteRouteWaypointsByIds(Long[] ids);
/**
* 删除航线具体航点明细信息
*
* @param id 航线具体航点明细主键
* @return 结果
*/
public int deleteRouteWaypointsById(Long id);
}

104
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RouteWaypointsServiceImpl.java

@ -0,0 +1,104 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RouteWaypointsMapper;
import com.ruoyi.system.domain.RouteWaypoints;
import com.ruoyi.system.service.IRouteWaypointsService;
/**
* 航线具体航点明细Service业务层处理
*
* @author ruoyi
* @date 2026-01-21
*/
@Service
public class RouteWaypointsServiceImpl implements IRouteWaypointsService
{
@Autowired
private RouteWaypointsMapper routeWaypointsMapper;
/**
* 查询航线具体航点明细
*
* @param id 航线具体航点明细主键
* @return 航线具体航点明细
*/
@Override
public RouteWaypoints selectRouteWaypointsById(Long id)
{
return routeWaypointsMapper.selectRouteWaypointsById(id);
}
/**
* 查询航线具体航点明细列表
*
* @param routeWaypoints 航线具体航点明细
* @return 航线具体航点明细
*/
@Override
public List<RouteWaypoints> selectRouteWaypointsList(RouteWaypoints routeWaypoints)
{
return routeWaypointsMapper.selectRouteWaypointsList(routeWaypoints);
}
/**
* 新增航线具体航点明细
*
* @param routeWaypoints 航线具体航点明细
* @return 结果
*/
@Override
public int insertRouteWaypoints(RouteWaypoints routeWaypoints)
{
// 1. 获取该航线当前的最高序号
Integer maxSeq = routeWaypointsMapper.selectMaxSeqByRouteId(routeWaypoints.getRouteId());
// 2. 如果是第一条,序号为1;否则在最大值基础上 +1
if (maxSeq == null) {
routeWaypoints.setSeq(1L);
} else {
routeWaypoints.setSeq((long) (maxSeq + 1));
}
// 3. 执行若依生成的原始插入方法
return routeWaypointsMapper.insertRouteWaypoints(routeWaypoints);
}
/**
* 修改航线具体航点明细
*
* @param routeWaypoints 航线具体航点明细
* @return 结果
*/
@Override
public int updateRouteWaypoints(RouteWaypoints routeWaypoints)
{
return routeWaypointsMapper.updateRouteWaypoints(routeWaypoints);
}
/**
* 批量删除航线具体航点明细
*
* @param ids 需要删除的航线具体航点明细主键
* @return 结果
*/
@Override
public int deleteRouteWaypointsByIds(Long[] ids)
{
return routeWaypointsMapper.deleteRouteWaypointsByIds(ids);
}
/**
* 删除航线具体航点明细信息
*
* @param id 航线具体航点明细主键
* @return 结果
*/
@Override
public int deleteRouteWaypointsById(Long id)
{
return routeWaypointsMapper.deleteRouteWaypointsById(id);
}
}

26
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RoutesServiceImpl.java

@ -1,11 +1,15 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.system.domain.RouteWaypoints;
import com.ruoyi.system.service.IRouteWaypointsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RoutesMapper;
import com.ruoyi.system.domain.Routes;
import com.ruoyi.system.service.IRoutesService;
import org.springframework.transaction.annotation.Transactional;
/**
* 实体部署与航线Service业务层处理
@ -19,6 +23,9 @@ public class RoutesServiceImpl implements IRoutesService
@Autowired
private RoutesMapper routesMapper;
@Autowired
private IRouteWaypointsService routeWaypointsService;
/**
* 查询实体部署与航线
*
@ -50,9 +57,26 @@ public class RoutesServiceImpl implements IRoutesService
* @return 结果
*/
@Override
@Transactional
public int insertRoutes(Routes routes)
{
return routesMapper.insertRoutes(routes);
// 保存航线主体,MyBatis 会回填自增 ID 到 routes.id
int route = routesMapper.insertRoutes(routes);
// 从 routes 对象中拿到刚才手动添加的 List
List<RouteWaypoints> waypointList = routes.getWaypoints();
if (waypointList != null && !waypointList.isEmpty())
{
for (RouteWaypoints waypoint : waypointList)
{
// 将刚生成的航线 ID 绑定到每个航点上
waypoint.setRouteId(routes.getId());
// 调用航点 Service,触发seq字段的自动递增逻辑
routeWaypointsService.insertRouteWaypoints(waypoint);
}
}
return route;
}
/**

100
ruoyi-system/src/main/resources/mapper/system/RouteWaypointsMapper.xml

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.RouteWaypointsMapper">
<resultMap type="RouteWaypoints" id="RouteWaypointsResult">
<result property="id" column="id" />
<result property="routeId" column="route_id" />
<result property="name" column="name" />
<result property="seq" column="seq" />
<result property="lat" column="lat" />
<result property="lng" column="lng" />
<result property="alt" column="alt" />
<result property="speed" column="speed" />
<result property="startTime" column="start_time" />
<result property="turnAngle" column="turn_angle" />
</resultMap>
<sql id="selectRouteWaypointsVo">
select id, route_id, name, seq, lat, lng, alt, speed, start_time, turn_angle from route_waypoints
</sql>
<select id="selectRouteWaypointsList" parameterType="RouteWaypoints" resultMap="RouteWaypointsResult">
<include refid="selectRouteWaypointsVo"/>
<where>
<if test="routeId != null "> and route_id = #{routeId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="seq != null "> and seq = #{seq}</if>
<if test="lat != null "> and lat = #{lat}</if>
<if test="lng != null "> and lng = #{lng}</if>
<if test="alt != null "> and alt = #{alt}</if>
<if test="speed != null "> and speed = #{speed}</if>
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
<if test="turnAngle != null "> and turn_angle = #{turnAngle}</if>
</where>
</select>
<select id="selectRouteWaypointsById" parameterType="Long" resultMap="RouteWaypointsResult">
<include refid="selectRouteWaypointsVo"/>
where id = #{id}
</select>
<select id="selectMaxSeqByRouteId" parameterType="Long" resultType="Integer">
select max(seq) from ry.route_waypoints where route_id = #{routeId}
</select>
<insert id="insertRouteWaypoints" parameterType="RouteWaypoints" useGeneratedKeys="true" keyProperty="id">
insert into route_waypoints
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="routeId != null">route_id,</if>
<if test="name != null">name,</if>
<if test="seq != null">seq,</if>
<if test="lat != null">lat,</if>
<if test="lng != null">lng,</if>
<if test="alt != null">alt,</if>
<if test="speed != null">speed,</if>
<if test="startTime != null and startTime != ''">start_time,</if>
<if test="turnAngle != null">turn_angle,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="routeId != null">#{routeId},</if>
<if test="name != null">#{name},</if>
<if test="seq != null">#{seq},</if>
<if test="lat != null">#{lat},</if>
<if test="lng != null">#{lng},</if>
<if test="alt != null">#{alt},</if>
<if test="speed != null">#{speed},</if>
<if test="startTime != null and startTime != ''">#{startTime},</if>
<if test="turnAngle != null">#{turnAngle},</if>
</trim>
</insert>
<update id="updateRouteWaypoints" parameterType="RouteWaypoints">
update route_waypoints
<trim prefix="SET" suffixOverrides=",">
<if test="routeId != null">route_id = #{routeId},</if>
<if test="name != null">name = #{name},</if>
<if test="seq != null">seq = #{seq},</if>
<if test="lat != null">lat = #{lat},</if>
<if test="lng != null">lng = #{lng},</if>
<if test="alt != null">alt = #{alt},</if>
<if test="speed != null">speed = #{speed},</if>
<if test="startTime != null and startTime != ''">start_time = #{startTime},</if>
<if test="turnAngle != null">turn_angle = #{turnAngle},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRouteWaypointsById" parameterType="Long">
delete from route_waypoints where id = #{id}
</delete>
<delete id="deleteRouteWaypointsByIds" parameterType="String">
delete from route_waypoints where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

7
ruoyi-system/src/main/resources/mapper/system/RoutesMapper.xml

@ -10,11 +10,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="platformId" column="platform_id" />
<result property="callSign" column="call_sign" />
<result property="attributes" column="attributes" />
<result property="waypoints" column="waypoints" />
</resultMap>
<sql id="selectRoutesVo">
select id, scenario_id, platform_id, call_sign, attributes, waypoints from routes
select id, scenario_id, platform_id, call_sign, attributes from routes
</sql>
<select id="selectRoutesList" parameterType="Routes" resultMap="RoutesResult">
@ -24,7 +23,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="platformId != null "> and platform_id = #{platformId}</if>
<if test="callSign != null and callSign != ''"> and call_sign = #{callSign}</if>
<if test="attributes != null and attributes != ''"> and attributes = #{attributes}</if>
<if test="waypoints != null and waypoints != ''"> and waypoints = #{waypoints}</if>
</where>
</select>
@ -40,14 +38,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="platformId != null">platform_id,</if>
<if test="callSign != null and callSign != ''">call_sign,</if>
<if test="attributes != null and attributes != ''">attributes,</if>
<if test="waypoints != null and waypoints != ''">waypoints,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="scenarioId != null">#{scenarioId},</if>
<if test="platformId != null">#{platformId},</if>
<if test="callSign != null and callSign != ''">#{callSign},</if>
<if test="attributes != null and attributes != ''">#{attributes},</if>
<if test="waypoints != null and waypoints != ''">#{waypoints},</if>
</trim>
</insert>
@ -58,7 +54,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="platformId != null">platform_id = #{platformId},</if>
<if test="callSign != null and callSign != ''">call_sign = #{callSign},</if>
<if test="attributes != null and attributes != ''">attributes = #{attributes},</if>
<if test="waypoints != null and waypoints != ''">waypoints = #{waypoints},</if>
</trim>
where id = #{id}
</update>

44
ruoyi-ui/src/api/system/waypoints.js

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询航线具体航点明细列表
export function listWaypoints(query) {
return request({
url: '/system/waypoints/list',
method: 'get',
params: query
})
}
// 查询航线具体航点明细详细
export function getWaypoints(id) {
return request({
url: '/system/waypoints/' + id,
method: 'get'
})
}
// 新增航线具体航点明细
export function addWaypoints(data) {
return request({
url: '/system/waypoints',
method: 'post',
data: data
})
}
// 修改航线具体航点明细
export function updateWaypoints(data) {
return request({
url: '/system/waypoints',
method: 'put',
data: data
})
}
// 删除航线具体航点明细
export function delWaypoints(id) {
return request({
url: '/system/waypoints/' + id,
method: 'delete'
})
}

318
ruoyi-ui/src/views/cesiumMap/index.vue

File diff suppressed because it is too large

381
ruoyi-ui/src/views/system/waypoints/index.vue

@ -0,0 +1,381 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="所属航线ID (关联 routes.id)" prop="routeId">
<el-input
v-model="queryParams.routeId"
placeholder="请输入所属航线ID (关联 routes.id)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="航点名称 (如: WP1)" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入航点名称 (如: WP1)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="航点顺序 (从1开始递增)" prop="seq">
<el-input
v-model="queryParams.seq"
placeholder="请输入航点顺序 (从1开始递增)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="纬度" prop="lat">
<el-input
v-model="queryParams.lat"
placeholder="请输入纬度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="经度" prop="lng">
<el-input
v-model="queryParams.lng"
placeholder="请输入经度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="高度 (米)" prop="alt">
<el-input
v-model="queryParams.alt"
placeholder="请输入高度 (米)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="速度 (km/h)" prop="speed">
<el-input
v-model="queryParams.speed"
placeholder="请输入速度 (km/h)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="起始时间 (如: K+00:40:00)" prop="startTime">
<el-input
v-model="queryParams.startTime"
placeholder="请输入起始时间 (如: K+00:40:00)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="转弯角度 (用于计算转弯半径)" prop="turnAngle">
<el-input
v-model="queryParams.turnAngle"
placeholder="请输入转弯角度 (用于计算转弯半径)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:waypoints:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:waypoints:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:waypoints:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:waypoints:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="waypointsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="航点ID" align="center" prop="id" />
<el-table-column label="所属航线ID (关联 routes.id)" align="center" prop="routeId" />
<el-table-column label="航点名称 (如: WP1)" align="center" prop="name" />
<el-table-column label="航点顺序 (从1开始递增)" align="center" prop="seq" />
<el-table-column label="纬度" align="center" prop="lat" />
<el-table-column label="经度" align="center" prop="lng" />
<el-table-column label="高度 (米)" align="center" prop="alt" />
<el-table-column label="速度 (km/h)" align="center" prop="speed" />
<el-table-column label="起始时间 (如: K+00:40:00)" align="center" prop="startTime" />
<el-table-column label="转弯角度 (用于计算转弯半径)" align="center" prop="turnAngle" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:waypoints:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:waypoints:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改航线具体航点明细对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="所属航线ID (关联 routes.id)" prop="routeId">
<el-input v-model="form.routeId" placeholder="请输入所属航线ID (关联 routes.id)" />
</el-form-item>
<el-form-item label="航点名称 (如: WP1)" prop="name">
<el-input v-model="form.name" placeholder="请输入航点名称 (如: WP1)" />
</el-form-item>
<el-form-item label="航点顺序 (从1开始递增)" prop="seq">
<el-input v-model="form.seq" placeholder="请输入航点顺序 (从1开始递增)" />
</el-form-item>
<el-form-item label="纬度" prop="lat">
<el-input v-model="form.lat" placeholder="请输入纬度" />
</el-form-item>
<el-form-item label="经度" prop="lng">
<el-input v-model="form.lng" placeholder="请输入经度" />
</el-form-item>
<el-form-item label="高度 (米)" prop="alt">
<el-input v-model="form.alt" placeholder="请输入高度 (米)" />
</el-form-item>
<el-form-item label="速度 (km/h)" prop="speed">
<el-input v-model="form.speed" placeholder="请输入速度 (km/h)" />
</el-form-item>
<el-form-item label="起始时间 (如: K+00:40:00)" prop="startTime">
<el-input v-model="form.startTime" placeholder="请输入起始时间 (如: K+00:40:00)" />
</el-form-item>
<el-form-item label="转弯角度 (用于计算转弯半径)" prop="turnAngle">
<el-input v-model="form.turnAngle" placeholder="请输入转弯角度 (用于计算转弯半径)" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listWaypoints, getWaypoints, delWaypoints, addWaypoints, updateWaypoints } from "@/api/system/waypoints"
export default {
name: "Waypoints",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// 线
waypointsList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
routeId: null,
name: null,
seq: null,
lat: null,
lng: null,
alt: null,
speed: null,
startTime: null,
turnAngle: null
},
//
form: {},
//
rules: {
routeId: [
{ required: true, message: "所属航线ID (关联 routes.id)不能为空", trigger: "blur" }
],
seq: [
{ required: true, message: "航点顺序 (从1开始递增)不能为空", trigger: "blur" }
],
lat: [
{ required: true, message: "纬度不能为空", trigger: "blur" }
],
lng: [
{ required: true, message: "经度不能为空", trigger: "blur" }
],
alt: [
{ required: true, message: "高度 (米)不能为空", trigger: "blur" }
],
speed: [
{ required: true, message: "速度 (km/h)不能为空", trigger: "blur" }
],
startTime: [
{ required: true, message: "起始时间 (如: K+00:40:00)不能为空", trigger: "blur" }
],
turnAngle: [
{ required: true, message: "转弯角度 (用于计算转弯半径)不能为空", trigger: "blur" }
]
}
}
},
created() {
this.getList()
},
methods: {
/** 查询航线具体航点明细列表 */
getList() {
this.loading = true
listWaypoints(this.queryParams).then(response => {
this.waypointsList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
routeId: null,
name: null,
seq: null,
lat: null,
lng: null,
alt: null,
speed: null,
startTime: null,
turnAngle: null
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加航线具体航点明细"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getWaypoints(id).then(response => {
this.form = response.data
this.open = true
this.title = "修改航线具体航点明细"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateWaypoints(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addWaypoints(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除航线具体航点明细编号为"' + ids + '"的数据项?').then(function() {
return delWaypoints(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('system/waypoints/export', {
...this.queryParams
}, `waypoints_${new Date().getTime()}.xlsx`)
}
}
}
</script>
Loading…
Cancel
Save