puzhibing
2026-02-24 907931c9db3d62af425a42decfafc4956a3ddea7
修改分表分库框架和XPU对接逻辑
1个文件已删除
4个文件已添加
38个文件已修改
801 ■■■■■ 已修改文件
xp-robotaxi-account-boot/pom.xml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | 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/account/UserResourcesClient.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/order/XpOrderClient.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/account/XpOperationsUserNotification.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/order/XpOrderDetail.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/down/RTCmdType.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/down/RtMsgHeader.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/down/SourceType.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/down/cloudCreateOrder/TaskType.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/down/cloudPushNavigation/RestoreNavigationData.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/up/RtMsgHeader.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/up/navigationDeviationEvent/NavigationDeviationEvent.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/operation/RouteVo.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/pom.xml 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/config/SnowflakeConfig.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/OrderMissionController.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/util/XPUUtil.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/test/java/com/ruoyi/account/RuoYiAccountApplicationTests.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/test/java/com/xiaopeng/automaticPilot/util/XPUUtilTest.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-common/xp-common-core/src/main/java/com/xiaopeng/common/core/dto/ServiceNameConstantsEnum.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/pom.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/pom.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/pom.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/pom.xml 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpAgreementAppUserServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/pom.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-payment-boot/pom.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-payment-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/pom.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-remote-driving-boot/pom.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-remote-driving-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/pom.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/pom.xml
@@ -109,17 +109,28 @@
            <artifactId>unified-verification</artifactId>
            <version>1.5.2-v2</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
<!--        &lt;!&ndash; 使用 BASE 事务时,需要引入此模块 &ndash;&gt;-->
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
            <version>5.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
            <version>5.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
    </dependencies>
    <build>
xp-robotaxi-account-boot/src/main/resources/seata.conf
@@ -1,5 +1,5 @@
# seata.conf
client {
    application.id = "xp-account"  # 与spring.application.name一致
    application.id = "xp-robotaxi-account-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/order/XpOrderClientFallbackFactory.java
@@ -88,6 +88,12 @@
                log.error("更新订单失败,原因: {}", cause.getMessage());
                return R.fail();
            }
            @Override
            public R<String> updateOrderStatus(Long orderId, Integer status) {
                log.error("更新订单状态失败,原因: {}", cause.getMessage());
                return R.fail("更新订单状态失败");
            }
        };
    }
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/account/UserResourcesClient.java
@@ -1,6 +1,5 @@
package com.xiaopeng.api.feignClient.account;
import com.alibaba.fastjson.JSONObject;
import com.xiaopeng.api.dto.account.UserResourcesDto;
import com.xiaopeng.api.factory.account.UserResourcesClientFallbackFactory;
import com.xiaopeng.api.vo.account.GetUserListByUidsVo;
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/order/XpOrderClient.java
@@ -99,4 +99,15 @@
    @PostMapping("/inner/order/updateOrder")
    R<?> updateOrder(@RequestBody XpOrder xpOrder);
    /**
     * 修改订单状态
     * @param orderId
     * @param status
     * @return
     */
    @PostMapping("/inner/v1/order/updateOrderStatus")
    R<String> updateOrderStatus(@RequestParam Long orderId,
                                       @RequestParam Integer status);
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/account/XpOperationsUserNotification.java
@@ -31,7 +31,7 @@
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "自增id")
    @TableId(value = "id", type = IdType.AUTO)
    @TableId(value = "id", type = IdType.NONE)
    private Long id;
    @ApiModelProperty(value = "通知类型1新任务通知 2任务状态通知 3排班变动通知 4公告通知 5新事故通知 6事故状态通知")
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/order/XpOrderDetail.java
@@ -24,7 +24,7 @@
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    @TableId(value = "id", type = IdType.NONE)
    @ApiModelProperty(value = "自增id")
    private Long id;
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/down/RTCmdType.java
@@ -6,6 +6,9 @@
    CLOUD_ORDER_OPERATION(10001),           // 云端操作订单 (云端→XPU)
    CLOUD_TASK_CONTROL(10003),              // 云端任务操作 (云端→XPU)
    CLOUD_CREATE_ORDER(10004),              // 云端新增订单 (云端→XPU)
    CLOUD_CANCEL_ORDER(10005),              // 云端取消订单 (云端→XPU)
    CLOUD_SEND_RT_TASK(10006),             // 云端发送新RT任务 (云端→XPU)
    CLOUD_NAVIGATION_RESPONSE(10007),       // 云端下放导航信息 (云端→XPU)
    // RT CMD   座舱发起CMD范围:12001~14000
    VEHICLE_ORDER_OPERATION(12001),         // 车端操作订单 (座舱→XPU)
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/down/RtMsgHeader.java
@@ -27,4 +27,8 @@
     * 请求或应答
     */
    private MessageType type;
    /**
     * 消息来源
     */
    private SourceType source;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/down/SourceType.java
New file
@@ -0,0 +1,23 @@
package com.xiaopeng.api.vo.automaticPilot.proto.down;
/**
 * 消息来源类型
 */
