xuhy
2026-04-17 50cc796344bfce02e9281c5f19669248d0f790f9
Merge branch '1.0' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi into 1.0
6个文件已修改
153 ■■■■■ 已修改文件
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/KafkaTestController.java 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/resources/bootstrap.yml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/SubscribeMessageUtil.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/resources/bootstrap.yml 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/KafkaTestController.java
@@ -1,64 +1,64 @@
package com.xiaopeng.automaticPilot.controller;
import com.alibaba.fastjson2.JSONObject;
import com.xiaopeng.api.vo.automaticPilot.MqttPublishVo;
import com.xiaopeng.automaticPilot.service.KafkaConsumerService;
import com.xiaopeng.common.core.domain.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
public class KafkaTestController {
    @Autowired
    private KafkaConsumerService kafkaConsumerService;
    //TODO 少了factory属性声明
    /**
     * 消费消息 - XPU上报Robotaxi云端的消息topic(高优先级)
     *
     * @param message 消息内容
     */
    @PostMapping("/test/kafka/xpu-high")
    @KafkaListener(topics = "topic-prod-robotaxi-xpu-high", groupId = "group-robotaxi-xpu")
    public void topicProdRobotaxiXpuHigh(@RequestBody String message) {
        log.info("收到XPU上报高优先级主题消息: {}", message);
        kafkaConsumerService.topicProdRobotaxiXpuHigh(message);
    }
    //TODO 少了factory属性声明
    /**
     * 消费消息 - XPU上报Robotaxi云端的消息topic(低优先级)
     *
     * @param message 消息内容
     */
    @PostMapping("/test/kafka/xpu-normal")
    @KafkaListener(topics = "topic-prod-robotaxi-xpu-normal", groupId = "group-robotaxi-xpu")
    public void topicProdRobotaxiXpuNormal(String message) {
        log.info("收到XPU上报低优先级主题消息: {}", message);
        kafkaConsumerService.topicProdRobotaxiXpuNormal(message);
    }
    /**
     * 模拟推送XPU消息
     * @param message
     * @return
     */
    @PostMapping("/base/v1/pushXPUMessage")
    public R pushXPUMessage(@RequestBody String message) {
        log.info("收到XPU推送消息: {}", message);
        JSONObject json = new JSONObject();
        json.put("ts", System.currentTimeMillis());
        json.put("payload", message);
        kafkaConsumerService.topicProdRobotaxiXpuHigh(json.toJSONString());
        return R.ok();
    }
}
//package com.xiaopeng.automaticPilot.controller;
//
//import com.alibaba.fastjson2.JSONObject;
//import com.xiaopeng.api.vo.automaticPilot.MqttPublishVo;
//import com.xiaopeng.automaticPilot.service.KafkaConsumerService;
//import com.xiaopeng.common.core.domain.R;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.kafka.annotation.KafkaListener;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RestController;
//
//@Slf4j
//@RestController
//public class KafkaTestController {
//
//    @Autowired
//    private KafkaConsumerService kafkaConsumerService;
//
//    //TODO 少了factory属性声明
//
//    /**
//     * 消费消息 - XPU上报Robotaxi云端的消息topic(高优先级)
//     *
//     * @param message 消息内容
//     */
//    @PostMapping("/test/kafka/xpu-high")
//    @KafkaListener(topics = "topic-prod-robotaxi-xpu-high", groupId = "group-robotaxi-xpu")
//    public void topicProdRobotaxiXpuHigh(@RequestBody String message) {
//        log.info("收到XPU上报高优先级主题消息: {}", message);
//        kafkaConsumerService.topicProdRobotaxiXpuHigh(message);
//    }
//
//    //TODO 少了factory属性声明
//
//    /**
//     * 消费消息 - XPU上报Robotaxi云端的消息topic(低优先级)
//     *
//     * @param message 消息内容
//     */
//    @PostMapping("/test/kafka/xpu-normal")
//    @KafkaListener(topics = "topic-prod-robotaxi-xpu-normal", groupId = "group-robotaxi-xpu")
//    public void topicProdRobotaxiXpuNormal(String message) {
//        log.info("收到XPU上报低优先级主题消息: {}", message);
//        kafkaConsumerService.topicProdRobotaxiXpuNormal(message);
//    }
//
//    /**
//     * 模拟推送XPU消息
//     * @param message
//     * @return
//     */
//    @PostMapping("/base/v1/pushXPUMessage")
//    public R pushXPUMessage(@RequestBody String message) {
//        log.info("收到XPU推送消息: {}", message);
//        JSONObject json = new JSONObject();
//        json.put("ts", System.currentTimeMillis());
//        json.put("payload", message);
//        kafkaConsumerService.topicProdRobotaxiXpuHigh(json.toJSONString());
//        return R.ok();
//    }
//}
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -65,9 +65,7 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
/**
xp-robotaxi-map-boot/src/main/resources/bootstrap.yml
@@ -29,6 +29,7 @@
        namespace: 88de3938-82f9-4cab-97cf-6173202703e0
        username: nacos
        password: nacos
        ip: 192.168.110.85
      config:
        # 配置中心地址
        server-addr: 192.168.110.80:8848
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -3255,16 +3255,19 @@
                //生成前往上车点的导航数据
                //查询车辆位置
                VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(dto.getXpVehicleVin())), VehiclePosition.class);
                if (Objects.isNull(vehiclePosition)) {
                    throw new RuntimeException("车辆位置信息不存在");
                }
                //TODO 本地环境默认写死
                // VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(dto.getXpVehicleVin())), VehiclePosition.class);
                // if (Objects.isNull(vehiclePosition)) {
                //     throw new RuntimeException("车辆位置信息不存在");
                // }
                LonLatDto destination = new LonLatDto();
                LonLatDto origin = new LonLatDto();
                //查询司机当前位置到起点的线路
                origin.setLongitude(vehiclePosition.getPoint().getX());
                origin.setLatitude(vehiclePosition.getPoint().getY());
                // origin.setLongitude(vehiclePosition.getPoint().getX());
                // origin.setLatitude(vehiclePosition.getPoint().getY());
                origin.setLongitude(104.055499);
                origin.setLatitude(30.586747);
                destination.setLongitude(order.getStartLon());
                destination.setLatitude(order.getStartLat());
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/SubscribeMessageUtil.java
@@ -28,10 +28,10 @@
@Component
public class SubscribeMessageUtil {
    @Value("${wx.appletsAppid}")
    @Value("${wx.appletsAppid:1234}")
    private String wxAppletsAppid;
    @Value("${wx.appletsAppSecret}")
    @Value("${wx.appletsAppSecret:123456}")
    private String wxAppletsAppSecret;
    @Autowired
xp-robotaxi-push-message-boot/src/main/resources/bootstrap.yml
@@ -29,6 +29,7 @@
        namespace: 88de3938-82f9-4cab-97cf-6173202703e0
        username: nacos
        password: nacos
        ip: 192.168.110.85
      config:
        # 配置中心地址
        server-addr: 192.168.110.80:8848