From 0083a82a5c090e2d75c6cafa5a686632b381c586 Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Fri, 12 Dec 2025 08:57:37 +0800
Subject: [PATCH] 1. 测试航线修改发现bug。

---
 ard-route/src/main/java/com/ard/route/util/ToolUtils.java |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/ard-route/src/main/java/com/ard/route/util/ToolUtils.java b/ard-route/src/main/java/com/ard/route/util/ToolUtils.java
index 74d2202..38bb620 100644
--- a/ard-route/src/main/java/com/ard/route/util/ToolUtils.java
+++ b/ard-route/src/main/java/com/ard/route/util/ToolUtils.java
@@ -1,5 +1,7 @@
 package com.ard.route.util;
 
+import com.ard.route.domain.djuav.UavRouteReq;
+
 import java.io.*;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -125,7 +127,14 @@
         return Integer.valueOf(parts[1]);
     }
 
+    /**
+     * 截取字符串
+     * 获取经纬度高度
+     */
     public static Double getDoublePoint(String str,String type) {
+        if (str == null || str.isEmpty()) {
+            return null;
+        }
         String[] parts = str.split(",");
         if ("lon".equals(type)) {
             return Double.parseDouble(parts[0].trim());
@@ -133,7 +142,27 @@
         if ("lat".equals(type)){
             return Double.parseDouble(parts[1].trim());
         }
+        if ("alt".equals(type)){
+            return Double.parseDouble(parts[2].trim());
+        }
         return null;
     }
 
+    /**
+     * 获取航线类型方法
+     */
+    public static String templateTypeData(UavRouteReq uavRouteReq) {
+        if ("waypoint".equals(uavRouteReq.getTemplateType())){
+            return "0";
+        }
+        return "1";
+    }
+
+    /**
+     * 获取无人机类型方法
+     */
+    public static String droneTypeData(UavRouteReq uavRouteReq) {
+        return "0-" + uavRouteReq.getDroneType() + "-0";
+    }
+
 }

--
Gitblit v1.9.3