puzhibing
2026-02-14 2499e326baa1585eeec40f2f3fd86b8c0e4adafa
Merge remote-tracking branch 'origin/master'

# Conflicts:
# xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpAgreementAppUser.java
2个文件已添加
8个文件已修改
552 ■■■■■ 已修改文件
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/vehicleConvoy/UpdateVehicleStateDto.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/vehicleConvoy/XpVehicleClientFallbackFactory.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/vehicleConvoy/XpVehicleClient.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/OrderMissionController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpAgreementUserController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/TaskOrderUtil.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/utils/TaxiPricingDemoService.java 320 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/utils/TrajectoryGenerator.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/controller/XpVehicleController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/vehicleConvoy/UpdateVehicleStateDto.java
New file
@@ -0,0 +1,18 @@
package com.xiaopeng.api.dto.vehicleConvoy;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@ApiModel("更新车辆状态")
@AllArgsConstructor
@NoArgsConstructor
public class UpdateVehicleStateDto {
    // 车辆vin
    private String vin;
    // 车辆状态
    private Integer state;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/vehicleConvoy/XpVehicleClientFallbackFactory.java
@@ -1,6 +1,7 @@
package com.xiaopeng.api.factory.vehicleConvoy;
import com.xiaopeng.api.dto.operation.VehiclePositionByVinDto;
import com.xiaopeng.api.dto.vehicleConvoy.UpdateVehicleStateDto;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import com.xiaopeng.api.vo.automaticPilot.VehiclePosition;
@@ -73,6 +74,12 @@
                log.error("根据车辆xpuid查询车辆信息,原因: {}", cause.getMessage());
                return R.fail();
            }
            @Override
            public R<?> updateVehicleStatus(UpdateVehicleStateDto updateVehicleStateDto) {
                log.error("更新车辆状态失败,原因: {}", cause.getMessage());
                return R.fail();
            }
        };
    }
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/vehicleConvoy/XpVehicleClient.java
@@ -1,6 +1,7 @@
package com.xiaopeng.api.feignClient.vehicleConvoy;
import com.xiaopeng.api.dto.operation.VehiclePositionByVinDto;
import com.xiaopeng.api.dto.vehicleConvoy.UpdateVehicleStateDto;
import com.xiaopeng.api.factory.vehicleConvoy.XpVehicleClientFallbackFactory;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import com.xiaopeng.common.core.domain.R;
@@ -91,4 +92,14 @@
     */
    @GetMapping("/inner/vehicle/findByVehicleXpuId")
    R<XpVehicle> findByVehicleXpuId(@RequestParam("xpuid") String xpuid);
    /**
     * 修改车辆状态
     *
     * @param updateVehicleStateDto
     * @return
     */
    @PostMapping("/inner/vehicle/updateVehicleStatus")
    R<?> updateVehicleStatus(@RequestBody UpdateVehicleStateDto updateVehicleStateDto);
}
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/OrderMissionController.java
@@ -3,6 +3,8 @@
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;
@@ -29,10 +31,12 @@
    private final XPUUtil xpuUtil;
    private final RedisService redisService;
    private final XpVehicleClient xpVehicleClient;
    public OrderMissionController(XPUUtil xpuUtil, RedisService redisService) {
    public OrderMissionController(XPUUtil xpuUtil, RedisService redisService, XpVehicleClient xpVehicleClient) {
        this.xpuUtil = xpuUtil;
        this.redisService = redisService;
        this.xpVehicleClient = xpVehicleClient;
    }
@@ -50,6 +54,9 @@
        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);
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpAgreementUserController.java
@@ -1,5 +1,7 @@
package com.xiaopeng.operation.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xiaopeng.api.model.maintenance.XpAgreementAppUser;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.controller.BaseController;
import com.xiaopeng.common.core.web.domain.AjaxResult;
@@ -43,5 +45,20 @@
    }
    /**
     * 用户获取隐私协议/法律条款操作
     */
    @ApiOperation(value = "用户获取隐私协议/法律条款操作",tags = {"小程序-用户协议"})
    @PostMapping("/privacy/getAgreement")
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<Boolean> getPrivacyAgreement(HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        long count = xpAgreementAppUserService.count(new LambdaQueryWrapper<XpAgreementAppUser>().eq(XpAgreementAppUser::getAppUserId, uid));
        if (count > 0) {
            return R.ok(true);
        }
        return R.ok(false);
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/TaskOrderUtil.java
@@ -780,6 +780,8 @@
                        // 调用推送服务  orderId + carVin
                        orderMissionClient.pushOrder(pushOrderDto);
                        redisService.popFirstElement(quoteName);
                        return;
                    } catch (Exception e) {
                        e.printStackTrace();
                    } finally {
@@ -813,6 +815,8 @@
                        // 调用推送服务  orderId + carVin
                        orderMissionClient.pushOrder(pushOrderDto);
                        redisService.popFirstElement(quoteName);
                        return;
                    } catch (Exception e) {
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -77,6 +77,7 @@
import com.xiaopeng.order.service.IXpOrderReassignService;
import com.xiaopeng.order.service.IXpOrderService;
import com.xiaopeng.order.utils.TaxiPricingDemoService;
import com.xiaopeng.order.utils.TrajectoryGenerator;
import com.xiaopeng.order.utils.holiday.HolidayUtil;
import com.xiaopeng.order.vo.OrderDetailVo;
import io.swagger.annotations.ApiModelProperty;
@@ -757,11 +758,14 @@
        }
        // 下发命令
        PushOrderDto pushOrderDto = new PushOrderDto();
        pushOrderDto.setOrderId(order.getId());
        pushOrderDto.setVin(xpVehicle.getVehicleVin());
        pushOrderDto.setOperation_type(OrderOperationType.VEHICLE_CANCEL_ORDER);
        orderMissionClient.cancelOrder(pushOrderDto);
        if(order.getStatus()>1){
            PushOrderDto pushOrderDto = new PushOrderDto();
            pushOrderDto.setOrderId(order.getId());
            pushOrderDto.setVin(xpVehicle.getVehicleVin());
            pushOrderDto.setOperation_type(OrderOperationType.VEHICLE_CANCEL_ORDER);
            orderMissionClient.cancelOrder(pushOrderDto);
        }
    }
    @Override
