From a222a89580ad46ad31924bdfba4f0e05ecefde16 Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Tue, 10 Mar 2026 17:14:46 +0800
Subject: [PATCH] 1. 优化精细化巡检业务逻辑。

---
 ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java |   31 ++++++++++++++++++++++++++-----
 1 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java b/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java
index 955a11b..b79dc6a 100644
--- a/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java
+++ b/ard-route/src/main/java/com/ard/route/util/RouteFileUtils.java
@@ -143,7 +143,9 @@
         }else {
             kmlMissionConfig.setGlobalTransitionalSpeed("15");
         }
-        kmlMissionConfig.setGlobalRTHHeight("100");
+        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(),
-                    String.valueOf(kmlParams.getGlobalHeight())));
+            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");
-            kmlFolder.setExecuteHeightMode(ExecuteHeightModeEnums.RELATIVE_TO_START_POINT.getValue());
+            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));
@@ -541,7 +558,11 @@
             }else {
                 kmlActionActuatorFuncParam.setFileSuffix("panoramicPhoto_360");
             }
-            kmlActionActuatorFuncParam.setUseGlobalPayloadLensIndex(String.valueOf(pointActionReq.getUseGlobalImageFormat()));
+            if (pointActionReq.getUseGlobalImageFormat() != null) {
+                kmlActionActuatorFuncParam.setUseGlobalPayloadLensIndex(String.valueOf(pointActionReq.getUseGlobalImageFormat()));
+            }else {
+                kmlActionActuatorFuncParam.setUseGlobalPayloadLensIndex("0");
+            }
             if (ObjectUtil.equals(pointActionReq.getUseGlobalImageFormat(), 0)) {
                 kmlActionActuatorFuncParam.setPayloadLensIndex(pointActionReq.getImageFormat());
             } else {

--
Gitblit v1.9.3