From b3b96cfd900c3dee5dc84e53d5677fc6642f85e6 Mon Sep 17 00:00:00 2001
From: zhaowenyu <35589726@qq.com>
Date: Thu, 18 Dec 2025 09:55:48 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
ard-route/src/main/java/com/ard/route/service/impl/ArdRouteInfoServiceImpl.java | 54 +++++++++++++++++++++++++-----------------------------
1 files changed, 25 insertions(+), 29 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 aa000dd..97f5cd3 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
@@ -39,7 +39,6 @@
import static com.ard.route.enums.kml.DroneEnumValueEnums.M350_RTK;
import static com.ard.route.util.InitializationUtils.divided_23;
-import static com.ard.route.util.InitializationUtils.divided_6;
import static com.ard.route.util.ToolUtils.*;
import static com.ard.route.util.UavRouteReqUtils.fileConversionEntity;
@@ -86,20 +85,20 @@
} catch (IOException | ClassNotFoundException e) {
throw new RuntimeException(e);
}
+
+ // 主逻辑优化
+ double altitudeOffset = getDoublePoint(ardRouteInfo.getUavRouteReq().getTakeOffRefPoint(), "alt");
+
for (RoutePointReq routePointReq : ardRouteInfo.getUavRouteReq().getRoutePointList()) {
- routePointReq.setHeight(routePointReq.getHeight() + getDoublePoint(ardRouteInfo.getUavRouteReq().getTakeOffRefPoint(),"alt"));
- // 判断无人机类型
- if (ardRouteInfo.getUavRouteReq().getDroneType().equals(M350_RTK.getValue())){
- for (ActionGroupReq actionGroupReq : routePointReq.getActionGroupList()) {
- for (PointActionReq action : actionGroupReq.getActions()) {
- if (action.getZoom() != null || action.getZoom() != 0){
- action.setZoom(divided_23(action.getZoom()));
- }
- }
- }
- }
+ // 调整航点高度
+ adjustRoutePointHeight(routePointReq, altitudeOffset);
}
return ardRouteInfo;
+ }
+
+ // 提取航点高度调整逻辑到方法中
+ private void adjustRoutePointHeight(RoutePointReq routePointReq, double altitudeOffset) {
+ routePointReq.setHeight(routePointReq.getHeight() + altitudeOffset);
}
/**
@@ -115,12 +114,6 @@
}else if ("0".equals(ardRouteInfo.getOrderByTime())) {
ardRouteInfo.setOrderByTime("ASC");
}
-// List<ArdRouteInfo> list = ardRouteInfoMapper.selectArdRouteInfoList(ardRouteInfo);
-// for (ArdRouteInfo routeInfo : list) {
-// for (RoutePointReq routePointReq : routeInfo.getUavRouteReq().getRoutePointList()) {
-// routePointReq.setHeight(routePointReq.getHeight() + getDoublePoint(ardRouteInfo.getUavRouteReq().getTakeOffRefPoint(),"alt"));
-// }
-// }
return ardRouteInfoMapper.selectArdRouteInfoList(ardRouteInfo);
}
@@ -140,6 +133,18 @@
}
ardRouteInfo.getUavRouteReq().setDroneType(subStringDroneType(ardRouteInfo.getAircraft()));
KmzResultVo kmzResult = routeService.buildKmz(ardRouteInfo.getUavRouteReq(),ardRouteInfo.getName());
+ if (M350_RTK.getValue().equals(ardRouteInfo.getUavRouteReq().getDroneType())) {
+ // 变焦数值加工
+ for (RoutePointReq routePointReq : ardRouteInfo.getUavRouteReq().getRoutePointList()) {
+ for (ActionGroupReq actionGroupReq : routePointReq.getActionGroupList()) {
+ for (PointActionReq action : actionGroupReq.getActions()) {
+ if (action.getZoom() != null){
+ action.setZoom(divided_23(action.getZoom()));
+ }
+ }
+ }
+ }
+ }
ardRouteInfo.setPath(kmzResult.getPath());
ardRouteInfo.setReadOnly("0");
ardRouteInfoMapper.insertArdRouteInfo(dataProcessing(ardRouteInfo));
@@ -249,17 +254,6 @@
ardRouteInfo.setType(templateTypeData(uavRouteReq));
ardRouteInfo.setAircraft(droneTypeData(uavRouteReq));
}
-
- // 判断禁飞区
- try {
- arrayWithinNoFlyZone(ardRouteInfo.getUavRouteReq().getRoutePointList());
- } catch (ControlException e) {
- // 返回包含禁飞区错误信息的特定结果
- return MinioUploadResult.builder()
- .originalFilename("禁飞区错误.航线航点在禁飞区!")
- .build();
- }
-
String url = ossService.upload("kmz",file);
ardRouteInfo.setName(file.getOriginalFilename());
ardRouteInfo.setPath(url);
@@ -352,6 +346,8 @@
} catch (IOException | ClassNotFoundException e) {
throw new RuntimeException(e);
}
+ // 判断禁飞区
+ arrayWithinNoFlyZone(route.getUavRouteReq().getRoutePointList());
// 1.2通过minio获取航线信息
// 2.将航线信息转换成对应实体类
WayLineUploadDTO wayLineUploadDTO = buildWayLineUploadDTO(route);
--
Gitblit v1.9.3