From 2587cb5656a988d580c1e3d45185ea3d1e7dd6d0 Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Mon, 01 Dec 2025 17:12:26 +0800
Subject: [PATCH] 1. 优化没有无人机类型 。 2. 优化没有航线类型。 3. 优化readOnly错误。
---
ard-route/src/main/java/com/ard/route/util/ToolUtils.java | 47 +++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 43 insertions(+), 4 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 6ce967f..51b2401 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;
@@ -8,10 +10,6 @@
* 工具类
*/
public class ToolUtils {
-
- public static Boolean isLocal = false;
-
- public static String localFilePath = "KmzFile/kmz/";
public static String kmzPath = "kmz";
@@ -120,4 +118,45 @@
return url.substring(kmzIndex + 5); // +5 是为了跳过 "/kmz/"
}
+ /**
+ * 截取字符串
+ * 参数: "0-89-0"
+ */
+ public static Integer subStringDroneType(String str) {
+ String[] parts = str.split("-");
+ return Integer.valueOf(parts[1]);
+ }
+
+ /**
+ * 截取字符串
+ * 获取经纬度
+ */
+ public static Double getDoublePoint(String str,String type) {
+ String[] parts = str.split(",");
+ if ("lon".equals(type)) {
+ return Double.parseDouble(parts[0].trim());
+ }
+ if ("lat".equals(type)){
+ return Double.parseDouble(parts[1].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