puzhibing
2026-03-20 50a775f2964dbc728cbb043b93714d82fc2b6d37
修改计算剩余轨迹导航逻辑
1个文件已删除
11个文件已修改
408 ■■■■■ 已修改文件
sql/增量sql/xprt_maintenance.sql 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/增量sql/xprt_operation.sql 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/order/XpOrderClientFallbackFactory.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/order/XpOrderClient.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/utils/XpPricingUtil.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/XpPricingUtil.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpOrderController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/job/jobs/EndTripJob.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/GeodesyUtil.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/MapMatchingUtil.java 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/增量sql/xprt_maintenance.sql
@@ -1,119 +0,0 @@
ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`;
ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`;
ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`;
ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`;
ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`;
ALTER TABLE `xp_vehicle_detection_0` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`;
ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`;
ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`;
ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`;
ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`;
ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`;
ALTER TABLE `xp_vehicle_detection_1` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`;
ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`;
ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`;
ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`;
ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`;
ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`;
ALTER TABLE `xp_vehicle_detection_2` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`;
ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`;
ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`;
ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`;
ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`;
ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`;
ALTER TABLE `xp_vehicle_detection_3` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`;
ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`;
ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`;
ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`;
ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`;
ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`;
ALTER TABLE `xp_vehicle_detection_4` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`;
ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`;
ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`;
ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`;
ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`;
ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`;
ALTER TABLE `xp_vehicle_detection_5` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`;
ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`;
ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`;
ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`;
ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`;
ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`;
ALTER TABLE `xp_vehicle_detection_6` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`;
ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`;
ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`;
ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`;
ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`;
ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`;
ALTER TABLE `xp_vehicle_detection_7` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`;
ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`;
ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`;
ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`;
ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`;
ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`;
ALTER TABLE `xp_vehicle_detection_8` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`;
ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `network_detection` int NULL DEFAULT NULL COMMENT '网络检测' AFTER `vehicle_id`;
ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `version_verification` int NULL DEFAULT NULL COMMENT '版本核对' AFTER `network_detection`;
ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `communication_self_check` int NULL DEFAULT NULL COMMENT '通讯自检' AFTER `version_verification`;
ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `remote_self_check` int NULL DEFAULT NULL COMMENT '远程自检' AFTER `communication_self_check`;
ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `collision_prevention` int NULL DEFAULT NULL COMMENT '防撞激活' AFTER `remote_self_check`;
ALTER TABLE `xp_vehicle_detection_9` MODIFY COLUMN `sensor_self_check` int NULL DEFAULT NULL COMMENT '传感器自检' AFTER `collision_prevention`;
sql/增量sql/xprt_operation.sql
@@ -0,0 +1,19 @@
ALTER TABLE `xp_point_0` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`;
ALTER TABLE `xp_point_1` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`;
ALTER TABLE `xp_point_2` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`;
ALTER TABLE `xp_point_3` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`;
ALTER TABLE `xp_point_4` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`;
ALTER TABLE `xp_point_5` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`;
ALTER TABLE `xp_point_6` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`;
ALTER TABLE `xp_point_7` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`;
ALTER TABLE `xp_point_8` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`;
ALTER TABLE `xp_point_9` MODIFY COLUMN `point_pictures` json NULL COMMENT '点位照片' AFTER `remarks`;
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/order/XpOrderClientFallbackFactory.java
@@ -102,12 +102,6 @@
                log.error("保存订单轨迹数据失败,原因: {}", cause.getMessage());
                return R.fail("保存订单轨迹数据失败");
            }
            @Override
            public R<?> endTrip(Long orderId) {
                log.error("内部调用-结束订单失败,原因: {}", cause.getMessage());
                return R.fail("内部调用-结束订单失败:" + cause.getMessage());
            }
        };
    }
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/order/XpOrderClient.java
@@ -122,12 +122,4 @@
    /**
     * 内部调用-结束订单
     * @param orderId
     * @return
     */
    @PostMapping("/inner/order/endTrip")
    R<?> endTrip(@RequestParam Long orderId);
}
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -846,11 +846,12 @@
                    }
                    break;
                case ORDER_DROPOFF_COMPLETED:
                    //下车完成
                    if(!orderId.contains("XU")){
                        buildPushOrderStatus(orderId, OrderStatusEnum.APPROVAL_REJECTION, sequence);
                        xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.APPROVAL_REJECTION.getCode());
                    }
                    //下车完成,不需要处理状态,由后续的乘客主动触发或者定时任务触发
                    log.info("乘客已下车,不做任何处理:{}", orderId);
//                    if(!orderId.contains("XU")){
//                        buildPushOrderStatus(orderId, OrderStatusEnum.APPROVAL_REJECTION, sequence);
//                        xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.APPROVAL_REJECTION.getCode());
//                    }
                    break;
                case ORDER_COMPLETED:
                    //已完成
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/utils/XpPricingUtil.java
@@ -1,6 +1,7 @@
package com.xiaopeng.itinerary.utils;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.xiaopeng.api.dto.order.GetOrderNumDto;
@@ -43,7 +44,7 @@
     */
    public static Integer getStartMileage(String startingFareJsonStr) {
        Date date = new Date();
        JSONArray startingFareJson = JSONObject.parseArray(startingFareJsonStr);
        JSONArray startingFareJson = JSON.parseArray(startingFareJsonStr);
        for (Object o : startingFareJson) {
            JSONObject startingFare = (JSONObject) o;
            Calendar calendarStart = Calendar.getInstance();
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/XpPricingUtil.java
@@ -1,5 +1,6 @@
package com.xiaopeng.operation.utils;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.xiaopeng.api.dto.order.GetOrderNumDto;
@@ -41,7 +42,7 @@
     */
    public static Integer getStartMileage(String startingFareJsonStr) {
        Date date = new Date();
        JSONArray startingFareJson = JSONObject.parseArray(startingFareJsonStr);
        JSONArray startingFareJson = JSON.parseArray(startingFareJsonStr);
        for (Object o : startingFareJson) {
            JSONObject startingFare = (JSONObject) o;
            Calendar calendarStart = Calendar.getInstance();
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpOrderController.java
@@ -4,12 +4,14 @@
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xiaopeng.api.dto.QueryOrderRouteDTO;
import com.xiaopeng.api.dto.operation.LonLatDto;
import com.xiaopeng.api.dto.order.AddCruiseMissionDto;
import com.xiaopeng.api.dto.order.GetOrderNumDto;
import com.xiaopeng.api.dto.order.PopOrderDto;
import com.xiaopeng.api.dto.pushMessage.SendMessageDTO;
import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO;
import com.xiaopeng.api.dto.statistics.StatisticsQueryDTO;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
@@ -20,6 +22,8 @@
import com.xiaopeng.api.vo.order.*;
import com.xiaopeng.common.core.constant.CacheConstants;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.enums.OrderStatusEnum;
import com.xiaopeng.common.core.enums.PushMessageTypeEnum;
import com.xiaopeng.common.core.utils.WebUtils;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.common.redis.service.RedisService;
@@ -59,9 +63,7 @@
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.*;
import static org.bouncycastle.asn1.x500.style.RFC4519Style.uid;
@@ -429,18 +431,6 @@
        }
    }
    /**
     * 内部调用-结束订单
     * @param orderId
     * @return
     */
    @PostMapping("/inner/order/endTrip")
    public R<?> endTrip(@RequestParam Long orderId){
        XpOrder xpOrder = xpOrderService.getById(orderId);
        Boolean b = xpOrderService.endTrip(orderId, xpOrder.getAppUserId().toString());
        return R.ok(b);
    }
    /**
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/job/jobs/EndTripJob.java
@@ -1,15 +1,23 @@
package com.xiaopeng.order.job.jobs;
import com.alibaba.fastjson2.JSONObject;
import com.xiaopeng.api.dto.pushMessage.SendMessageDTO;
import com.xiaopeng.api.model.order.XpOrder;
import com.xiaopeng.api.model.order.XpOrderTimeoutLog;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import com.xiaopeng.api.vo.vehicleConvoy.CancelTaxiPassengerVo;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.enums.OrderStatusEnum;
import com.xiaopeng.common.core.enums.PushMessageTypeEnum;
import com.xiaopeng.order.job.base.AbstractJob;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
 * 推送定时任务
@@ -31,6 +39,19 @@
            XpOrder xpOrder = xpOrderService.getById(orderId);
            if(xpOrder.getStatus() == 7){
                xpOrderService.endTrip(xpOrder.getId(), String.valueOf(xpOrder.getAppUserId()));
                // 消息推送
                Map<String, Object> params = new HashMap<>();
                Map<String, Object> content = new HashMap<>();
                content.put("orderId", xpOrder.getId().toString());
                content.put("status", OrderStatusEnum.APPROVAL_REJECTION.getCode());
                params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc());
                params.put("content", com.alibaba.fastjson2.JSONObject.toJSONString(content));
                params.put("timestamp", new Date().getTime() + "");
                String message = JSONObject.toJSONString(params);
                SendMessageDTO sendMessageDTO = new SendMessageDTO();
                sendMessageDTO.setMessage(message);
                sendMessageDTO.setAppUserId(String.valueOf(xpOrder.getAppUserId()));
                xpPushMessageClient.sendStatus(sendMessageDTO);
            }
            log.info("结束执行自动结束行程任务");
            // 添加超时记录
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -716,7 +716,8 @@
        this.lambdaUpdate().set(XpOrder::getStatus, 7)
                .eq(XpOrder::getId, order.getId()).update();
        //结束行程
        endTrip(order.getId(), order.getAppUserId().toString());
        // 消息推送
        Map<String, Object> params = new HashMap<>();
        Map<String, Object> content = new HashMap<>();
@@ -730,8 +731,6 @@
        sendMessageDTO.setMessage(message);
        sendMessageDTO.setAppUserId(String.valueOf(order.getAppUserId()));
        xpPushMessageClient.sendStatus(sendMessageDTO);
        //结束行程
        endTrip(order.getId(), order.getAppUserId().toString());
        log.info("运营人员取消订单成功,推送乘客消息完成");
        log.info("订单关闭成功,订单ID: {}, 操作人: {}", order.getId(), SecurityUtils.getUsername());
    }
@@ -1488,7 +1487,6 @@
        // 远途费价格明细
        List<FareBreakdownDetailVo> longDistance = new ArrayList<>();
        XpOrder order = this.getById(orderId);
        if (order == null) {
            throw new RuntimeException("订单不存在");
        }
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/GeodesyUtil.java
File was deleted
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/MapMatchingUtil.java
@@ -1,5 +1,8 @@
package com.xiaopeng.pushMessage.utils;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.xiaopeng.api.dto.operation.LonLatDto;
import lombok.extern.slf4j.Slf4j;
import org.gavaghan.geodesy.Ellipsoid;
@@ -81,18 +84,124 @@
            if((distance1 + distance2) == distance3 || (distance1 + distance2) <= distance3 + 5){
                //取距离最近的点位数据
                if(distance1 < distance2){
                    return polyline.subList(i, polyline.size() - 1);
                    return polyline.subList(i, polyline.size());
                }
                return polyline.subList(i + 1, polyline.size() - 1);
                return polyline.subList(i + 1, polyline.size());
            }
        }
        return Collections.emptyList();
        polyline.add(0, new LonLatDto(longitude, latitude));
        return polyline;
    }
    public static void main(String[] args) {
        JSONArray objects = JSON.parseArray("[{\n" +
                "\t\t\"latitude\": 30.58549,\n" +
                "\t\t\"longitude\": 104.054501\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.585938,\n" +
                "\t\t\"longitude\": 104.054501\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.586522,\n" +
                "\t\t\"longitude\": 104.054501\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.587026,\n" +
                "\t\t\"longitude\": 104.054507\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.587922,\n" +
                "\t\t\"longitude\": 104.054518\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.588062,\n" +
                "\t\t\"longitude\": 104.054518\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.588292,\n" +
                "\t\t\"longitude\": 104.054528\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.588292,\n" +
                "\t\t\"longitude\": 104.0544\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.588292,\n" +
                "\t\t\"longitude\": 104.0544\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.587949,\n" +
                "\t\t\"longitude\": 104.054384\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.587311,\n" +
                "\t\t\"longitude\": 104.054389\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.587118,\n" +
                "\t\t\"longitude\": 104.054394\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.586704,\n" +
                "\t\t\"longitude\": 104.054394\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.586125,\n" +
                "\t\t\"longitude\": 104.0544\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.585938,\n" +
                "\t\t\"longitude\": 104.054405\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.585476,\n" +
                "\t\t\"longitude\": 104.054405\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.584693,\n" +
                "\t\t\"longitude\": 104.054405\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.584403,\n" +
                "\t\t\"longitude\": 104.054416\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.584312,\n" +
                "\t\t\"longitude\": 104.054416\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.583593,\n" +
                "\t\t\"longitude\": 104.054416\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.583486,\n" +
                "\t\t\"longitude\": 104.054416\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.583116,\n" +
                "\t\t\"longitude\": 104.054421\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.582391,\n" +
                "\t\t\"longitude\": 104.054426\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.582397,\n" +
                "\t\t\"longitude\": 104.054577\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.582397,\n" +
                "\t\t\"longitude\": 104.054577\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.582815,\n" +
                "\t\t\"longitude\": 104.054561\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.58311,\n" +
                "\t\t\"longitude\": 104.05455\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.58311,\n" +
                "\t\t\"longitude\": 104.05455\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.58311,\n" +
                "\t\t\"longitude\": 104.054899\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.583143,\n" +
                "\t\t\"longitude\": 104.054931\n" +
                "\t}, {\n" +
                "\t\t\"latitude\": 30.583148,\n" +
                "\t\t\"longitude\": 104.054973\n" +
                "\t}]");
        List<LonLatDto> lonLatDtoList = new ArrayList<>();
        for (int i = 0; i < objects.size(); i++) {
            JSONObject object = objects.getJSONObject(i);
            LonLatDto lonLatDto = new LonLatDto(object.getDouble("longitude"), object.getDouble("latitude"));
            lonLatDtoList.add(lonLatDto);
        }
        for (int i = 0; i < 20; i++) {
            List<LonLatDto> remainingNavigation = getRemainingNavigation(lonLatDtoList, 104.054503, 30.58549);
            lonLatDtoList = remainingNavigation;
        }
    }
    /**