public enum SourceType {
    SOURCE_UNKNOWN(0),
    CLOUD(1),
    CDU(2),
    XPU(3);
    private final int value;
    SourceType(int value) {
        this.value = value;
    }
    public int getValue() {
        return value;
    }
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/down/cloudCreateOrder/TaskType.java
@@ -8,7 +8,7 @@
    TASK_TYPE_UNSPECIFIED(0),  // 未指定(默认值)
    ROBOTAXI(1),               // Robotaxi任务
    CLOUD_VALET(2),            // 云代驾任务
    VPD(3);                    // VPD任务(Valet Parking Dropoff,代客泊车)
    CRUISE(3);                 // 巡游任务
    private int value;
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/down/cloudPushNavigation/RestoreNavigationData.java
New file
@@ -0,0 +1,26 @@
package com.xiaopeng.api.vo.automaticPilot.proto.down.cloudPushNavigation;
import lombok.Data;
/**
 * 订单操作信息消息
 */
@Data
public class RestoreNavigationData {
    /**
     * 请求ID
     */
    private String request_id;
    /**
     * 导航路径ID
     */
    private String route_id;
    /**
     * 导航路径还原data信息
     */
    private String content;
    /**
     * 时间戳
     */
    private Long timestamp;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/up/RtMsgHeader.java
@@ -1,5 +1,7 @@
package com.xiaopeng.api.vo.automaticPilot.proto.up;
import com.xiaopeng.api.vo.automaticPilot.proto.down.SourceType;
import lombok.Data;
/**
@@ -30,5 +32,5 @@
    /**
     * 消息来源 {cloud,cdu,xpu}
     */
    private String source;
    private SourceType source;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/automaticPilot/proto/up/navigationDeviationEvent/NavigationDeviationEvent.java
@@ -9,6 +9,10 @@
@Data
public class NavigationDeviationEvent {
    /**
     * 请求唯一ID
     */
    private String request_id;
    /**
     * 事件类型
     */
    private RtEventType event_type;
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/operation/RouteVo.java
@@ -18,4 +18,8 @@
    private String routeID;
    private List<LonLatDto> polyline;
    /**
     * 导航原始数据
     */
    private String routeDataContent;
}
xp-robotaxi-automatic-pilot-boot/pom.xml
@@ -106,17 +106,28 @@
            <artifactId>unified-verification</artifactId>
            <version>1.5.2-v2</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
<!--        &lt;!&ndash; 使用 BASE 事务时,需要引入此模块 &ndash;&gt;-->
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
            <version>5.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
            <version>5.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
    </dependencies>
    <build>
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/config/SnowflakeConfig.java
New file
@@ -0,0 +1,57 @@
package com.xiaopeng.automaticPilot.config;
import cn.hutool.core.lang.Snowflake;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Date;
@Configuration
public class SnowflakeConfig {
    //初始时间戳,设为2026年1月1日0点0时0分
    public static final Date EPOCH_DATE = new Date(1767225600000L);
    /**
     * 如果配置为<0的值,则woker-id根据pod名的hash取模生成
     * 如果配置为>=0的值,则取配置的值
     * 如果多个pod的data-center-id和worker-id相同,同一毫秒内请求数上千的话,可能会产生碰撞,生成一样的snowflake id
     */
    @Value("${snowflake.worker-id:-1}")
    private long workerId;
    @Value("${snowflake.data-center-id:0}")
    private long dataCenterId;
    @Bean
    public Snowflake snowflake() {
        long resolvedWorkerId = resolveWorkerId();
        return new Snowflake(EPOCH_DATE, resolvedWorkerId, dataCenterId, false);
    }
    private long resolveWorkerId() {
        if (workerId >= 0 && workerId <= Snowflake.MAX_WORKER_ID) {
            return workerId;
        }
        String podName = System.getenv("HOSTNAME");
        if (podName == null || podName.isEmpty()) {
            return 0;
        }
        int end = podName.length() - 1;
        while (end >= 0 && Character.isDigit(podName.charAt(end))) {
            end--;
        }
        String numberPart = podName.substring(end + 1);
        long candidate;
        if (!numberPart.isEmpty()) {
            try {
                candidate = Long.parseLong(numberPart);
            } catch (NumberFormatException e) {
                candidate = Math.abs(podName.hashCode());
            }
        } else {
            candidate = Math.abs(podName.hashCode());
        }
        return candidate % (Snowflake.MAX_WORKER_ID + 1);
    }
}
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/OrderMissionController.java
@@ -1,12 +1,11 @@
package com.xiaopeng.automaticPilot.controller;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import com.xiaopeng.api.dto.automaticPilot.MqttPublishDto;
import com.xiaopeng.api.dto.automaticPilot.PushOrderDto;
import com.xiaopeng.api.dto.vehicleConvoy.UpdateVehicleStateDto;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.vo.automaticPilot.proto.down.ResponseMessage;
import com.xiaopeng.api.vo.automaticPilot.proto.down.StatusCode;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudCreateOrder.RTTask;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudCreateOrder.TaskStatus;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudCreateOrder.TaskType;
@@ -14,7 +13,6 @@
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.OrderOperationType;
import com.xiaopeng.automaticPilot.util.XPUUtil;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.utils.SnowFlake;
import com.xiaopeng.common.redis.service.RedisService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
@@ -28,52 +26,43 @@
@Api(tags = "订单任务Api")
public class OrderMissionController {
    private final XPUUtil xpuUtil;
    private final RedisService redisService;
    private final XpVehicleClient xpVehicleClient;
    private final Snowflake snowflake;
    public OrderMissionController(XPUUtil xpuUtil, RedisService redisService, XpVehicleClient xpVehicleClient) {
    public OrderMissionController(XPUUtil xpuUtil, RedisService redisService, XpVehicleClient xpVehicleClient, Snowflake snowflake) {
        this.xpuUtil = xpuUtil;
        this.redisService = redisService;
        this.xpVehicleClient = xpVehicleClient;
        this.snowflake = snowflake;
    }
    @PostMapping("/inner/pushOrder")
    public R<Boolean> pushOrder(@RequestBody PushOrderDto dto) {
        RTTask task = new RTTask();
        task.setOrder_id(dto.getOrderId().toString());
        task.setTask_id("MISSION_"+ IdUtil.fastUUID());
        task.setTask_id("MISSION_" + IdUtil.fastUUID());
        task.setTask_type(TaskType.ROBOTAXI);
        task.setStatus(TaskStatus.PENDING);
        SnowFlake snowFlake = new SnowFlake(0, 0);
        snowFlake.withStartTimestamp(1420041600000L);
        long sequence = snowFlake.nextId();
        MqttPublishDto mqttPublishDto = xpuUtil.cloudCreateOrder(task, dto.getVin(),sequence);
        if (mqttPublishDto.getCode()== 200) {
            // 修改车子为微单状态
            xpVehicleClient.updateVehicleStatus(new UpdateVehicleStateDto(dto.getVin(),1));
        long sequence = snowflake.nextId();
        MqttPublishDto mqttPublishDto = xpuUtil.cloudCreateOrder(task, dto.getVin(), sequence);
        if (mqttPublishDto.getCode() == 200) {
            xpVehicleClient.updateVehicleStatus(new UpdateVehicleStateDto(dto.getVin(), 1));
            return R.ok(true);
        }
        return R.ok(false);
    }
    @PostMapping("/inner/cancelOrder")
    R<Boolean> cancelOrder(@RequestBody PushOrderDto dto){
    R<Boolean> cancelOrder(@RequestBody PushOrderDto dto) {
        OrderOperation operation = new OrderOperation();
        operation.setOrder_id(dto.getOrderId().toString());
        operation.setTask_id("CANCEL_MISSION_"+ IdUtil.fastUUID());
        operation.setTask_id("CANCEL_MISSION_" + IdUtil.fastUUID());
        operation.setOperation_type(dto.getOperation_type());
        SnowFlake snowFlake = new SnowFlake(0, 0);
        snowFlake.withStartTimestamp(1420041600000L);
        long sequence = snowFlake.nextId();
        xpuUtil.cloudOrderOperation(operation,dto.getVin(),sequence);
        redisService.setCacheObject(String.valueOf(sequence),"cancelOrder_"+dto.getOrderId()+"_"+ dto.getVin(),30l, TimeUnit.MINUTES);
        long sequence = snowflake.nextId();
        xpuUtil.cloudOrderOperation(operation, dto.getVin(), sequence);
        redisService.setCacheObject(String.valueOf(sequence), "cancelOrder_" + dto.getOrderId() + "_" + dto.getVin(), 30L, TimeUnit.MINUTES);
        return R.ok(true);
    }
}
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -1,7 +1,6 @@
package com.xiaopeng.automaticPilot.service;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.xiaopeng.api.dto.map.OrderRouteAndFareDto;
@@ -23,6 +22,7 @@
import com.xiaopeng.api.vo.automaticPilot.proto.down.ResponseMessage;
import com.xiaopeng.api.vo.automaticPilot.proto.down.StatusCode;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.*;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudPushNavigation.RestoreNavigationData;
import com.xiaopeng.api.vo.automaticPilot.proto.up.MessageType;
import com.xiaopeng.api.vo.automaticPilot.proto.up.MsgContent;
import com.xiaopeng.api.vo.automaticPilot.proto.up.RTCmdType;
@@ -41,10 +41,8 @@
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.SnowFlake;
import com.xiaopeng.common.core.utils.StringUtils;
import com.xiaopeng.common.core.utils.uuid.UUID;
import com.xiaopeng.common.redis.service.RedisService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
@@ -80,15 +78,20 @@
    @Resource
    private XPUUtil xpuUtil;
    @Autowired
    @Resource
    public RedisTemplate redisTemplate;
    @Resource
    private XpPushMessageClient xpPushMessageClient;
    @Resource
    private ReassignOrderClient reassignOrderClient;
    @Resource
    private UserVehicleClient userVehicleClient;
    @Resource
    private Snowflake snowflake;
@@ -182,9 +185,8 @@
                default:
                    log.info("消息不在处理范围内,忽略:{}", message);
            }
        }
        //TODO 这里的逻辑要再确认下
        //消息应答
        if(MessageType.MESSAGE_TYPE_RESPONSE == type){
            com.xiaopeng.api.vo.automaticPilot.proto.up.ResponseMessage resposne = msgContent.getContent_detail().getObject("resposne", com.xiaopeng.api.vo.automaticPilot.proto.up.ResponseMessage.class);
@@ -217,7 +219,7 @@
    public void systemStatusXpu(MsgContent msgContent) {
        //开始处理消息对应的业务逻辑
        SystemRuntimeStatus systemRuntimeStatus = msgContent.getContent_detail().getObject("systemRuntimeStatus", SystemRuntimeStatus.class);
        //获取实时位姿
        //获取实时位置
        RealtimePose pose = systemRuntimeStatus.getPose();
        Wgs naviPose = pose.getNavi_pose();
        Double latitude = naviPose.getLatitude();
@@ -333,7 +335,6 @@
        }
    }
    /**
     * XPU向云端请求导航
     *
@@ -342,6 +343,7 @@
    public void xpuNavigationRequest(MsgContent msgContent) {
        //开始处理消息对应的业务逻辑
        NavigationRequest naviRequest = msgContent.getContent_detail().getObject("naviRequest", NavigationRequest.class);
        String requestId = naviRequest.getRequest_id();
        String orderId = naviRequest.getOrder_id();
        String taskId = naviRequest.getTask_id();
        OrderPhase orderPhase = naviRequest.getOrder_phase();
@@ -353,15 +355,15 @@
                break;
            case ROUTE_TO_PICKUP:
                log.info("驶往上车点的行程");
                buildNaviRequest(orderId, taskId, orderPhase, msgContent.getHeader().getSequence());
                buildNaviRequest(requestId, orderId, orderPhase, msgContent.getHeader().getSequence());
                break;
            case ROUTE_TO_DESTINATION:
                log.info("驶往下车点的行程");
                buildNaviRequest(orderId, taskId, orderPhase, msgContent.getHeader().getSequence());
                buildNaviRequest(requestId, orderId, orderPhase, msgContent.getHeader().getSequence());
                break;
            case ROUTE_TO_CRUISE:
                log.info("巡游阶段路线");
                buildNaviRequest(orderId, taskId, orderPhase, msgContent.getHeader().getSequence());
                buildNaviRequest(requestId, orderId, orderPhase, msgContent.getHeader().getSequence());
                break;
        }
    }
@@ -377,6 +379,7 @@
        Long sequence = msgContent.getHeader().getSequence();
        //开始处理消息对应的业务逻辑
        NavigationDeviationEvent deviationEvent = msgContent.getContent_detail().getObject("deviationEvent", NavigationDeviationEvent.class);
        String requestId = deviationEvent.getRequest_id();
        //偏航事件类型 1:请求导航,2:取消导航
        if (deviationEvent.getEvent_type().equals(RtEventType.RT_EVENT_TYPE_REQUEST)) {
            NavigationDeviationMessage navigationDeviationMessage = deviationEvent.getNavigation_deviation_message();
@@ -385,11 +388,9 @@
            Double longitude = navigationDeviationMessage.getLongitude();
            Double latitude = navigationDeviationMessage.getLatitude();
            //订单类型  1:乘客订单,2=巡游订单
            Integer orderType = 1;
            LonLatDto destination = new LonLatDto();
            LonLatDto origin = new LonLatDto();
            if (orderId.contains("XU")) {
                orderType = 2;
                // todo 下发巡游单的导航数据
                //巡游单
                origin.setLongitude(longitude);
@@ -434,7 +435,7 @@
                }
                RouteVo routeVo = routeVoR.getData();
                //构建导航下发请求对象
                cloudOrderOperation(orderType, orderId, taskId, routeVo, xpVehicle.getVehicleVin());
                cloudPushNavigationInfo(requestId, routeVo.getRouteID(), routeVo.getRouteDataContent(), orderId, xpVehicle.getVehicleVin(), xpVehicle.getXpuId());
            }
        }
    }
@@ -444,16 +445,13 @@
     * 构建导航请求
     *
     * @param orderId
     * @param taskId
     * @param orderPhase
     */
    public void buildNaviRequest(String orderId, String taskId, OrderPhase orderPhase, Long sequence) {
    public void buildNaviRequest(String requestId, String orderId, OrderPhase orderPhase, Long sequence) {
        //订单类型  1:乘客订单,2=巡游订单
        Integer orderType = 1;
        LonLatDto destination = new LonLatDto();
        LonLatDto origin = new LonLatDto();
        if (orderId.contains("XU")) {
            orderType = 2;
            // todo 下发巡游单的导航数据
            //巡游单
            if (orderPhase.equals(OrderPhase.ROUTE_TO_CRUISE)) {
@@ -507,14 +505,14 @@
            XpVehicle xpVehicle = xpVehicleClient.queryById(xpOrder.getVehicleId()).getData();
            RouteVo routeVo = routeVoR.getData();
            //构建导航下发请求对象
            cloudOrderOperation(orderType, orderId, taskId, routeVo, xpVehicle.getVehicleVin());
            cloudPushNavigationInfo(requestId, routeVo.getRouteID(), routeVo.getRouteDataContent(), orderId, xpVehicle.getVehicleVin(), xpVehicle.getXpuId());
        }
    }
    /**
     * 云端订单操作----下发导航数据
     *
     * 云端订单操作
     * 更新途经点/终点
     * @param routeVo
     */
    public void cloudOrderOperation(Integer orderType, String orderId, String taskId, RouteVo routeVo, String vin) {
@@ -552,13 +550,11 @@
            waypoints.add(waypoint);
        }
        orderOperation.setWaypoints(waypoints);
        SnowFlake snowFlake = new SnowFlake(0, 0);
        snowFlake.withStartTimestamp(1420041600000L);
        long sequence = snowFlake.nextId();
        long sequence = snowflake.nextId();
        // 处理数据
        redisTemplate.opsForValue().set(sequence,"pushOrder_"+orderId+"_"+vin,30, TimeUnit.MINUTES);
        //开发发送请求到XPU
        xpuUtil.cloudOrderOperation(orderOperation, vin,sequence);
        xpuUtil.cloudOrderOperation(orderOperation, vin, sequence);
    }
@@ -597,6 +593,7 @@
                case ORDER_RECEIVED:
                    //收到订单
                    buildPushOrderStatus(orderId, OrderStatusEnum.READY_DEPART, sequence);
                    xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.READY_DEPART.getCode());
                    break;
                case ORDER_STARTED:
                    //开始执行订单
@@ -605,6 +602,7 @@
                case ORDER_EN_ROUTE_TO_PICKUP:
                    //前往上车点
                    buildPushOrderStatus(orderId, OrderStatusEnum.PICK_UP, sequence);
                    xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.PICK_UP.getCode());
                    break;
                case ORDER_ARRIVED_AT_PICKUP:
                    //到达上车点
@@ -613,14 +611,17 @@
                case ORDER_WAITING_FOR_PICKUP:
                    //等待乘客上车
                    buildPushOrderStatus(orderId, OrderStatusEnum.PICK_UP_GUESTS, sequence);
                    xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.PICK_UP_GUESTS.getCode());
                    break;
                case ORDER_PASSENGER_ONBOARD:
                    //乘客已上车
                    buildPushOrderStatus(orderId, OrderStatusEnum.PASSENGER_BOARDED, sequence);
                    xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.PASSENGER_BOARDED.getCode());
                    break;
                case ORDER_EN_ROUTE_TO_DESTINATION:
                    //前往目的地
                    buildPushOrderStatus(orderId, OrderStatusEnum.IN_SERVICE, sequence);
                    xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.IN_SERVICE.getCode());
                    break;
                case ORDER_ARRIVED_AT_DESTINATION:
                    //到达目的地
