Xiajijian
2025-12-28 057e3d582707acd2baea12e3bd6a96bf26d93fd7
ard-route/src/main/java/com/ard/route/service/impl/ArdRouteInfoServiceImpl.java
@@ -81,8 +81,10 @@
    public ArdRouteInfo selectArdRouteInfoById(String id) {
        ArdRouteInfo ardRouteInfo = ardRouteInfoMapper.selectArdRouteInfoById(id);
        try {
            if (ardRouteInfo.getRouteData() != null){
                ardRouteInfo.setUavRouteReq((UavRouteReq) deserialize(ardRouteInfo.getRouteData()));
            if (ardRouteInfo != null) {
                if (ardRouteInfo.getRouteData() != null){
                    ardRouteInfo.setUavRouteReq((UavRouteReq) deserialize(ardRouteInfo.getRouteData()));
                }
            }
        } catch (IOException | ClassNotFoundException e) {
            throw new RuntimeException(e);
@@ -97,6 +99,12 @@
                // 调整每个航点高度
                adjustRoutePointHeight(routePointReq, altitudeOffset);
            }
        }else {
            // 如果没有设置参考起飞点,将第一个航点设置为参考起飞点。
            ardRouteInfo.getUavRouteReq().setTakeOffRefPoint(
                    ardRouteInfo.getUavRouteReq().getRoutePointList().get(0).getLatitude().toString() +"," +
                    ardRouteInfo.getUavRouteReq().getRoutePointList().get(0).getLongitude().toString()+","+
                    ardRouteInfo.getUavRouteReq().getRoutePointList().get(0).getHeight().toString());
        }
        return ardRouteInfo;
@@ -173,6 +181,7 @@
            // 先删除航线
            delOssService(route);
            // 再生成航线
            ardRouteInfo.getUavRouteReq().setDroneType(subStringDroneType(ardRouteInfo.getAircraft()));
            kmzResult = routeService.buildKmz(ardRouteInfo.getUavRouteReq(), ardRouteInfo.getName());
            if ("更新航线kmz文件失败".equals(kmzResult.getData())) {
                return 0;
@@ -407,7 +416,7 @@
    public Boolean routeBegins(String id,String boxSn) {
        ArdRouteInfo route = ardRouteInfoMapper.selectArdRouteInfoById(id);
        // 判断是否循环航线
        if ("1".equals(route.getIsLoop())) {
        if ("0".equals(route.getIsLoop())) {
            deleteArdRouteInfoById(id);
        }
        WayLineBeginDTO wayLineBeginDTO = new WayLineBeginDTO(boxSn);