@@ -802,11 +806,14 @@
        log.info("订单取消消息推送完毕");
        // 下发命令
        PushOrderDto pushOrderDto = new PushOrderDto();
        pushOrderDto.setOrderId(order.getId());
        pushOrderDto.setVin(xpVehicle.getVehicleVin());
        pushOrderDto.setOperation_type(OrderOperationType.CLOUD_CANCEL_ORDER);
        orderMissionClient.cancelOrder(pushOrderDto);
        if(order.getStatus()>1){
            PushOrderDto pushOrderDto = new PushOrderDto();
            pushOrderDto.setOrderId(order.getId());
            pushOrderDto.setVin(xpVehicle.getVehicleVin());
            pushOrderDto.setOperation_type(OrderOperationType.CLOUD_CANCEL_ORDER);
            orderMissionClient.cancelOrder(pushOrderDto);
        }
    }
    /**
@@ -943,8 +950,8 @@
            cancelTaxiPassengerVo.setVin(vehicle.getVehicleVin());
            cancelTaxiPassengerVo.setUid(uid);
            cancelTaxiPassengerVo.setOrderNo(order.getOrderNumber());
//            cancelTaxiPassengerVo.setAppId();
            // TODO 加配置文件取
            cancelTaxiPassengerVo.setAppId("");
            userVehicleClient.cancelTaxiPassenger(cancelTaxiPassengerVo);
        }
        // 根据订单所属开通城市id 查询定价
@@ -954,25 +961,37 @@
            throw new ServiceException("当前城市未配置定价规则", I18nKeyConstant.ORDER_PRICING_NOT_EXISTS);
        }
        // 费用
        // 查询订单轨迹
        List<OrderTrajectory> trajectories = mongoTemplate.find(
                new Query(Criteria.where("orderId").is(orderId))
                        .with(Sort.by(Sort.Direction.ASC, "locatetime")),
                OrderTrajectory.class
        );
        List<TaxiPricingDemoService.GpsPoint> gpsPoints = new ArrayList<>();
        for (OrderTrajectory trajectory : trajectories) {
            TaxiPricingDemoService.GpsPoint point = new TaxiPricingDemoService.GpsPoint(trajectory.getDistance(), trajectory.getLocatetime());
            gpsPoints.add(point);
        }
//        // 查询订单轨迹
//        List<OrderTrajectory> trajectories = mongoTemplate.find(
//                new Query(Criteria.where("orderId").is(orderId))
//                        .with(Sort.by(Sort.Direction.ASC, "locatetime")),
//                OrderTrajectory.class
//        );
//        List<TaxiPricingDemoService.GpsPoint> gpsPoints = new ArrayList<>();
//        for (OrderTrajectory trajectory : trajectories) {
//            TaxiPricingDemoService.GpsPoint point = new TaxiPricingDemoService.GpsPoint(trajectory.getDistance(), trajectory.getLocatetime());
//            gpsPoints.add(point);
//        }
    // 补充临时轨迹数据
        List<TaxiPricingDemoService.GpsPoint> gpsPoints = TaxiPricingDemoService.createMockGpsPoints(DateUtils.toDate(order.getCreateTime()));
        TaxiPricingDemoService.PricingConfig config = new TaxiPricingDemoService.PricingConfig();
        JSONArray startingFareJsonArray = JSONArray.parseArray(pricing.getStartingFareJson());
        JSONObject basicPricingJson = JSONObject.parseObject(pricing.getBasicPricingJson());
        config.peaks.add(new TaxiPricingDemoService.PricingRule("高峰期", basicPricingJson.getString("num21").split("-")[0], basicPricingJson.getString("num21").split("-")[1], Double.parseDouble(basicPricingJson.getString("num24")), Double.parseDouble(basicPricingJson.getString("num25")), Double.parseDouble(basicPricingJson.getString("num26")), Double.parseDouble(basicPricingJson.getString("num27")), Double.parseDouble(basicPricingJson.getString("num28"))));
        config.peaks.add(new TaxiPricingDemoService.PricingRule("高峰期", basicPricingJson.getString("num22").split("-")[0], basicPricingJson.getString("num22").split("-")[1], Double.parseDouble(basicPricingJson.getString("num24")), Double.parseDouble(basicPricingJson.getString("num25")), Double.parseDouble(basicPricingJson.getString("num26")), Double.parseDouble(basicPricingJson.getString("num27")), Double.parseDouble(basicPricingJson.getString("num28"))));
        config.night = new TaxiPricingDemoService.PricingRule("夜间行驶", basicPricingJson.getString("num14").split("-")[0], basicPricingJson.getString("num14").split("-")[1], Double.parseDouble(basicPricingJson.getString("num16")), Double.parseDouble(basicPricingJson.getString("num17")), Double.parseDouble(basicPricingJson.getString("num18")), Double.parseDouble(basicPricingJson.getString("num19")), Double.parseDouble(basicPricingJson.getString("num20")));
        config.holiday = new TaxiPricingDemoService.PricingRule("节假日", "00:00", "23:59", Double.parseDouble(basicPricingJson.getString("num30")), Double.parseDouble(basicPricingJson.getString("num31")), Double.parseDouble(basicPricingJson.getString("num32")), Double.parseDouble(basicPricingJson.getString("num33")), Double.parseDouble(basicPricingJson.getString("num234")));
        if(pricing.getPricingType()==1){
            JSONObject basicPricingJson = JSONObject.parseObject(pricing.getBasicPricingJson());
            config.peaks.add(new TaxiPricingDemoService.PricingRule("高峰期", basicPricingJson.getString("num21").split("-")[0], basicPricingJson.getString("num21").split("-")[1], Double.parseDouble(basicPricingJson.getString("num24")), Double.parseDouble(basicPricingJson.getString("num25")), Double.parseDouble(basicPricingJson.getString("num26")), Double.parseDouble(basicPricingJson.getString("num27")), Double.parseDouble(basicPricingJson.getString("num28"))));
            config.peaks.add(new TaxiPricingDemoService.PricingRule("高峰期", basicPricingJson.getString("num22").split("-")[0], basicPricingJson.getString("num22").split("-")[1], Double.parseDouble(basicPricingJson.getString("num24")), Double.parseDouble(basicPricingJson.getString("num25")), Double.parseDouble(basicPricingJson.getString("num26")), Double.parseDouble(basicPricingJson.getString("num27")), Double.parseDouble(basicPricingJson.getString("num28"))));
            config.night = new TaxiPricingDemoService.PricingRule("夜间行驶", basicPricingJson.getString("num14").split("-")[0], basicPricingJson.getString("num14").split("-")[1], Double.parseDouble(basicPricingJson.getString("num16")), Double.parseDouble(basicPricingJson.getString("num17")), Double.parseDouble(basicPricingJson.getString("num18")), Double.parseDouble(basicPricingJson.getString("num19")), Double.parseDouble(basicPricingJson.getString("num20")));
            config.holiday = new TaxiPricingDemoService.PricingRule("节假日", "00:00", "23:59", Double.parseDouble(basicPricingJson.getString("num30")), Double.parseDouble(basicPricingJson.getString("num31")), Double.parseDouble(basicPricingJson.getString("num32")), Double.parseDouble(basicPricingJson.getString("num33")), Double.parseDouble(basicPricingJson.getString("num234")));
            // --- 远途加价区间配置 (关键修改) ---
            // 1. 超过 num1(12) 不足 num2(20), 加收 num3(1.2)
            config.longSteps.add(new TaxiPricingDemoService.LongRangeStep(Double.parseDouble(basicPricingJson.getString("num6")), Double.parseDouble(basicPricingJson.getString("num7")), Double.parseDouble(basicPricingJson.getString("num8"))));
            // 2. 超过 num4(20) 不足 num5(35), 加收 num6(2.0)
            config.longSteps.add(new TaxiPricingDemoService.LongRangeStep(Double.parseDouble(basicPricingJson.getString("num9")), Double.parseDouble(basicPricingJson.getString("num10")), Double.parseDouble(basicPricingJson.getString("num11"))));
            // 3. 超过 num7(35) 以后, 加收 num8(3.5) -> numEnd 传个极大值
            config.longSteps.add(new TaxiPricingDemoService.LongRangeStep(Double.parseDouble(basicPricingJson.getString("num12")), 999999, Double.parseDouble(basicPricingJson.getString("num13"))));
        }
        for (Object o : startingFareJsonArray) {
            // 转化为jsonObject
            JSONObject jsonObject = (JSONObject) o;
@@ -985,13 +1004,7 @@
            String num7 = jsonObject.getString("num7");
            config.normals.add(new TaxiPricingDemoService.PricingRule("普通时段", num1, num2, Double.parseDouble(num3), Double.parseDouble(num4), Double.parseDouble(num5), Double.parseDouble(num6), Double.parseDouble(num7)));
        }
        // --- 远途加价区间配置 (关键修改) ---
        // 1. 超过 num1(12) 不足 num2(20), 加收 num3(1.2)
        config.longSteps.add(new TaxiPricingDemoService.LongRangeStep(Double.parseDouble(basicPricingJson.getString("num6")), Double.parseDouble(basicPricingJson.getString("num7")), Double.parseDouble(basicPricingJson.getString("num8"))));
        // 2. 超过 num4(20) 不足 num5(35), 加收 num6(2.0)
        config.longSteps.add(new TaxiPricingDemoService.LongRangeStep(Double.parseDouble(basicPricingJson.getString("num9")), Double.parseDouble(basicPricingJson.getString("num10")), Double.parseDouble(basicPricingJson.getString("num11"))));
        // 3. 超过 num7(35) 以后, 加收 num8(3.5) -> numEnd 传个极大值
        config.longSteps.add(new TaxiPricingDemoService.LongRangeStep(Double.parseDouble(basicPricingJson.getString("num12")), 999999, Double.parseDouble(basicPricingJson.getString("num13"))));
        TaxiPricingDemoService.TaxiPricingService service = new TaxiPricingDemoService.TaxiPricingService();
        Map<String, BigDecimal> bill = service.calculateOrderPrice(DateUtils.toDate(order.getCreateTime()), order.getMileageKilometers(), gpsPoints, config);
@@ -1541,11 +1554,15 @@
            }
        }
        List<OrderTrajectory> trajectories = mongoTemplate.find(
                new Query(Criteria.where("orderId").is(orderId))
                        .with(Sort.by(Sort.Direction.ASC, "locatetime")),
                OrderTrajectory.class
        );
//        List<OrderTrajectory> trajectories = mongoTemplate.find(
//                new Query(Criteria.where("orderId").is(orderId))
//                        .with(Sort.by(Sort.Direction.ASC, "locatetime")),
//                OrderTrajectory.class
//        );
        List<TaxiPricingDemoService.GpsPoint> mockGpsPoints = TaxiPricingDemoService.createMockGpsPoints(DateUtils.toDate(order.getCreateTime()));
        // 生成轨迹记录
        List<OrderTrajectory> trajectories = TrajectoryGenerator.generateTrajectory(mockGpsPoints);
        orderDetailVo.setTrajectories(trajectories);
        if (order.getTripBegin() != null && order.getTripEnd() != null) {
            // 计算两个时间相差多少分钟
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/utils/TaxiPricingDemoService.java
@@ -270,7 +270,7 @@
        return config;
    }
    private static List<GpsPoint> createMockGpsPoints(Date startTime) {
    public static List<GpsPoint> createMockGpsPoints(Date startTime) {
        List<GpsPoint> list = new ArrayList<>();
        long startTs = startTime.getTime();
        list.add(new GpsPoint(0, startTs));
@@ -318,6 +318,324 @@
        list.add(new GpsPoint(182, startTs + 2 * 410 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 420 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 430 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 440 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 450 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 460 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 470 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 490 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 500 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 510 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 520 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 530 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 540 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 550 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 560 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 570 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 590 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 600 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 1980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 2980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3180 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3280 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3480 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3580 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3680 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3780 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3880 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 3980 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 4080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 4080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 4080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 4080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 4080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 4080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 4080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 4080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 4080 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 4180 * 1000));
        return list;
    }
}
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/utils/TrajectoryGenerator.java
New file
@@ -0,0 +1,55 @@
package com.xiaopeng.order.utils;
import com.xiaopeng.order.mangodb.model.OrderTrajectory;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class TrajectoryGenerator {
    // 成都市中心经纬度(示例)
    private static final double BASE_LAT = 30.5728; // 纬度
    private static final double BASE_LON = 104.0668; // 经度
    /**
     * 根据 GpsPoint 数据生成 OrderTrajectory 轨迹记录
     *
     * @param gpsPoints 模拟的 GpsPoint 数据
     * @return 轨迹记录列表
     */
    public static List<OrderTrajectory> generateTrajectory(List<TaxiPricingDemoService.GpsPoint> gpsPoints) {
        List<OrderTrajectory> trajectories = new ArrayList<>();
        // 初始位置
        double currentLat = BASE_LAT;
        double currentLon = BASE_LON;
        for (int i = 0; i < gpsPoints.size(); i++) {
            TaxiPricingDemoService.GpsPoint point = gpsPoints.get(i);
            // 生成随机偏移量(确保相邻点距离不超过100米)
            double deltaLat = (Math.random() - 0.5) * 0.001; // 纬度偏移
            double deltaLon = (Math.random() - 0.5) * 0.001; // 经度偏移
            // 更新当前位置
            currentLat += deltaLat;
            currentLon += deltaLon;
            // 创建 OrderTrajectory 对象
            OrderTrajectory trajectory = new OrderTrajectory();
            trajectory.setOrderId(1L); // 假设订单 ID 为 1
            trajectory.setLocation(String.format("%.6f,%.6f", currentLon, currentLat)); // 经纬度格式化
            trajectory.setDirection((int) (Math.random() * 360)); // 随机方向角
            trajectory.setSpeed(Math.random() * 50); // 随机速度(0~50 km/h)
            trajectory.setLocatetime(point.getLocatetime()); // 时间戳
            trajectory.setDistance(point.getDistance()); // 距离
            trajectories.add(trajectory);
        }
        return trajectories;
    }
}
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/controller/XpVehicleController.java
@@ -8,7 +8,9 @@
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.xiaopeng.api.dto.operation.VehiclePositionByVinDto;
import com.xiaopeng.api.dto.vehicleConvoy.UpdateVehicleStateDto;
import com.xiaopeng.api.dto.vehicleConvoy.VehicleTemperatureDto;
import com.xiaopeng.api.feignClient.maintenance.XpChargingRecordClient;
import com.xiaopeng.api.feignClient.maintenance.XpVehiclePreparationClient;
@@ -417,6 +419,16 @@
        return R.ok(xpVehicle);
    }
    /**
     * 修改车辆状态
     * @param updateVehicleStateDto
     * @return
     */
    @PostMapping("/inner/vehicle/updateVehicleStatus")
    public R<?> updateVehicleStatus(@RequestBody UpdateVehicleStateDto updateVehicleStateDto){
        xpVehicleService.update(new LambdaUpdateWrapper<XpVehicle>().eq(XpVehicle::getVehicleVin, updateVehicleStateDto.getVin()).set(XpVehicle::getState, updateVehicleStateDto.getState()));
        return R.ok();
    }
    /**
     * 查询可改派的车辆列表