zhaowenyu
2025-12-18 b3b96cfd900c3dee5dc84e53d5677fc6642f85e6
Merge remote-tracking branch 'origin/dev' into dev
2 files modified
41 ■■■■■ changed files
ard-route/src/main/java/com/ard/route/service/impl/ArdRouteInfoServiceImpl.java 40 ●●●●● patch | view | raw | blame | history
ard-route/src/main/java/com/ard/route/util/InitializationUtils.java 1 ●●●●● patch | view | raw | blame | history
ard-route/src/main/java/com/ard/route/service/impl/ArdRouteInfoServiceImpl.java
@@ -31,7 +31,6 @@
import com.ard.work.service.ITyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@@ -89,19 +88,10 @@
        // 主逻辑优化
        double altitudeOffset = getDoublePoint(ardRouteInfo.getUavRouteReq().getTakeOffRefPoint(), "alt");
        boolean isM350RTK = M350_RTK.getValue().equals(ardRouteInfo.getUavRouteReq().getDroneType());
        for (RoutePointReq routePointReq : ardRouteInfo.getUavRouteReq().getRoutePointList()) {
            // 调整航点高度
            adjustRoutePointHeight(routePointReq, altitudeOffset);
            // 如果是M350_RTK无人机,处理变焦动作
//            if (isM350RTK && routePointReq.getActionGroupList() != null) {
//                for (ActionGroupReq actionGroupReq : routePointReq.getActionGroupList()) {
//                    if (actionGroupReq != null && actionGroupReq.getActions() != null) {
//                        processZoomActions(actionGroupReq);
//                    }
//                }
//            }
        }
        return ardRouteInfo;
    }
@@ -109,15 +99,6 @@
    // 提取航点高度调整逻辑到方法中
    private void adjustRoutePointHeight(RoutePointReq routePointReq, double altitudeOffset) {
        routePointReq.setHeight(routePointReq.getHeight() + altitudeOffset);
    }
    // 提取变焦值处理逻辑到方法中
    private void processZoomActions(ActionGroupReq actionGroupReq) {
        for (PointActionReq action : actionGroupReq.getActions()) {
            if (action != null && action.getZoom() != null) {
                action.setZoom(divided_23(action.getZoom()));
            }
        }
    }
    /**
@@ -150,16 +131,16 @@
        if (ardRouteInfo.getGroupId() == null){
            ardRouteInfo.setGroupId("0");
        }
        UavRouteReq uavRouteReq = new UavRouteReq();
        BeanUtils.copyProperties(ardRouteInfo.getUavRouteReq(), uavRouteReq);
        ardRouteInfo.getUavRouteReq().setDroneType(subStringDroneType(ardRouteInfo.getAircraft()));
        KmzResultVo kmzResult = routeService.buildKmz(uavRouteReq,ardRouteInfo.getName());
        if (M350_RTK.getValue().equals(uavRouteReq.getDroneType())) {
        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()));
                        }
                    }
                }
            }
@@ -273,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);
@@ -376,6 +346,8 @@
        } catch (IOException | ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
        // 判断禁飞区
        arrayWithinNoFlyZone(route.getUavRouteReq().getRoutePointList());
        // 1.2通过minio获取航线信息
        // 2.将航线信息转换成对应实体类
        WayLineUploadDTO wayLineUploadDTO = buildWayLineUploadDTO(route);
ard-route/src/main/java/com/ard/route/util/InitializationUtils.java
@@ -106,7 +106,6 @@
                    for (PointActionReq action : actionGroupReq.getActions()) {
                        if (action.getZoom() != null){
                            action.setZoom(multiple_23(action.getZoom()));
                            //action.setZoom(multiple_6(action.getZoom()));
                        }
                    }
                }