ard-admin/src/main/java/com/ard/web/controller/inspection/ArdPointCloudController.java
@@ -53,19 +53,6 @@ } /** * 导出点云文件列表 */ @ApiOperation("导出点云文件列表") //@PreAuthorize("@ss.hasPermi('inspection:cloud:export')") @Log(title = "点云文件", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ArdPointCloud ardPointCloud) { List<ArdPointCloud> list = ardPointCloudService.selectArdPointCloudList(ardPointCloud); ExcelUtil<ArdPointCloud> util = new ExcelUtil<ArdPointCloud>(ArdPointCloud.class); util.exportExcel(response, list, "点云文件数据"); } /** * 获取点云文件详细信息 */ @ApiOperation("获取点云文件详细信息") @@ -110,4 +97,16 @@ return toAjax(ardPointCloudService.deleteArdPointCloudByIds(ids)); } /** * 查询未选择点云文件列表 */ @ApiOperation("查询未选择点云文件列表") //@PreAuthorize("@ss.hasPermi('inspection:cloud:list')") @GetMapping("/notList/{ids}") public TableDataInfo notList(@PathVariable String[] ids) { startPage(); List<ArdPointCloud> list = ardPointCloudService.selectArdPointCloudNotList(ids); return getDataTable(list); } } ard-inspection/src/main/java/com/ard/inspection/mapper/ArdPointCloudMapper.java
@@ -61,4 +61,9 @@ public ArdPointCloud selectArdPointCloudByFileName(String fileName); /** * 根据航线ID,查询航线名称 */ public List<ArdPointCloud> selectArdPointCloudNotList(String[] ids); } ard-inspection/src/main/java/com/ard/inspection/service/IArdPointCloudService.java
@@ -61,4 +61,6 @@ public ArdPointCloud selectArdPointCloudByFileName(String filename); public List<ArdPointCloud> selectArdPointCloudNotList(String[] ids); } ard-inspection/src/main/java/com/ard/inspection/service/impl/ArdPointCloudServiceImpl.java
@@ -113,4 +113,9 @@ return ardPointCloudMapper.selectArdPointCloudByFileName(filename); } @Override public List<ArdPointCloud> selectArdPointCloudNotList(String[] ids) { return ardPointCloudMapper.selectArdPointCloudNotList(ids); } } ard-inspection/src/main/resources/mapper/ArdPointCloudMapper.xml
@@ -20,6 +20,20 @@ <result property="filePath" column="file_path" /> </resultMap> <!-- <resultMap type="ArdPointCloud" id="ArdPointCloudRouteNameResult">--> <!-- <result property="id" column="id" />--> <!-- <result property="cloudName" column="cloud_name" />--> <!-- <result property="fileName" column="file_name" />--> <!-- <result property="folderName" column="folder_name" />--> <!-- <result property="fileSize" column="file_size" />--> <!-- <result property="associatedState" column="associated_state" />--> <!-- <result property="routeId" column="route_id" />--> <!-- <result property="groupId" column="group_id" />--> <!-- <result property="filePath" column="file_path" />--> <!-- <result property="filePath" column="file_path" />--> <!-- <result property="filePath" column="file_path" />--> <!-- </resultMap>--> <sql id="selectArdPointCloudVo"> select id, cloud_name, @@ -35,6 +49,24 @@ update_time, file_path from ard_point_cloud </sql> <sql id="selectArdPointCloudRouteName"> SELECT a.id, a.cloud_name, a.file_name, a.folder_name, a.file_size, a.associated_state, a.route_id, a.group_id, a.file_path, c.id, c.name FROM ard_point_cloud a LEFT JOIN ard_route_cloud b ON a.id = b.cloud_id LEFT JOIN ard_route_info c ON b.route_id = c.id </sql> <select id="selectArdPointCloudList" parameterType="ArdPointCloud" resultMap="ArdPointCloudResult"> @@ -130,4 +162,12 @@ where file_name = #{fileName} </select> <select id="selectArdPointCloudNotList" parameterType="String" resultMap="ArdPointCloudResult"> <include refid="selectArdPointCloudVo"/> where id NOT IN <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </select> </mapper> ard-route/pom.xml
@@ -64,6 +64,10 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> <dependency> <groupId>com.ard</groupId> <artifactId>ard-inspection</artifactId> </dependency> </dependencies> ard-route/src/main/java/com/ard/route/domain/djuav/UavRouteReq.java
@@ -143,4 +143,13 @@ */ private String mappingHeadingMode; /** * 航点高程参考平面 * EGM96:使用海拔高编辑 * relativeToStartPoint:使用相对点的高度进行编辑 * aboveGroundLevel:使用地形数据,AGL下编辑(仅支持司空2平台) * realTimeFollowSurface: 使用实时仿地模式(仅用于建图航拍模版),仅支持M3E/M3T/M3M机型 */ private String heightMode; } ard-route/src/main/java/com/ard/route/domain/djuav/kml/KmlParams.java
@@ -110,5 +110,15 @@ * 全局航线速度 */ private Double globalTransitionalSpeed; /** * 航点高程参考平面 * EGM96:使用海拔高编辑 * relativeToStartPoint:使用相对点的高度进行编辑 * aboveGroundLevel:使用地形数据,AGL下编辑(仅支持司空2平台) * realTimeFollowSurface: 使用实时仿地模式(仅用于建图航拍模版),仅支持M3E/M3T/M3M机型 */ private String heightMode; } ard-route/src/main/java/com/ard/route/domain/route/ArdRouteCloud.java
New file @@ -0,0 +1,18 @@ package com.ard.route.domain.route; import lombok.Data; @Data public class ArdRouteCloud { /** 航线ID */ private String routeId; /** 点云ID */ private String cloudId; private A a; private B b; } ard-route/src/main/java/com/ard/route/domain/route/ArdRouteInfo.java
@@ -1,11 +1,13 @@ package com.ard.route.domain.route; import com.ard.common.core.domain.BaseEntity; import com.ard.inspection.domain.ArdPointCloud; import com.ard.route.domain.djuav.UavRouteReq; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.util.List; /** * 航线(kmz)对象 ard_route_info @@ -72,6 +74,9 @@ /** 航线数据 */ private byte[] routeData; /** 点云数据 */ private byte[] cloudData; /** 行点总数 */ private Integer pointCount; @@ -79,6 +84,6 @@ private String missionId; /** 点云数据 */ //private List<> private List<ArdPointCloud> ardPointCloudList; } ard-route/src/main/java/com/ard/route/mapper/ArdRouteCloudMapper.java
New file @@ -0,0 +1,43 @@ package com.ard.route.mapper; import com.ard.route.domain.route.ArdRouteCloud; import java.util.List; /** * @author xia */ public interface ArdRouteCloudMapper { /** * 通过航线ID删除关联 * * @param routeId 航线ID * @return 结果 */ public int deleteRouteCloudByRouteId(String routeId); /** * 批量删除关联信息 * * @param ids 需要删除的数据ID * @return 结果 */ public int selectRouteCloudByCloudId(String[] ids); /** * 查询点云ID使用数量 * * @param cloudId 点云ID * @return 结果 */ public int deleteRouteCloud(String cloudId); /** * 批量新增 * * @param routeCloudList List * @return 结果 */ public int batchRouteCloud(List<ArdRouteCloud> routeCloudList); } ard-route/src/main/java/com/ard/route/service/impl/ArdRouteInfoServiceImpl.java
@@ -1,6 +1,7 @@ package com.ard.route.service.impl; import java.io.IOException; import java.util.ArrayList; import java.util.List; import com.ard.common.exception.ControlException; @@ -13,6 +14,8 @@ import com.ard.data.noflyzone.service.IArdNoFlyZoneService; import com.ard.data.noflyzone.utils.NoFlyZoneUtils; import com.ard.framework.web.service.TokenService; import com.ard.inspection.domain.ArdPointCloud; import com.ard.inspection.mapper.ArdPointCloudMapper; import com.ard.oss.model.MinioUploadResult; import com.ard.oss.service.impl.OssServiceContext; import com.ard.route.domain.djuav.ActionGroupReq; @@ -20,9 +23,11 @@ import com.ard.route.domain.djuav.RoutePointReq; import com.ard.route.domain.djuav.UavRouteReq; import com.ard.route.domain.dto.ArdNoflyDto; import com.ard.route.domain.route.ArdRouteCloud; import com.ard.route.domain.route.ArdRouteInfo; import com.ard.route.domain.route.ArdRouteMission; import com.ard.route.domain.vo.KmzResultVo; import com.ard.route.mapper.ArdRouteCloudMapper; import com.ard.route.mapper.ArdRouteInfoMapper; import com.ard.route.mapper.ArdRouteMissionMapper; import com.ard.route.service.IArdRouteInfoService; @@ -38,8 +43,6 @@ import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import static com.ard.common.utils.SecurityUtils.getUserId; import static com.ard.route.enums.kml.DroneEnumValueEnums.M350_RTK; import static com.ard.route.util.InitializationUtils.divided_23; import static com.ard.route.util.ToolUtils.*; @@ -69,6 +72,12 @@ @Autowired private ArdRouteMissionMapper ardRouteMissionMapper; @Autowired private ArdPointCloudMapper ardPointCloudMapper; @Autowired private ArdRouteCloudMapper ardRouteCloudMapper; @Resource private IArdNoFlyZoneService ardNoFlyZoneService; @@ -88,6 +97,9 @@ if (ardRouteInfo != null) { if (ardRouteInfo.getRouteData() != null){ ardRouteInfo.setUavRouteReq((UavRouteReq) deserialize(ardRouteInfo.getRouteData())); if (ardRouteInfo.getCloudData() != null){ ardRouteInfo.setArdPointCloudList(deserializeLs(ardRouteInfo.getCloudData())); } } } } catch (IOException | ClassNotFoundException e) { @@ -153,8 +165,29 @@ zoomProcessing(ardRouteInfo); ardRouteInfo.setPath(kmzResult.getPath()); ardRouteInfo.setReadOnly("0"); insertRoutePointCloud(ardRouteInfo); ardRouteInfoMapper.insertArdRouteInfo(dataProcessing(ardRouteInfo)); return kmzResult.getPath(); } /** * 新增航信信息时,修改点云数据 * 同时增加航线与点云关联关系表数据 */ private void insertRoutePointCloud(ArdRouteInfo ardRouteInfo) { List<ArdRouteCloud> cloudList = new ArrayList<>(); if (ardRouteInfo.getArdPointCloudList() != null){ for (ArdPointCloud cloudId : ardRouteInfo.getArdPointCloudList()) { ArdRouteCloud cloud = new ArdRouteCloud(); cloud.setRouteId(ardRouteInfo.getId()); cloud.setCloudId(cloudId.getId()); cloudId.setAssociatedState("1"); cloudList.add(cloud); cloudId.setUpdateTime(DateUtils.getNowDate()); ardPointCloudMapper.updateArdPointCloud(cloudId); } ardRouteCloudMapper.batchRouteCloud(cloudList); } } /** @@ -255,14 +288,19 @@ private ArdRouteInfo dataProcessing(ArdRouteInfo ardRouteInfo) { // 航线数据 byte[] routeData = null; byte[] cloudData = null; try { if (ardRouteInfo.getUavRouteReq() != null){ routeData = serialize(ardRouteInfo.getUavRouteReq()); } if (ardRouteInfo.getArdPointCloudList() != null){ cloudData = serialize(ardRouteInfo.getArdPointCloudList()); } } catch (IOException e) { throw new RuntimeException(e); } ardRouteInfo.setRouteData(routeData); ardRouteInfo.setCloudData(cloudData); ardRouteInfo.setPointCount(getPointCount(ardRouteInfo)); return ardRouteInfo; } @@ -419,6 +457,9 @@ ArdRouteInfo route = ardRouteInfoMapper.selectArdRouteInfoById(id); try { route.setUavRouteReq((UavRouteReq) deserialize(route.getRouteData())); if (route.getCloudData() != null){ route.setArdPointCloudList(deserializeLs(route.getCloudData())); } } catch (IOException | ClassNotFoundException e) { throw new RuntimeException(e); } ard-route/src/main/java/com/ard/route/util/InitializationUtils.java
@@ -56,6 +56,7 @@ } uavRouteReq.setWaypointTurnReq(waypointTurnReq); uavRouteReq.setGimbalPitchMode("usePointSetting"); uavRouteReq.setHeightMode("EGM96"); if (M350_RTK.getValue().equals(uavRouteReq.getDroneType())) { // 变焦数值加工 buildZoom(uavRouteReq); ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java
@@ -143,7 +143,9 @@ }else { kmlMissionConfig.setGlobalTransitionalSpeed("15"); } if (kmlParams.getHeightMode().equals(HeightModeEnums.RELATIVE_TO_START_POINT.getValue())){ kmlMissionConfig.setGlobalRTHHeight("100"); } kmlMissionConfig.setTakeOffRefPoint(kmlParams.getTakeOffRefPoint()); kmlMissionConfig.setDroneInfo(buildKmlDroneInfo(kmlParams.getDroneType(), kmlParams.getSubDroneType())); kmlMissionConfig.setPayloadInfo(buildKmlPayloadInfo(kmlParams.getPayloadType(), kmlParams.getPayloadPosition())); @@ -175,13 +177,28 @@ kmlFolder.setAutoFlightSpeed(String.valueOf(kmlParams.getAutoFlightSpeed())); if (StringUtils.equals(fileType, FileTypeConstants.KML)) { kmlFolder.setTemplateType(kmlParams.getTemplateType()); kmlFolder.setWaylineCoordinateSysParam(buildKmlWayLineCoordinateSysParam(kmlParams.getTemplateType(), HeightModeEnums.RELATIVE_TO_START_POINT.getValue(), if (kmlParams.getHeightMode().equals(HeightModeEnums.RELATIVE_TO_START_POINT.getValue())){ kmlFolder.setWaylineCoordinateSysParam( buildKmlWayLineCoordinateSysParam( kmlParams.getTemplateType(), HeightModeEnums.RELATIVE_TO_START_POINT.getValue(), String.valueOf(kmlParams.getGlobalHeight()))); }else if(kmlParams.getHeightMode().equals(HeightModeEnums.EGM96.getValue())){ kmlFolder.setWaylineCoordinateSysParam( buildKmlWayLineCoordinateSysParam( kmlParams.getTemplateType(), HeightModeEnums.EGM96.getValue(), String.valueOf(kmlParams.getGlobalHeight()))); } kmlFolder.setPayloadParam(buildKmlPayloadParam(kmlParams)); } if (StringUtils.equals(fileType, FileTypeConstants.WPML)) { kmlFolder.setWaylineId("0"); if (kmlParams.getHeightMode().equals(HeightModeEnums.RELATIVE_TO_START_POINT.getValue())){ kmlFolder.setExecuteHeightMode(ExecuteHeightModeEnums.RELATIVE_TO_START_POINT.getValue()); } else if (kmlParams.getHeightMode().equals(HeightModeEnums.EGM96.getValue())) { kmlFolder.setExecuteHeightMode(ExecuteHeightModeEnums.WGS84.getValue()); } if (CollectionUtil.isNotEmpty(kmlParams.getStartActionList())) { KmlActionGroup kmlActionGroup = new KmlActionGroup(); kmlActionGroup.setAction(getKmlActionList(kmlParams.getStartActionList(), kmlParams)); ard-route/src/main/java/com/ard/route/util/ToolUtils.java
@@ -1,9 +1,11 @@ package com.ard.route.util; import com.ard.inspection.domain.ArdPointCloud; import com.ard.route.domain.djuav.UavRouteReq; import java.io.*; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; /** * 工具类 @@ -103,6 +105,13 @@ } } public static List<ArdPointCloud> deserializeLs(byte[] data) throws IOException, ClassNotFoundException { try (ByteArrayInputStream bais = new ByteArrayInputStream(data); ObjectInputStream ois = new ObjectInputStream(bais)) { return (List<ArdPointCloud>) ois.readObject(); } } /** * 截取字符串 * 参数: https://xxx.xxx.xxx.xxx:xxx/kmz/2025/11/08/文件名_20251108152249A001.kmz ard-route/src/main/resources/mapper/ArdRouteCloudMapper.xml
New file @@ -0,0 +1,41 @@ <?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.ard.route.mapper.ArdRouteCloudMapper"> <resultMap type="ArdRouteCloud" id="ArdRouteCloudResult"> <result property="routeId" column="route_id" /> <result property="cloudId" column="cloud_id" /> </resultMap> <delete id="deleteRouteCloudByRouteId" parameterType="String"> delete from ard_route_cloud where route_id=#{routeId} </delete> <select id="selectRouteCloudByCloudId" resultType="Integer"> select count(1) from ard_route_cloud where cloud_id=#{cloudId} </select> <delete id="deleteRouteCloud" parameterType="String"> delete from ard_route_cloud where route_id in <foreach collection="array" item="routeId" open="(" separator="," close=")"> #{routeId} </foreach> </delete> <insert id="batchRouteCloud"> insert into ard_route_cloud(route_id, cloud_id) values <foreach item="item" index="index" collection="list" separator=","> (#{item.routeId},#{item.cloudId}) </foreach> </insert> <insert id="insert"> insert into ard_route_cloud(route_id, cloud_id) values <foreach item="item" index="index" collection="list" separator=","> (#{item.routeId},#{item.cloudId}) </foreach> </insert> </mapper> ard-route/src/main/resources/mapper/ArdRouteInfoMapper.xml
@@ -13,6 +13,7 @@ <result property="aircraft" column="aircraft" /> <result property="payload" column="payload" /> <result property="routeData" column="route_data" /> <result property="cloudData" column="cloud_data" /> <result property="readOnly" column="read_only" /> <result property="createBy" column="create_by" /> <result property="createTime" column="create_time" /> @@ -32,6 +33,7 @@ aircraft, payload, route_data, cloud_data, read_only, create_by, create_time, @@ -79,6 +81,7 @@ <if test="aircraft != null">aircraft,</if> <if test="payload != null">payload,</if> <if test="routeData != null">route_data,</if> <if test="cloudData != null">cloud_data,</if> <if test="readOnly != null">read_only,</if> <if test="createBy != null">create_by,</if> <if test="createTime != null">create_time,</if> @@ -97,6 +100,7 @@ <if test="aircraft != null">#{aircraft},</if> <if test="payload != null">#{payload},</if> <if test="routeData != null">#{routeData},</if> <if test="cloudData != null">#{cloudData},</if> <if test="readOnly != null">#{readOnly},</if> <if test="createBy != null">#{createBy},</if> <if test="createTime != null">#{createTime},</if> @@ -118,6 +122,7 @@ <if test="aircraft != null">aircraft = #{aircraft},</if> <if test="payload != null">payload = #{payload},</if> <if test="routeData != null">route_data = #{routeData},</if> <if test="cloudData != null">cloud_data = #{cloudData},</if> <if test="readOnly != null">read_only = #{readOnly},</if> <if test="createBy != null">create_by = #{createBy},</if> <if test="createTime != null">create_time = #{createTime},</if>