liujie
2026-03-20 100f2d185dd0dabcfb2e7a0cd81aef840324238d
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi
16个文件已修改
476 ■■■■■ 已修改文件
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/operation/PointAddDto.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/operation/PointUpdateDto.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpPoint.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/query/operation/PointListQuery.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/schedule/RoutineTaskNotificationScheduleTask.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpPointManagementController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpSystemSettingServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/TaskOrderUtil.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/resources/mapper/operation/XpPointMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/job/jobs/EndTripJob.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java 179 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/controller/PushOrderRouteController.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/MapMatchingUtil.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/service/impl/XpVehicleServiceImpl.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/operation/PointAddDto.java
@@ -71,4 +71,23 @@
    @ApiModelProperty(value = "纬度")
    @NotNull(message = "纬度不能为空")
    private Double pointLat;
    @ApiModelProperty(value = "省份名称")
    private String provinceName;
    @ApiModelProperty(value = "省份code")
    private String provinceCode;
    @ApiModelProperty(value = "城市名称")
    private String cityName;
    @ApiModelProperty(value = "城市code")
    private String cityCode;
    @ApiModelProperty(value = "区县名称")
    private String districtName;
    @ApiModelProperty(value = "区县code")
    private String districtCode;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/operation/PointUpdateDto.java
@@ -71,4 +71,23 @@
    @ApiModelProperty(value = "纬度")
    @NotNull(message = "纬度不能为空")
    private Double pointLat;
    @ApiModelProperty(value = "省份名称")
    private String provinceName;
    @ApiModelProperty(value = "省份code")
    private String provinceCode;
    @ApiModelProperty(value = "城市名称")
    private String cityName;
    @ApiModelProperty(value = "城市code")
    private String cityCode;
    @ApiModelProperty(value = "区县名称")
    private String districtName;
    @ApiModelProperty(value = "区县code")
    private String districtCode;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpPoint.java
@@ -95,4 +95,29 @@
    @ApiModelProperty(value = "0否 1是收车点位")
    @TableField("parking_point")
    private Integer parkingPoint;
    @ApiModelProperty(value = "省份名称")
    @TableField("province_name")
    private String provinceName;
    @ApiModelProperty(value = "省份code")
    @TableField("province_code")
    private String provinceCode;
    @ApiModelProperty(value = "城市名称")
    @TableField("city_name")
    private String cityName;
    @ApiModelProperty(value = "城市code")
    @TableField("city_code")
    private String cityCode;
    @ApiModelProperty(value = "区县名称")
    @TableField("district_name")
    private String districtName;
    @ApiModelProperty(value = "区县code")
    @TableField("district_code")
    private String districtCode;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/query/operation/PointListQuery.java
@@ -19,6 +19,9 @@
    @ApiModelProperty(value = "点位类型1运营点位 2测试点位")
    private Integer pointType;
    @ApiModelProperty(value = "城市code")
    private String cityCode;
    @ApiModelProperty(value = "点位状态(多选) 1待测试 2测试中 3测试不通过 4可运营 5待生效 6启用中 7已停用 8已失效")
    private List<Integer> operationStatusList;
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -31,9 +31,11 @@
import com.xiaopeng.api.vo.automaticPilot.VehiclePosition;
import com.xiaopeng.api.vo.automaticPilot.protobuf.*;
import com.xiaopeng.api.vo.operation.RouteVo;
import com.xiaopeng.api.vo.order.OrderTrajectoryVo;
import com.xiaopeng.api.vo.vehicleConvoy.CancelTaxiPassengerVo;
import com.xiaopeng.automaticPilot.util.XPUUtil;
import com.xiaopeng.common.core.constant.CacheConstants;
import com.xiaopeng.common.core.constant.Constants;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.enums.OrderStatusEnum;
import com.xiaopeng.common.core.enums.PushMessageTypeEnum;
@@ -53,6 +55,8 @@
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@@ -363,6 +367,16 @@
//            dto.setDistance(rtTripInfo.getRemaining_distance().intValue());
//            dto.setDirection();
                xpPushMessageClient.pushOrderRoute(dto);
                //存储历史轨迹
                OrderTrajectoryVo orderTrajectory = new OrderTrajectoryVo();
                orderTrajectory.setOrderId(orderId);
                orderTrajectory.setLocation(longitude + "," + latitude);
                orderTrajectory.setDirection(dto.getDirection());
                orderTrajectory.setSpeed(0D);
                orderTrajectory.setLocatetime(System.currentTimeMillis());
                orderTrajectory.setCreateTime(new Date());
                xpOrderClient.saveVehicleLocation(orderTrajectory);
            }
        }
    }