@@ -629,10 +630,12 @@
                case ORDER_WAITING_FOR_DROPOFF:
                    //等待乘客下车
                    buildPushOrderStatus(orderId, OrderStatusEnum.SEE_OFF_GUESTS, sequence);
                    xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.SEE_OFF_GUESTS.getCode());
                    break;
                case ORDER_DROPOFF_COMPLETED:
                    //下车完成
                    buildPushOrderStatus(orderId, OrderStatusEnum.APPROVAL_REJECTION, sequence);
                    xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.APPROVAL_REJECTION.getCode());
                    break;
                case ORDER_COMPLETED:
                    //已完成
@@ -641,10 +644,11 @@
                case ORDER_CANCELLED:
                    //已取消
                    buildPushOrderStatus(orderId, OrderStatusEnum.CANCELED, sequence);
                    xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.CANCELED.getCode());
                    break;
                case ORDER_ARRIVED_AT_CRUISE_DESTINATION:
                    //到达巡游终点
                    buildPushOrderStatus(orderId, null, sequence);
                    buildPushOrderStatus(orderId, OrderStatusEnum.COMPLETED, sequence);
                    break;
                case ORDER_PAUSED:
                    //订单暂停
@@ -667,6 +671,15 @@
            //巡游单
            //响应消息
            responseMessage(sequence, "");
            //todo 处理巡游相关的功能
            //前往目的地
            if(OrderStatusEnum.IN_SERVICE.equals(status)){
            }
            //到达目的地
            if(OrderStatusEnum.COMPLETED.equals(status)){
            }
        }else{
            //普通单
            R<XpOrder> xpOrderR = xpOrderClient.queryOrderById(Long.parseLong(orderId));
@@ -681,7 +694,7 @@
            content.put("orderId", orderId);
            content.put("status", status.getCode());
            params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc());
            params.put("content", com.alibaba.fastjson2.JSONObject.toJSONString(content));
            params.put("content", JSONObject.toJSONString(content));
            params.put("timestamp", System.currentTimeMillis() + "");
            String message = JSONObject.toJSONString(params);
            Long appUserId = xpOrder.getAppUserId();
