liujie
2026-03-01 4f01fa9a654ea4935d6bf8ce97c2485a9113497d
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/OrderMissionController.java
@@ -32,6 +32,7 @@
import com.xiaopeng.common.redis.service.RedisService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.geo.Point;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.geo.GeoJsonPoint;
import org.springframework.data.mongodb.core.query.Criteria;
@@ -181,7 +182,7 @@
        //构建推送消息
        Map<String, Object> params = new HashMap<>();
        Map<String, Object> content = new HashMap<>();
        content.put("orderId", orderId);
        content.put("orderId", orderId.toString());
        content.put("status", 3);
        params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc());
        params.put("content", JSONObject.toJSONString(content));
@@ -228,7 +229,7 @@
                Double longitude = lonLatDto.getLongitude();
                //保存车辆实时位置到redis
                redisTemplate.opsForGeo().add("vehiclePosition:" + vin, new GeoJsonPoint(longitude, latitude), vin);
                redisTemplate.opsForGeo().add("vehiclePosition:" + vin, new Point(longitude, latitude), vin);
                //保存车辆实时信息到mongodb
                VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(vin)), VehiclePosition.class);
@@ -254,10 +255,11 @@
                    dto.setLatitude(latitude);
                    dto.setDuration(10);
                    dto.setDistance(2);
                    dto.setDirection(60);
                    xpPushMessageClient.pushOrderRoute(dto);
                }
                //5秒钟循环一次
                //2秒钟循环一次
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
@@ -268,7 +270,7 @@
            //构建推送消息
            Map<String, Object> params = new HashMap<>();
            Map<String, Object> content = new HashMap<>();
            content.put("orderId", orderId);
            content.put("orderId", orderId.toString());
            content.put("status", 4);
            params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc());
            params.put("content", JSONObject.toJSONString(content));
@@ -299,7 +301,7 @@
        //构建推送消息
        Map<String, Object> params = new HashMap<>();
        Map<String, Object> content = new HashMap<>();
        content.put("orderId", orderId);
        content.put("orderId", orderId.toString());
        content.put("status", status);
        params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc());
        params.put("content", JSONObject.toJSONString(content));
@@ -346,7 +348,7 @@
                Double longitude = lonLatDto.getLongitude();
                //保存车辆实时位置到redis
                redisTemplate.opsForGeo().add("vehiclePosition:" + vin, new GeoJsonPoint(longitude, latitude), vin);
                redisTemplate.opsForGeo().add("vehiclePosition:" + vin, new Point(longitude, latitude), vin);
                //保存车辆实时信息到mongodb
                VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(vin)), VehiclePosition.class);
@@ -372,6 +374,7 @@
                    dto.setLatitude(latitude);
                    dto.setDuration(20);
                    dto.setDistance(10);
                    dto.setDirection(60);
                    xpPushMessageClient.pushOrderRoute(dto);
                }
@@ -386,7 +389,7 @@
            //构建推送消息
            Map<String, Object> params = new HashMap<>();
            Map<String, Object> content = new HashMap<>();
            content.put("orderId", orderId);
            content.put("orderId", orderId.toString());
            content.put("status", 4);
            params.put("type", PushMessageTypeEnum.ORDER_STATUS.getDesc());
            params.put("content", JSONObject.toJSONString(content));