From 04c90bec00f91e8c403d7acaa338f69e5029617a Mon Sep 17 00:00:00 2001
From: zhaowenyu <35589726@qq.com>
Date: Tue, 02 Dec 2025 10:41:41 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
ard-route/src/main/java/com/ard/route/util/ToolUtils.java | 64 ++++++++++++++++++++++++++++++--
1 files changed, 60 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 5c11f9b..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";
@@ -103,4 +101,62 @@
}
}
+ /**
+ * 截取字符串
+ * 参数: https://xxx.xxx.xxx.xxx:xxx/kmz/2025/11/08/文件名_20251108152249A001.kmz
+ */
+ public static String subStringMinioName(String url) {
+ return new File(url).getName();
+ }
+
+ /**
+ * 截取字符串
+ * minio里面文件夹路径名称
+ */
+ public static String subStringMinioUrlName(String url) {
+ int kmzIndex = url.indexOf("/kmz/");
+ 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