@@ -695,4 +708,26 @@
        }
    }
    /**
     * 云端下发导航到XPU
     * @param requestId             XPU请求id
     * @param routeId               高德导航id
     * @param routeDataContent      高德导航原数据
     * @param orderId               订单id
     * @param vin                   车辆VIN
     * @param xpuId                 XPU设备id
     */
    public void cloudPushNavigationInfo(String requestId, String routeId, String routeDataContent, String orderId, String vin, String xpuId) {
        //组装报文,将routeDateContent信息推送到XPU
        RestoreNavigationData navigationData = new RestoreNavigationData();
        navigationData.setRoute_id(routeId);
        navigationData.setRequest_id(requestId);
        navigationData.setContent(routeDataContent);
        navigationData.setTimestamp(System.currentTimeMillis());
        long sequence = snowflake.nextId();
        // 处理数据
        redisTemplate.opsForValue().set(sequence,"pushOrder_"+orderId+"_"+vin,30, TimeUnit.MINUTES);
        xpuUtil.cloudPushNavigation(navigationData, xpuId, sequence);
    }
}
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/util/XPUUtil.java
@@ -2,9 +2,6 @@
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.xiaopeng.api.dto.automaticPilot.MqttPublishDto;
@@ -14,7 +11,7 @@
import com.xiaopeng.api.vo.automaticPilot.proto.down.*;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudCreateOrder.RTTask;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.OrderOperation;
import com.xiaopeng.common.core.exception.ServiceException;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudPushNavigation.RestoreNavigationData;
import com.xiaopeng.common.core.utils.StringUtils;
import com.xiaopeng.common.core.utils.uuid.UUID;
import lombok.extern.slf4j.Slf4j;
@@ -22,7 +19,6 @@
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -34,8 +30,8 @@
@Component
public class XPUUtil {
    @Value("${xpu.topic}")
    private String topic;
    @Value("${xpu.topic.msg.prefix:Robotaxi/Msg/Xpu}")
    private String topicPrefix;
    @Resource
    private XPUClient xpuClient;
@@ -48,14 +44,13 @@
    // 查询车管 车辆xpuid信息返回字段,用于按需返回字段
    public static final List<String> TYPE_LIST = Collections.singletonList("1");
    /**
     * Robotaxi创建订单推送给XPU
     *
     * @param task
     * @return
     */
    //TODO 处理feign调用的异常
    public MqttPublishDto cloudCreateOrder(RTTask task, String vin, Long sequence) {
        MsgContent msgContent = new MsgContent();
        // 消息头
@@ -65,30 +60,28 @@
        header.setCmd(RTCmdType.CLOUD_CREATE_ORDER);
        header.setSequence(sequence);
        header.setType(MessageType.MESSAGE_TYPE_RESPONSE);
        header.setSource(SourceType.CLOUD);
        msgContent.setHeader(header);
        // 消息内容
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("task", task);
        msgContent.setContent_detail(jsonObject);
        log.info("云端-->XPU 创建订单:{}", msgContent);
        //根据车辆VIN查询XPUID
        String xpuId = getXpuIdByVin(vin);
        //组装请求消息体
        MqttPublishVo vo = new MqttPublishVo();
        vo.setTopic(topic + "/" + xpuId);
        vo.setTopic(buildTopicByVin(vin));
        vo.setPayload(JSON.toJSONString(msgContent));
        log.info("云端-->XPU 创建订单:{}", vo);
        return xpuClient.publish(vo);
    }
    /**
     * 操作订单
     * 取消订单/修改途经点、终点/下发导航地址到车端
     *
     * 取消订单、修改途经点、终点
     * @param operation
     * @return
     */
    public MqttPublishDto cloudOrderOperation(OrderOperation operation, String vin,Long  sequence) {
    //TODO 处理feign调用的异常
    public MqttPublishDto cloudOrderOperation(OrderOperation operation, String vin, Long sequence) {
        MsgContent msgContent = new MsgContent();
        // 消息头
        RtMsgHeader header = new RtMsgHeader();
@@ -97,18 +90,17 @@
        header.setCmd(RTCmdType.CLOUD_ORDER_OPERATION);
        header.setSequence(sequence);
        header.setType(MessageType.MESSAGE_TYPE_REQUEST);
        header.setSource(SourceType.CLOUD);
        msgContent.setHeader(header);
        // 消息内容
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("operation", operation);
        msgContent.setContent_detail(jsonObject);
        log.info("云端-->XPU 操作订单:{}", msgContent);
        //根据车辆VIN查询XPUID
        String xpuId = getXpuIdByVin(vin);
        //组装请求消息体
        MqttPublishVo vo = new MqttPublishVo();
        vo.setTopic(topic + "/" + xpuId);
        vo.setTopic(buildTopicByVin(vin));
        vo.setPayload(JSON.toJSONString(msgContent));
        log.info("云端-->XPU 修改订单:{}", vo);
        return xpuClient.publish(vo);
    }
@@ -131,22 +123,49 @@
        Snowflake snowflake = IdUtil.getSnowflake(0, 0);
        header.setSequence(snowflake.nextId());
        header.setType(MessageType.MESSAGE_TYPE_RESPONSE);
        header.setSource(SourceType.CLOUD);
        msgContent.setHeader(header);
        // 消息内容
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("resposne", responseMessage);
        msgContent.setContent_detail(jsonObject);
        log.info("云端-->XPU 响应消息:{}", msgContent);
        //根据车辆VIN查询XPUID
        String xpuId = getXpuIdByVin(vin);
        //组装请求消息体
        MqttPublishVo vo = new MqttPublishVo();
        vo.setTopic(topic + "/" + xpuId);
        vo.setTopic(buildTopicByVin(vin));
        vo.setPayload(JSON.toJSONString(msgContent));
        log.info("云端-->XPU 响应消息:{}", vo);
        return xpuClient.publish(vo);
    }
    /**
     * 下发导航地址到车端
     *
     * @param navigationData
     * @return
     */
    //TODO 处理feign调用的异常
    public MqttPublishDto cloudPushNavigation(RestoreNavigationData navigationData, String xpuId, Long sequence) {
        MsgContent msgContent = new MsgContent();
        // 消息头
        RtMsgHeader header = new RtMsgHeader();
        header.setMsg_id(UUID.randomUUID().toString());
        header.setTimestamp(System.currentTimeMillis());
        header.setCmd(RTCmdType.CLOUD_NAVIGATION_RESPONSE);
        header.setSequence(sequence);
        header.setType(MessageType.MESSAGE_TYPE_RESPONSE);
        header.setSource(SourceType.CLOUD);
        msgContent.setHeader(header);
        // 消息内容
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("navigationData", navigationData);
        msgContent.setContent_detail(jsonObject);
        MqttPublishVo vo = new MqttPublishVo();
        vo.setTopic(buildTopicByXpuId(xpuId));
        vo.setPayload(JSON.toJSONString(msgContent));
        log.info("云端-->XPU 下发导航信息:{}", vo);
        return xpuClient.publish(vo);
    }
    /**
@@ -164,5 +183,23 @@
        return xpuIdMapping.get(XPU_ID_TYPE);
    }
    private String buildTopicByVin(String vin) {
        String xpuId = getXpuIdByVin(vin);
        return this.buildTopicByXpuId(xpuId);
    }
    private String buildTopicByXpuId(String xpuId) {
        String prefix = topicPrefix == null ? "" : topicPrefix;
        if (!prefix.endsWith("/")) {
            prefix = prefix + "/";
        }
        String value = xpuId;
        if (xpuId.length() > 10) {
            int start = 10;
            int end = Math.min(24, xpuId.length());
            value = xpuId.substring(start, end);
        }
        return prefix + value + "00000000";
    }
}
xp-robotaxi-automatic-pilot-boot/src/test/java/com/ruoyi/account/RuoYiAccountApplicationTests.java
File was deleted
xp-robotaxi-automatic-pilot-boot/src/test/java/com/xiaopeng/automaticPilot/util/XPUUtilTest.java
New file
@@ -0,0 +1,43 @@
package com.xiaopeng.automaticPilot.util;
import com.xiaopeng.api.feignClient.automaticPilot.VmpOpenServiceClient;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class XPUUtilTest {
    private XPUUtil xpuUtil;
    @BeforeEach
    public void setUp() throws Exception {
        xpuUtil = new XPUUtil();
        VmpOpenServiceClient vmpClient = Mockito.mock(VmpOpenServiceClient.class);
        Map<String, String> mapping = new HashMap<>();
        mapping.put(XPUUtil.XPU_ID_TYPE, "1234567890ABCDEFGHIJKL");
        Mockito.when(vmpClient.getVehicleBindInfoByVin(Mockito.anyString(), Mockito.anyList()))
                .thenReturn(mapping);
        Field vmpField = XPUUtil.class.getDeclaredField("vmpOpenServiceClient");
        vmpField.setAccessible(true);
        vmpField.set(xpuUtil, vmpClient);
        Field topicField = XPUUtil.class.getDeclaredField("topicPrefix");
        topicField.setAccessible(true);
        topicField.set(xpuUtil, "Robotaxi/Msg/Xpu");
    }
    @Test
    public void testBuildTopicByVin() throws Exception {
        Method buildTopic = XPUUtil.class.getDeclaredMethod("buildTopicByVin", String.class);
        buildTopic.setAccessible(true);
        String result = (String) buildTopic.invoke(xpuUtil, "VIN123");
        Assertions.assertEquals("Robotaxi/Msg/Xpu/ABCDEFGHIJKL00000000", result);
    }
}
xp-robotaxi-common/xp-common-core/src/main/java/com/xiaopeng/common/core/dto/ServiceNameConstantsEnum.java
@@ -58,11 +58,11 @@
     */
    String XP_USER_RESOURCES_SERVICE = "xp-user-resources-boot";
    /**
     * 小鹏用车控服务
     * 小鹏车控服务
     */
    String XP_IM_OPEN_BOOT_SERVICE = "xp-im-open-boot";
    /**
     * 小鹏用车控服务
     * 小鹏车控服务
     */
    String XP_MQTT_ROUTER_THIRDPARTY_BOOT = "xp-mqtt-router-thirdparty-boot";
xp-robotaxi-itinerary-boot/pom.xml
@@ -97,17 +97,27 @@
            <artifactId>unified-verification</artifactId>
            <version>1.5.2-v2</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
<!--        &lt;!&ndash; 使用 BASE 事务时,需要引入此模块 &ndash;&gt;-->
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
            <version>5.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
            <version>5.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
    </dependencies>
    <build>
xp-robotaxi-itinerary-boot/src/main/resources/seata.conf
@@ -1,5 +1,5 @@
# seata.conf
client {
    application.id = "xp-itinerary"  # 与spring.application.name一致
    application.id = "xp-robotaxi-itinerary-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
}
xp-robotaxi-maintenance-boot/pom.xml
@@ -103,17 +103,27 @@
            <artifactId>unified-verification</artifactId>
            <version>1.5.2-v2</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
<!--        &lt;!&ndash; 使用 BASE 事务时,需要引入此模块 &ndash;&gt;-->
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
            <version>5.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
            <version>5.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
    </dependencies>
    <build>
xp-robotaxi-maintenance-boot/src/main/resources/seata.conf
@@ -1,5 +1,5 @@
# seata.conf
client {
    application.id = "xp-maintenance"  # 与spring.application.name一致
    application.id = "xp-robotaxi-maintenance-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
}
xp-robotaxi-map-boot/pom.xml
@@ -101,17 +101,27 @@
            <artifactId>unified-verification</artifactId>
            <version>1.5.2-v2</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
<!--        &lt;!&ndash; 使用 BASE 事务时,需要引入此模块 &ndash;&gt;-->
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
            <version>5.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
            <version>5.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
    </dependencies>
    <build>
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/utils/GDMapGeocodingUtil.java
@@ -71,6 +71,7 @@
        JSONObject jsonObject1 = JSON.parseObject(data);
        String routeID = jsonObject1.getString("routeID");
        JSONArray path = jsonObject1.getJSONArray("path");
        routeVo.setRouteDataContent(data);
        for (Object o : path) {
            JSONObject jsonObject2 = (JSONObject) o;
xp-robotaxi-map-boot/src/main/resources/seata.conf
@@ -1,5 +1,5 @@
# seata.conf
client {
    application.id = "xp-map"  # 与spring.application.name一致
    application.id = "xp-robotaxi-map-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
}
xp-robotaxi-operation-boot/pom.xml
@@ -168,22 +168,27 @@
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz</artifactId>
        </dependency>
        <!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
<!--        &lt;!&ndash; 使用 BASE 事务时,需要引入此模块 &ndash;&gt;-->
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>org.yaml</groupId>-->
<!--            <artifactId>snakeyaml</artifactId>-->
<!--            <version>1.33</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
            <version>5.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
            <version>5.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
    </dependencies>
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpAgreementAppUserServiceImpl.java
@@ -8,6 +8,7 @@
import com.xiaopeng.operation.service.XpAgreementAppUserService;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;
@@ -28,6 +29,11 @@
        xpAgreementAppUser.setAppUserId(appUserId);
        List<Long> type = xpAgreementAppUserDto.getType();
        xpAgreementAppUser.setAgreementIds(type.stream().map(String::valueOf).collect(Collectors.joining(",")));
        xpAgreementAppUser.setCreateBy(appUserId.toString());
        xpAgreementAppUser.setUpdateBy(appUserId.toString());
        xpAgreementAppUser.setCreateTime(LocalDateTime.now());
        xpAgreementAppUser.setUpdateTime(LocalDateTime.now());
        xpAgreementAppUser.setDeleted(false);
        return save(xpAgreementAppUser);
    }
}
xp-robotaxi-operation-boot/src/main/resources/seata.conf
@@ -1,5 +1,5 @@
# seata.conf
client {
    application.id = "xp-operation"  # 与spring.application.name一致
    application.id = "xp-robotaxi-operation-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
}
xp-robotaxi-order-boot/pom.xml
@@ -110,17 +110,27 @@
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz</artifactId>
        </dependency>
        <!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
