liujie
2026-02-25 88f182b9489cc9faed8c679f43513d8a94ebbc64
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi
14个文件已修改
203 ■■■■■ 已修改文件
xp-robotaxi-account-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/resources/seata.conf 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/service/impl/XpPricingServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/resources/bootstrap.yml 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-payment-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-remote-driving-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/resources/seata.conf 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/resources/seata.conf
@@ -1,4 +1,6 @@
# seata.conf
shardingsphere.transaction.seata.at.enable = true
shardingsphere.transaction.seata.tx.timeout = 60
client {
    application.id = "xp-robotaxi-account-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -51,6 +51,7 @@
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;
@@ -103,6 +104,8 @@
    @Resource
    private Snowflake snowflake;
    @Autowired
    private RedisService redisService;
    /**
@@ -476,17 +479,34 @@
        //订单类型  1:乘客订单,2=巡游订单
        LonLatDto destination = new LonLatDto();
        LonLatDto origin = new LonLatDto();
        //导航id
        String routeID = "";
        Long vehicleId = null;
        if (orderId.contains("XU")) {
            // todo 下发巡游单的导航数据
            //巡游单
            if (orderPhase.equals(OrderPhase.ROUTE_TO_CRUISE)) {
                //先响应消息
                responseMessage(sequence, "");
                //构建导航数据给到车端
                origin.setLongitude(116.40528);
                origin.setLatitude(39.90498);
                destination.setLongitude(116.40528);
                destination.setLatitude(39.90498);
                //先响应消息
                responseMessage(sequence, "");
                OrderRouteAndFareDto dto = new OrderRouteAndFareDto();
                dto.setOrderId(Long.parseLong(orderId));
                dto.setOrigin(origin);
                dto.setDestination(destination);
                R<RouteVo> routeVoR = xpMapClient.getOrderDistanceAndDuration(dto);
                if (200 != routeVoR.getCode()) {
                    throw new RuntimeException("获取订单线路和运费失败");
                }
                RouteVo routeVo = routeVoR.getData();
                routeID = routeVo.getRouteID();
//                vehicleId = xpOrder.getVehicleId();
            }
        } else {
            //正常单
@@ -510,31 +530,57 @@
                origin.setLatitude(vehiclePosition.getPoint().getY());
                destination.setLongitude(xpOrder.getStartLon());
                destination.setLatitude(xpOrder.getStartLat());
                OrderRouteAndFareDto dto = new OrderRouteAndFareDto();
                dto.setOrderId(Long.parseLong(orderId));
                dto.setOrigin(origin);
                dto.setDestination(destination);
                R<RouteVo> routeVoR = xpMapClient.getOrderDistanceAndDuration(dto);
                if (200 != routeVoR.getCode()) {
                    throw new RuntimeException("获取订单线路和运费失败");
                }
                RouteVo routeVo = routeVoR.getData();
                routeID = routeVo.getRouteID();
            }
            //驶往下车点的行程
            if (orderPhase.equals(OrderPhase.ROUTE_TO_DESTINATION)) {
                //查询起点到终点的线路
                origin.setLongitude(xpOrder.getStartLon());
                origin.setLatitude(xpOrder.getStartLat());
                destination.setLongitude(xpOrder.getEndLon());
                destination.setLatitude(xpOrder.getEndLat());
                //直接取缓存中的导航数据推送给车端和乘客
                Object cacheObject = redisService.getCacheObject("ORDER_NAVIGATION_DATA:" + xpOrder.getAppUserId());
                if(null == cacheObject){
                    //没有缓存数据,重新规划线路
                    //查询起点到终点的线路
                    origin.setLongitude(xpOrder.getStartLon());
                    origin.setLatitude(xpOrder.getStartLat());
                    destination.setLongitude(xpOrder.getEndLon());
                    destination.setLatitude(xpOrder.getEndLat());
                    OrderRouteAndFareDto dto = new OrderRouteAndFareDto();
                    dto.setOrderId(Long.parseLong(orderId));
                    dto.setOrigin(origin);
                    dto.setDestination(destination);
                    R<RouteVo> routeVoR = xpMapClient.getOrderDistanceAndDuration(dto);
                    if (200 != routeVoR.getCode()) {
                        throw new RuntimeException("获取订单线路和运费失败");
                    }
                    RouteVo routeVo = routeVoR.getData();
                    routeID = routeVo.getRouteID();
                    //缓存导航数据,用于后面的逻辑中给乘客端推送导航数据
                    redisService.setCacheObject("ORDER_NAVIGATION_DATA:" + xpOrder.getAppUserId(), com.alibaba.fastjson.JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS);
                }else{
                    RouteVo routeVo = JSON.parseObject(cacheObject.toString(), RouteVo.class);
                    routeID = routeVo.getRouteID();
                }
            }
            OrderRouteAndFareDto dto = new OrderRouteAndFareDto();
            dto.setOrderId(Long.parseLong(orderId));
            dto.setOrigin(origin);
            dto.setDestination(destination);
            R<RouteVo> routeVoR = xpMapClient.getOrderDistanceAndDuration(dto);
            if (200 != routeVoR.getCode()) {
                throw new RuntimeException("获取订单线路和运费失败");
            }
            XpVehicle xpVehicle = xpVehicleClient.queryById(xpOrder.getVehicleId()).getData();
            RouteVo routeVo = routeVoR.getData();
            R<String> stringR = xpMapClient.queryRouted(routeVo.getRouteID());
            vehicleId = xpOrder.getVehicleId();
        }
        if(StringUtils.isNotEmpty(routeID)){
            XpVehicle xpVehicle = xpVehicleClient.queryById(vehicleId).getData();
            R<String> stringR = xpMapClient.queryRouted(routeID);
            if (200 != stringR.getCode()) {
                throw new RuntimeException("根据导航ID获取车端需要的导航数据失败");
            }
            //构建导航下发请求对象
            cloudPushNavigationInfo(requestId, routeVo.getRouteID(), stringR.getData(), orderId, xpVehicle.getVehicleVin(), xpVehicle.getXpuId());
            cloudPushNavigationInfo(requestId, routeID, stringR.getData(), orderId, xpVehicle.getVehicleVin(), xpVehicle.getXpuId());
        }
    }
xp-robotaxi-automatic-pilot-boot/src/main/resources/seata.conf
@@ -1,5 +1,7 @@
# seata.conf
shardingsphere.transaction.seata.at.enable = true
shardingsphere.transaction.seata.tx.timeout = 60
client {
    application.id = "xp-automaticPilot"  # 与spring.application.name一致
    application.id = "xp-robotaxi-automatic-pilot-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
}
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/service/impl/XpPricingServiceImpl.java
@@ -351,7 +351,8 @@
        String voJsonStr = JSONObject.toJSONString(routeAndFareVo);
        // 进行缓存
        redisService.setCacheObject(key, voJsonStr, 5l, TimeUnit.MINUTES);
        //缓存导航数据,用于下单后推送导航给车端和乘客端
        redisService.setCacheObject("ORDER_NAVIGATION_DATA:" + userId, JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS);
        return routeAndFareVo;
    }
xp-robotaxi-itinerary-boot/src/main/resources/seata.conf
@@ -1,4 +1,6 @@
# seata.conf
shardingsphere.transaction.seata.at.enable = true
shardingsphere.transaction.seata.tx.timeout = 60
client {
    application.id = "xp-robotaxi-itinerary-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
xp-robotaxi-maintenance-boot/src/main/resources/seata.conf
@@ -1,4 +1,6 @@
# seata.conf
shardingsphere.transaction.seata.at.enable = true
shardingsphere.transaction.seata.tx.timeout = 60
client {
    application.id = "xp-robotaxi-maintenance-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
xp-robotaxi-map-boot/src/main/resources/seata.conf
@@ -1,4 +1,6 @@
# seata.conf
shardingsphere.transaction.seata.at.enable = true
shardingsphere.transaction.seata.tx.timeout = 60
client {
    application.id = "xp-robotaxi-map-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
xp-robotaxi-operation-boot/src/main/resources/bootstrap.yml
@@ -160,95 +160,3 @@
          - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
---
#---
#spring:
#  shardingsphere:
#    props:
#      sql-show: true
#      sql-simple: true
#    datasource:
#      names: xp0
#      xp0:
#        type: com.alibaba.druid.pool.DruidDataSource
#        driver-class-name: com.mysql.cj.jdbc.Driver
#        url: jdbc:mysql://192.168.110.34:3306/xprt_operation?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#        username: root
#        password: 123456
#    rules:
#      sharding:
#        tables:
#          sys_oper_log:
#            actual-data-nodes: xp0.sys_oper_log
#            database-strategy:
#              standard:
#                sharding-column: userId
#                sharding-algorithm-name: sys-oper-log-inline
#            key-generate-strategy:
#              column: oper_id
#              key-generator-name: snowflake
#          xp_agreement_app_user:
#            actual-data-nodes: xp0.xp_agreement_app_user
#            database-strategy:
#              standard:
#                sharding-column: app_user_id
#                sharding-algorithm-name: xp-agreement-app-user-inline
#            key-generate-strategy:
#              column: id
#              key-generator-name: snowflake
#          xp_point:
#            actual-data-nodes: xp0.xp_point
#            database-strategy:
#              standard:
#                sharding-column: id
#                sharding-algorithm-name: xp-point-inline
#            key-generate-strategy:
#              column: id
#              key-generator-name: snowflake
#        sharding-algorithms:
#          sys-oper-log-inline:
#            type: INLINE
#            props:
#              algorithm-expression: sys_oper_log
#          xp-agreement-app-user-inline:
#            type: INLINE
#            props:
#              algorithm-expression: xp_agreement_app_user
#          xp-point-inline:
#            type: INLINE
#            props:
#              algorithm-expression: xp_point
#        key-generators:
#          snowflake:
#            type: SNOWFLAKE
#    single-table:
#      tables:
#        - xp0.sys_config
#        - xp0.sys_dict_data
#        - xp0.sys_dict_type
#        - xp0.sys_logininfor
#        - xp0.sys_menu
#        - xp0.xp_acticity
#        - xp0.xp_acticity_coupon
#        - xp0.xp_agreement
#        - xp0.xp_banner
#        - xp0.xp_coupon
#        - xp0.xp_electronic_fence
#        - xp0.xp_electronic_fence_area
#        - xp0.xp_feedback_type
#        - xp0.xp_frequently_asked_questions
#        - xp0.xp_invitation_code
#        - xp0.xp_notification
#        - xp0.xp_open_city
#        - xp0.xp_pricing
#        - xp0.xp_pricing_item
#        - xp0.xp_region
#        - xp0.xp_ride_guide
#        - xp0.xp_route_plan
#        - xp0.xp_system_setting
#        - xp0.xp_trading_strategy
#        - xp0.xp_trading_strategy_city
#        - xp0.xp_user_feedback
#        - xp0.xp_whitelist
#        - xp0.xp_whitelist_operlog
xp-robotaxi-operation-boot/src/main/resources/seata.conf
@@ -1,4 +1,6 @@
# seata.conf
shardingsphere.transaction.seata.at.enable = true
shardingsphere.transaction.seata.tx.timeout = 60
client {
    application.id = "xp-robotaxi-operation-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
xp-robotaxi-order-boot/src/main/resources/seata.conf
@@ -1,4 +1,6 @@
# seata.conf
shardingsphere.transaction.seata.at.enable = true
shardingsphere.transaction.seata.tx.timeout = 60
client {
    application.id = "xp-robotaxi-order-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
xp-robotaxi-payment-boot/src/main/resources/seata.conf
@@ -1,4 +1,6 @@
# seata.conf
shardingsphere.transaction.seata.at.enable = true
shardingsphere.transaction.seata.tx.timeout = 60
client {
    application.id = "xp-robotaxi-payment-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
xp-robotaxi-push-message-boot/src/main/resources/seata.conf
@@ -1,4 +1,6 @@
# seata.conf
shardingsphere.transaction.seata.at.enable = true
shardingsphere.transaction.seata.tx.timeout = 60
client {
    application.id = "xp-robotaxi-push-message-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
xp-robotaxi-remote-driving-boot/src/main/resources/seata.conf
@@ -1,4 +1,6 @@
# seata.conf
shardingsphere.transaction.seata.at.enable = true
shardingsphere.transaction.seata.tx.timeout = 60
client {
    application.id = "xp-robotaxi-remote-driving-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"
xp-robotaxi-vehicle-convoy-boot/src/main/resources/seata.conf
@@ -1,4 +1,6 @@
# seata.conf
shardingsphere.transaction.seata.at.enable = true
shardingsphere.transaction.seata.tx.timeout = 60
client {
    application.id = "xp-robotaxi-vehicle-convoy-boot"  # 与spring.application.name一致
    transaction.service.group = "seata_tx_group"