From 5a4168664a6d2d98f505d1f3ced39eaf4b2ed05c Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Thu, 13 Nov 2025 16:39:03 +0800
Subject: [PATCH] 1.修改bug。分组查询报错问题

---
 ard-route/src/main/java/com/ard/route/util/ToolUtils.java                       |    9 +++++++++
 ard-route/src/main/resources/mapper/ArdRouteInfoMapper.xml                      |    5 +++--
 ard-route/src/main/java/com/ard/route/service/impl/ArdRouteInfoServiceImpl.java |   10 ++++++++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/ard-route/src/main/java/com/ard/route/service/impl/ArdRouteInfoServiceImpl.java b/ard-route/src/main/java/com/ard/route/service/impl/ArdRouteInfoServiceImpl.java
index b58c31c..22a6cd9 100644
--- a/ard-route/src/main/java/com/ard/route/service/impl/ArdRouteInfoServiceImpl.java
+++ b/ard-route/src/main/java/com/ard/route/service/impl/ArdRouteInfoServiceImpl.java
@@ -13,6 +13,7 @@
 import com.ard.data.noflyzone.utils.NoFlyZoneUtils;
 import com.ard.oss.model.MinioUploadResult;
 import com.ard.oss.service.impl.OssServiceContext;
+import com.ard.route.domain.CoordinatePointReq;
 import com.ard.route.domain.UavRouteReq;
 import com.ard.route.domain.route.ArdRouteInfo;
 import com.ard.route.domain.vo.KmzResultVo;
@@ -96,6 +97,8 @@
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
+        Integer droneType = subStringDroneType(ardRouteInfo.getAircraft());
+        ardRouteInfo.getUavRouteReq().setDroneType(droneType);
         ardRouteInfo.setRouteData(routeData);
         KmzResultVo kmzResult = routeService.buildKmz(ardRouteInfo.getUavRouteReq(), ardRouteInfo.getName());
         ardRouteInfo.setPath(kmzResult.getPath());
@@ -217,6 +220,9 @@
             throw new ControlException("方法参数中未找到有效经纬度字段,无法判断禁飞区!");
         }
         List<ArdNoFlyZone> ardNoFlyZones = ardNoFlyZoneService.selectArdNoFlyZoneList(new ArdNoFlyZone());
+
+
+
         if (!ardNoFlyZones.isEmpty()) {
             Vertex vertex = new Vertex(longitude, latitude);
 //            boolean inNoFlyZones = NoFlyZoneUtils.isPointInPolygon(vertex, ardNoFlyZones);
@@ -236,4 +242,8 @@
         ardRouteInfoMapper.insertArdRouteInfo(ardRouteInfo);
     }
 
+    private void verifyNoFlyZone(CoordinatePointReq a,CoordinatePointReq b){
+
+    }
+
 }
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..2d34f6c 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
@@ -120,4 +120,13 @@
         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]);
+    }
+
 }
diff --git a/ard-route/src/main/resources/mapper/ArdRouteInfoMapper.xml b/ard-route/src/main/resources/mapper/ArdRouteInfoMapper.xml
index a10104f..2b0e11e 100644
--- a/ard-route/src/main/resources/mapper/ArdRouteInfoMapper.xml
+++ b/ard-route/src/main/resources/mapper/ArdRouteInfoMapper.xml
@@ -59,7 +59,7 @@
             <if test="id != null">id,</if>
             <if test="name != null">name,</if>
             <if test="path != null">path,</if>
-            <if test="GroupId != null">group_id,</if>
+            <if test="groupId != null">group_id,</if>
             <if test="type != null">type,</if>
             <if test="aircraft != null">aircraft,</if>
             <if test="payload != null">payload,</if>
@@ -74,7 +74,7 @@
             <if test="id != null">#{id},</if>
             <if test="name != null">#{name},</if>
             <if test="path != null">#{path},</if>
-            <if test="GroupId != null">#{GroupId},</if>
+            <if test="groupId != null">#{groupId},</if>
             <if test="type != null">#{type},</if>
             <if test="aircraft != null">#{aircraft},</if>
             <if test="payload != null">#{payload},</if>
@@ -92,6 +92,7 @@
         <trim prefix="SET" suffixOverrides=",">
             <if test="name != null">name = #{name},</if>
             <if test="path != null">path = #{path},</if>
+            <if test="groupId != null">group_id = #{groupId},</if>
             <if test="type != null">type = #{type},</if>
             <if test="aircraft != null">aircraft = #{aircraft},</if>
             <if test="payload != null">payload = #{payload},</if>

--
Gitblit v1.9.3