@@ -960,8 +974,24 @@
            dto.setAppUserId(appUserId + "");
            dto.setMessage(message);
            R<String> stringR = xpPushMessageClient.sendStatus(dto);
            if (R.isError(stringR)) {
                log.error("推送消息失败:{}", stringR.getMsg());
            //推送失败,重试3次
            if(stringR.getCode() != Constants.SUCCESS){
                ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
                executor.execute(() -> {
                    for (int i = 0; i < 3; i++) {
                        R<String> stringR1 = xpPushMessageClient.sendStatus(dto);
                        if(stringR1.getCode() == Constants.SUCCESS){
                            break;
                        }
                        try {
                            Thread.sleep(1000);
                        } catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
                        log.info("推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(dto), xpOrder.getOrderNumber());
                    }
                });
            }
        }
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/schedule/RoutineTaskNotificationScheduleTask.java
@@ -81,13 +81,13 @@
                return;
            }
            Map<Long, Integer> userTaskCountMap = buildUserTaskCountMap(tasks);
            if (userTaskCountMap.isEmpty()) {
            Map<Long, List<Long>> userTaskIdsMap = buildUserTaskIdsMap(tasks);
            if (userTaskIdsMap.isEmpty()) {
                log.warn("任务接收人为空,跳过通知");
                return;
            }
            Set<Long> allUserIds = userTaskCountMap.keySet();
            Set<Long> allUserIds = userTaskIdsMap.keySet();
            Map<Long, XpOperationsUser> userMap = fetchOperationUsers(allUserIds);
            if (CollectionUtils.isEmpty(userMap)) {
@@ -98,10 +98,11 @@
            List<XpOperationsUserNotification> notifications = new ArrayList<>();
            int pushCount = 0;
            for (Map.Entry<Long, Integer> entry : userTaskCountMap.entrySet()) {
            for (Map.Entry<Long, List<Long>> entry : userTaskIdsMap.entrySet()) {
                Long userId = entry.getKey();
                Integer taskCount = entry.getValue();
                if (taskCount == null || taskCount <= 0) {
                List<Long> taskIds = entry.getValue();
                int taskCount = taskIds == null ? 0 : taskIds.size();
                if (taskCount <= 0) {
                    continue;
                }
@@ -110,6 +111,9 @@
                    continue;
                }
                // 只有一个待完成任务时 dataId 赋值为该任务 ID,多个则赋值为 0
                long dataId = taskCount == 1 ? taskIds.get(0) : 0L;
                String content = buildContent(taskCount);
                String bodyJson = buildPushBodyJson(content);
@@ -117,7 +121,7 @@
                notification.setNotificationType(NotificationTypeEnum.TASK_NEW.getCode());
                notification.setNotificationContent(content);
                notification.setOperationsUserId(userId);
                notification.setDataId(0L);
                notification.setDataId(dataId);
                notification.setReadStatus(0);
                notification.setNotificationExt(bodyJson);
                notifications.add(notification);
@@ -148,19 +152,20 @@
    }
    /**
     * 构建用户待办数量映射
     * 构建用户待办任务 ID 列表映射
     * key: 运维人员 ID,value: 该用户名下的待办任务 ID 列表
     */
    private Map<Long, Integer> buildUserTaskCountMap(List<XpTask> tasks) {
        Map<Long, Integer> userTaskCountMap = new HashMap<>();
    private Map<Long, List<Long>> buildUserTaskIdsMap(List<XpTask> tasks) {
        Map<Long, List<Long>> userTaskIdsMap = new HashMap<>();
        for (XpTask task : tasks) {
            Set<Long> userIds = parseUserIds(task.getHandleUserId());
            if (!CollectionUtils.isEmpty(userIds)) {
                for (Long userId : userIds) {
                    userTaskCountMap.put(userId, userTaskCountMap.getOrDefault(userId, 0) + 1);
                    userTaskIdsMap.computeIfAbsent(userId, k -> new ArrayList<>()).add(task.getId());
                }
            }
        }
        return userTaskCountMap;
        return userTaskIdsMap;
    }
    /**
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpSchedulingDetailServiceImpl.java
@@ -536,6 +536,7 @@
        operationsUserNotification.setOperationsUserId(xpOperationsUser.getId());
        operationsUserNotification.setReadStatus(0);
        operationsUserNotification.setNotificationExt(body);
        operationsUserNotification.setDataId(0L);
        return operationsUserNotification;
    }
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpPointManagementController.java
@@ -250,6 +250,12 @@
                .set(XpPoint::getElectronicAreaId, xpPoint.getElectronicAreaId())
                .set(XpPoint::getChargePoint, xpPoint.getChargePoint())
                .set(XpPoint::getParkingPoint, xpPoint.getParkingPoint())
                .set(XpPoint::getProvinceName, xpPoint.getProvinceName())
                .set(XpPoint::getProvinceCode, xpPoint.getProvinceCode())
                .set(XpPoint::getCityCode, xpPoint.getCityCode())
                .set(XpPoint::getCityName, xpPoint.getCityName())
                .set(XpPoint::getDistrictName, xpPoint.getDistrictName())
                .set(XpPoint::getDistrictCode, xpPoint.getDistrictCode())
                .update();
        return R.ok();
    }
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpSystemSettingServiceImpl.java
@@ -57,9 +57,20 @@
    @Override
    public void saveSystemSetting(XpSystemSetting xpSystemSetting) {
        if (Objects.nonNull(xpSystemSetting.getId())) {
            update(xpSystemSetting, new LambdaQueryWrapper<XpSystemSetting>().eq(XpSystemSetting::getId, xpSystemSetting.getId()));
        } else {
        XpSystemSetting existSetting = lambdaQuery().last("limit 1").one();
        if (Objects.nonNull(existSetting)) {
            lambdaUpdate().eq(XpSystemSetting::getId, existSetting.getId())
                    .set(XpSystemSetting::getCustomerServicePhone, xpSystemSetting.getCustomerServicePhone())
                    .set(XpSystemSetting::getOrderDistance, xpSystemSetting.getOrderDistance())
                    .set(XpSystemSetting::getMinOrderDistance, xpSystemSetting.getMinOrderDistance())
                    .set(XpSystemSetting::getArriveTime, xpSystemSetting.getArriveTime())
                    .set(XpSystemSetting::getHeadShowCount, xpSystemSetting.getHeadShowCount())
                    .set(XpSystemSetting::getNearPointDistance, xpSystemSetting.getNearPointDistance())
                    .set(XpSystemSetting::getAdsorptionDistance, xpSystemSetting.getAdsorptionDistance())
                    .set(XpSystemSetting::getHotfixStatus, xpSystemSetting.getHotfixStatus())
                    .set(XpSystemSetting::getHotfixStartTime, xpSystemSetting.getHotfixStartTime())
                    .set(XpSystemSetting::getHotfixEndTime, xpSystemSetting.getHotfixEndTime()).update();
        }else {
            save(xpSystemSetting);
        }
        //保存热修复信息到redis
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/TaskOrderUtil.java
@@ -25,6 +25,7 @@
import com.xiaopeng.api.vo.operation.VehiclePositionVo;
import com.xiaopeng.api.vo.vehicleConvoy.AddTaxiPassengerVo;
import com.xiaopeng.common.core.constant.CacheConstants;
import com.xiaopeng.common.core.constant.Constants;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.redis.service.RedisService;
import com.xiaopeng.operation.mapper.XpElectronicFenceMapper;
@@ -43,6 +44,8 @@
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -218,7 +221,25 @@
                SendMessageDTO dto = new SendMessageDTO();
                dto.setAppUserId(xpOrder.getAppUserId().toString());
                dto.setMessage("{\"type\":\"ORDER_STATUS\",\"content\":\"{\\\"orderId\\\":\\\"" + orderId + "\\\",\\\"status\\\":0}\",\"timestamp\":\"" + System.currentTimeMillis() + "\"}");
                xpPushMessageClient.sendStatus(dto);
                R<String> stringR = xpPushMessageClient.sendStatus(dto);
                //推送失败,重试3次
                if(stringR.getCode() != Constants.SUCCESS){
                    ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
                    executor.execute(() -> {
                        for (int i = 0; i < 3; i++) {
                            R<String> stringR1 = xpPushMessageClient.sendStatus(dto);
                            if(stringR1.getCode() == Constants.SUCCESS){
                                break;
                            }
                            try {
                                Thread.sleep(1000);
                            } catch (InterruptedException e) {
                                throw new RuntimeException(e);
                            }
                            log.info("五轮推单结束后,无车辆接单,推送取消消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(dto), xpOrder.getOrderNumber());
                        }
                    });
                }
                //将订单从队列中移除
                log.info("五轮推单结束,无车辆接单,执行队列移除订单 {}", orderNo);
                redisService.popFirstElement(quoteName);
xp-robotaxi-operation-boot/src/main/resources/mapper/operation/XpPointMapper.xml
@@ -80,6 +80,9 @@
        <if test="query.pointType != null">
            and t1.point_type = #{query.pointType}
        </if>
        <if test="query.cityCode != null and query.cityCode != ''">
            and t1.city_code = #{query.cityCode}
        </if>
        <if test="query.operationStatusIds != null and query.operationStatusIds.size()>0">
            AND t1.operation_status IN
            <foreach collection="query.operationStatusIds" separator="," item="id" open="(" close=")">
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/job/jobs/EndTripJob.java
@@ -1,11 +1,13 @@
package com.xiaopeng.order.job.jobs;
import com.alibaba.fastjson2.JSON;
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.constant.Constants;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.enums.OrderStatusEnum;
import com.xiaopeng.common.core.enums.PushMessageTypeEnum;
@@ -18,6 +20,9 @@
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
 * 推送定时任务
@@ -51,7 +56,25 @@
                SendMessageDTO sendMessageDTO = new SendMessageDTO();
                sendMessageDTO.setMessage(message);
                sendMessageDTO.setAppUserId(String.valueOf(xpOrder.getAppUserId()));
                xpPushMessageClient.sendStatus(sendMessageDTO);
                R<String> stringR = xpPushMessageClient.sendStatus(sendMessageDTO);
                //推送失败,重试3次
                if(stringR.getCode() != Constants.SUCCESS){
                    ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
                    executor.execute(() -> {
                        for (int i = 0; i < 3; i++) {
                            R<String> stringR1 = xpPushMessageClient.sendStatus(sendMessageDTO);
                            if(stringR1.getCode() == Constants.SUCCESS){
                                break;
                            }
                            try {
                                Thread.sleep(1000);
                            } catch (InterruptedException e) {
                                throw new RuntimeException(e);
                            }
                            log.info("定时任务结束订单后,退订订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber());
                        }
                    });
                }
            }
            log.info("结束执行自动结束行程任务");
            // 添加超时记录
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -54,6 +54,7 @@
import com.xiaopeng.api.vo.vehicleConvoy.AddTaxiPassengerVo;
import com.xiaopeng.api.vo.vehicleConvoy.CancelTaxiPassengerVo;
import com.xiaopeng.common.core.constant.CacheConstants;
import com.xiaopeng.common.core.constant.Constants;
import com.xiaopeng.common.core.constant.HttpStatus;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.enums.OrderStatusEnum;
@@ -114,6 +115,8 @@
import java.text.SimpleDateFormat;
import java.time.*;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -641,7 +644,27 @@
            SendMessageDTO sendMessageDTO = new SendMessageDTO();
            sendMessageDTO.setMessage(message);
            sendMessageDTO.setAppUserId(String.valueOf(userId));
            xpPushMessageClient.sendStatus(sendMessageDTO);
            R<String> stringR = xpPushMessageClient.sendStatus(sendMessageDTO);
            //推送失败,重试3次
            if(stringR.getCode() != Constants.SUCCESS){
                ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
                executor.execute(() -> {
                    for (int i = 0; i < 3; i++) {
                        R<String> stringR1 = xpPushMessageClient.sendStatus(sendMessageDTO);
                        if(stringR1.getCode() == Constants.SUCCESS){
                            break;
                        }
                        try {
                            Thread.sleep(1000);
                        } catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
                        log.info("运维人员取消订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber());
                    }
                });
            }
            return;
        }
        // 1. 更新订单状态为已取消(0)
@@ -667,7 +690,25 @@
        SendMessageDTO sendMessageDTO = new SendMessageDTO();
        sendMessageDTO.setMessage(message);
        sendMessageDTO.setAppUserId(String.valueOf(userId));
        xpPushMessageClient.sendStatus(sendMessageDTO);
        R<String> stringR = xpPushMessageClient.sendStatus(sendMessageDTO);
        //推送失败,重试3次
        if(stringR.getCode() != Constants.SUCCESS){
            ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
            executor.execute(() -> {
                for (int i = 0; i < 3; i++) {
                    R<String> stringR1 = xpPushMessageClient.sendStatus(sendMessageDTO);
                    if(stringR1.getCode() == Constants.SUCCESS){
                        break;
                    }
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                    log.info("运维人员取消订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber());
                }
            });
        }
        log.info("运营人员取消订单成功,推送乘客消息完成");
        //查询车辆信息
@@ -730,8 +771,25 @@
        SendMessageDTO sendMessageDTO = new SendMessageDTO();
        sendMessageDTO.setMessage(message);
        sendMessageDTO.setAppUserId(String.valueOf(order.getAppUserId()));
        xpPushMessageClient.sendStatus(sendMessageDTO);
        log.info("运营人员取消订单成功,推送乘客消息完成");
        R<String> stringR = xpPushMessageClient.sendStatus(sendMessageDTO);
        //推送失败,重试3次
        if(stringR.getCode() != Constants.SUCCESS){
            ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
            executor.execute(() -> {
                for (int i = 0; i < 3; i++) {
                    R<String> stringR1 = xpPushMessageClient.sendStatus(sendMessageDTO);
                    if(stringR1.getCode() == Constants.SUCCESS){
                        break;
                    }
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                    log.info("运维人员关闭订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber());
                }
            });
        }
        log.info("订单关闭成功,订单ID: {}, 操作人: {}", order.getId(), SecurityUtils.getUsername());
    }
@@ -1330,7 +1388,27 @@
        SendMessageDTO sendMessageDTO = new SendMessageDTO();
        sendMessageDTO.setMessage(message);
        sendMessageDTO.setAppUserId(String.valueOf(appUserId));
        xpPushMessageClient.sendStatus(sendMessageDTO);
        R<String> stringR = xpPushMessageClient.sendStatus(sendMessageDTO);
        //推送失败,重试3次
        if(stringR.getCode() != Constants.SUCCESS){
            ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
            executor.execute(() -> {
                for (int i = 0; i < 3; i++) {
                    R<String> stringR1 = xpPushMessageClient.sendStatus(sendMessageDTO);
                    if(stringR1.getCode() == Constants.SUCCESS){
                        break;
                    }
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                    log.info("定时任务取消订单推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber());
                }
            });
        }
        log.info("定时任务取消订单推送消息完毕");
        // 移除mongo数据
@@ -1425,6 +1503,39 @@
                xpOrder.setTripBegin(LocalDateTime.now());
                break;
            case 7:
                // 推送倒计时消息
                Map<String, Object> params = new HashMap<>();
                Map<String, Object> content = new HashMap<>();
                content.put("orderId", xpOrder.getId().toString());
                content.put("isOpen", 1);
                params.put("type", PushMessageTypeEnum.OPEN_TRUNK.getDesc());
                params.put("content", 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()));
                R<String> stringR = xpPushMessageClient.sendStatus(sendMessageDTO);
                //推送失败,重试3次
                if(stringR.getCode() != Constants.SUCCESS){
                    ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
                    executor.execute(() -> {
                        for (int i = 0; i < 3; i++) {
                            R<String> stringR1 = xpPushMessageClient.sendStatus(sendMessageDTO);
                            if(stringR1.getCode() == Constants.SUCCESS){
                                break;
                            }
                            try {
                                Thread.sleep(1000);
                            } catch (InterruptedException e) {
                                throw new RuntimeException(e);
                            }
                            log.info("推送倒计时消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber());
                        }
                    });
                }
                //创建定时结束订单和等待结束后下发巡游单的定时任务
                Integer arriveTime = xpSystemSettingClient.getOrderFinishTime().getData();
                // 添加自动结束行程定时任务job
                Map<String, ? extends Object> endTripJobMaps =
@@ -1454,19 +1565,6 @@
                        DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(point.getParkingTimeLimit())),
                        jobMaps
                );
                // 推送倒计时消息
                Map<String, Object> params = new HashMap<>();
                Map<String, Object> content = new HashMap<>();
                content.put("orderId", xpOrder.getId().toString());
                content.put("isOpen", 1);
                params.put("type", PushMessageTypeEnum.OPEN_TRUNK.getDesc());
                params.put("content", 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);
                break;
        }
        xpOrder.setStatus(status);
@@ -2433,6 +2531,9 @@
    public void saveVehicleLocation(OrderTrajectory orderTrajectory) {
        // 查询订单信息
        XpOrder xpOrder = this.getById(orderTrajectory.getOrderId());
        if(xpOrder.getStatus() != 6){
            return;
        }
        // 计算距离
        // 获取上一次定位
@@ -2715,8 +2816,26 @@
            SendMessageDTO messageDTO = new SendMessageDTO();
            messageDTO.setAppUserId(appUserId);
            messageDTO.setMessage(jsonObject.toJSONString());
            System.err.println(messageDTO);
            xpPushMessageClient.sendRoute(messageDTO);
            R<String> stringR = xpPushMessageClient.sendRoute(messageDTO);
            XpOrder xpOrder = this.getById(orderId);
            //推送失败,重试3次
            if(stringR.getCode() != Constants.SUCCESS){
                ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
                executor.execute(() -> {
                    for (int i = 0; i < 3; i++) {
                        R<String> stringR1 = xpPushMessageClient.sendStatus(messageDTO);
                        if(stringR1.getCode() == Constants.SUCCESS){
                            break;
                        }
                        try {
                            Thread.sleep(1000);
                        } catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
                        log.info("推送乘客端导航数据消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(messageDTO), xpOrder.getOrderNumber());
                    }
                });
            }
        }
    }
@@ -2819,7 +2938,25 @@
        SendMessageDTO sendMessageDTO = new SendMessageDTO();
        sendMessageDTO.setMessage(message);
        sendMessageDTO.setAppUserId(String.valueOf(appUserId));
        xpPushMessageClient.sendStatus(sendMessageDTO);
        R<String> stringR = xpPushMessageClient.sendStatus(sendMessageDTO);
        //推送失败,重试3次
        if(stringR.getCode() != Constants.SUCCESS){
            ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
            executor.execute(() -> {
                for (int i = 0; i < 3; i++) {
                    R<String> stringR1 = xpPushMessageClient.sendStatus(sendMessageDTO);
                    if(stringR1.getCode() == Constants.SUCCESS){
                        break;
                    }
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                    log.info("运维人员修改订单价格推送订单状态消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber());
                }
            });
        }
        log.info("订单修改价格推送消息完毕");
    }
}
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/controller/PushOrderRouteController.java
@@ -10,6 +10,7 @@
import com.xiaopeng.api.model.order.XpOrder;
import com.xiaopeng.api.vo.operation.RouteVo;
import com.xiaopeng.common.core.constant.CacheConstants;
import com.xiaopeng.common.core.constant.Constants;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.enums.PushMessageTypeEnum;
import com.xiaopeng.common.redis.service.RedisService;
@@ -25,6 +26,8 @@
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@Slf4j
@@ -108,7 +111,26 @@
            SendMessageDTO sendMessageDTO = new SendMessageDTO();
            sendMessageDTO.setAppUserId(String.valueOf(xpOrder.getAppUserId()));
            sendMessageDTO.setMessage(JSONObject.toJSONString(params));
            xpPushMessageClient.sendRoute(sendMessageDTO);
            R<String> stringR = xpPushMessageClient.sendRoute(sendMessageDTO);
            //推送失败,重试3次
            if(stringR.getCode() != Constants.SUCCESS){
                ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
                executor.execute(() -> {
                    for (int i = 0; i < 3; i++) {
                        R<String> stringR1 = xpPushMessageClient.sendStatus(sendMessageDTO);
                        if(stringR1.getCode() == Constants.SUCCESS){
                            break;
                        }
                        try {
                            Thread.sleep(1000);
                        } catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
                        log.info("推送乘客端剩余导航数据消息失败:{} {} {}", stringR1.getMsg(), JSON.toJSONString(sendMessageDTO), xpOrder.getOrderNumber());
                    }
                });
            }
            log.info("推送剩余导航数据成功 {} {}", xpOrder.getOrderNumber(), JSON.toJSONString(routeVo));
        }
        return R.ok();
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/MapMatchingUtil.java
@@ -82,11 +82,9 @@
            //判断当前位置是否处于两个点位之间
            if((distance1 + distance2) == distance3 || (distance1 + distance2) <= distance3 + 5){
                //取距离最近的点位数据
                if(distance1 < distance2){
                    return polyline.subList(i, polyline.size());
                }
                return polyline.subList(i + 1, polyline.size());
                List<LonLatDto> lonLatDtos = polyline.subList(i + 1, polyline.size());
                lonLatDtos.add(0, new LonLatDto(longitude, latitude));
                return lonLatDtos;
            }
        }
        polyline.add(0, new LonLatDto(longitude, latitude));
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/service/impl/XpVehicleServiceImpl.java
@@ -249,24 +249,23 @@
            throw new ServiceException("未查询到有效车辆信息", I18nKeyConstant.VEHICLE_NOT_EXISTS);
        }
        // 判断距离是否在范围之内 4米
//        List<Point> positionList = redisTemplate.opsForGeo().position("vehiclePosition:" + xpVehicle.getVehicleVin(), xpVehicle.getVehicleVin());
        VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class);
        if (Objects.nonNull(vehiclePosition)) {
            GeoJsonPoint point = vehiclePosition.getPoint();
            if(Objects.nonNull(point)){
                Map<String, Double> distance = GeodesyUtil.getDistance(dto.getLongitude()+ "," + dto.getLatitude(), point.getX()+","+point.getY());
                if (null != distance) {
                    Double distance1 = distance.get("WGS84");
                    if (distance1 > 4) {
                        throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG);
                    }
                }else {
                    throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG);
                }
            }else {
                throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG);
            }
        }
//        VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class);
//        if (Objects.nonNull(vehiclePosition)) {
//            GeoJsonPoint point = vehiclePosition.getPoint();
//            if(Objects.nonNull(point)){
//                Map<String, Double> distance = GeodesyUtil.getDistance(dto.getLongitude()+ "," + dto.getLatitude(), point.getX()+","+point.getY());
//                if (null != distance) {
//                    Double distance1 = distance.get("WGS84");
//                    if (distance1 > 4) {
//                        throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG);
//                    }
//                }else {
//                    throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG);
//                }
//            }else {
//                throw new ServiceException("距离过远,无法打开", I18nKeyConstant.VEHICLE_DISTANCE_TOO_LONG);
//            }
//        }
        // 车门解锁、后备箱解锁
        VehiclesCommandVo vehiclesCommandVo = new VehiclesCommandVo();
        vehiclesCommandVo.setVin(xpVehicle.getVehicleVin());
@@ -307,10 +306,24 @@
            }
        }
        try {
            // {
            //    "code": 0,
            //    "data": {
            //        "msgId": "1234556"
            //    },
            //    "msg": "",
            //    "desc": "成功"
            //}
            String result = vehicleControlUtil.vehiclesCommand(vehiclesCommandVo, xpOrder.getAppUserId());
            log.info("车辆控制结果:{}", result);
            xpOrderClient.updateOrder(xpOrder);
            return 1;
            JSONObject jsonObject = JSONObject.parseObject(result);
            Integer code = jsonObject.getInteger("code");
            if (code != 0) {
                return 0;
            }else {
                xpOrderClient.updateOrder(xpOrder);
                return 1;
            }
        } catch (Exception e) {
            log.error("车辆控制异常:{}", e.getMessage());
            return 0;
@@ -344,7 +357,13 @@
        try {
            String result = vehicleControlUtil.vehiclesCommand(vehiclesCommandVo, xpOrder.getAppUserId());
            log.info("车辆控制结果:{}", result);
            return 1;
            JSONObject jsonObject = JSONObject.parseObject(result);
            Integer code = jsonObject.getInteger("code");
            if (code != 0) {
                return 0;
            }else {
                return 1;
            }
        } catch (Exception e) {
            log.error("车辆控制异常:{}", e.getMessage());
            return 0;