<!--        &lt;!&ndash; 使用 BASE 事务时,需要引入此模块 &ndash;&gt;-->
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
            <version>5.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
            <version>5.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
<!--        <dependency>-->
xp-robotaxi-order-boot/src/main/resources/seata.conf
@@ -1,5 +1,5 @@
# seata.conf
client {
    application.id = "xp-order"  # 与spring.application.name一致
    application.id = "xp-robotaxi-order-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
}
xp-robotaxi-payment-boot/pom.xml
@@ -112,13 +112,23 @@
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
            <version>5.0.0</version>
            <version>5.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- 使用 BASE 事务时,需要引入此模块 -->
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
            <version>5.0.0</version>
            <version>5.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
    </dependencies>
xp-robotaxi-payment-boot/src/main/resources/seata.conf
@@ -1,5 +1,5 @@
# seata.conf
client {
    application.id = "xp-payment"  # 与spring.application.name一致
    application.id = "xp-robotaxi-payment-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
}
xp-robotaxi-push-message-boot/pom.xml
@@ -97,17 +97,27 @@
            <artifactId>unified-verification</artifactId>
            <version>1.5.2-v2</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
<!--        &lt;!&ndash; 使用 BASE 事务时,需要引入此模块 &ndash;&gt;-->
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
            <version>5.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
            <version>5.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
    </dependencies>
    <build>
xp-robotaxi-push-message-boot/src/main/resources/seata.conf
@@ -1,5 +1,5 @@
# seata.conf
client {
    application.id = "xp-pushMessage"  # 与spring.application.name一致
    application.id = "xp-robotaxi-push-message-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
}
xp-robotaxi-remote-driving-boot/pom.xml
@@ -100,13 +100,23 @@
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
            <version>5.0.0</version>
            <version>5.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- 使用 BASE 事务时,需要引入此模块 -->
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
            <version>5.0.0</version>
            <version>5.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
    </dependencies>
xp-robotaxi-remote-driving-boot/src/main/resources/seata.conf
@@ -1,5 +1,5 @@
# seata.conf
client {
    application.id = "xp-remoteDriving"  # 与spring.application.name一致
    application.id = "xp-robotaxi-remote-driving-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
}
xp-robotaxi-vehicle-convoy-boot/pom.xml
@@ -97,17 +97,27 @@
            <artifactId>unified-verification</artifactId>
            <version>1.5.2-v2</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
<!--        &lt;!&ndash; 使用 BASE 事务时,需要引入此模块 &ndash;&gt;-->
<!--        <dependency>-->
<!--            <groupId>org.apache.shardingsphere</groupId>-->
<!--            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>-->
<!--            <version>5.0.0</version>-->
<!--        </dependency>-->
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
            <version>5.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.yaml</groupId>
                    <artifactId>snakeyaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.shardingsphere</groupId>
            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>
            <version>5.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.33</version>
        </dependency>
        <!-- easypoi -->
        <dependency>
            <groupId>cn.afterturn</groupId>
xp-robotaxi-vehicle-convoy-boot/src/main/resources/seata.conf
@@ -1,5 +1,5 @@
# seata.conf
client {
    application.id = "xp-vehicleConvoy"  # 与spring.application.name一致
    application.id = "xp-robotaxi-vehicle-convoy-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
}