puzhibing
2026-03-24 faae742fccc00d629ede627819cdc9d8a4ec25d3
开发测试demo接口
9个文件已添加
28个文件已修改
6231 ■■■■■ 已修改文件
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/XpOpenCityClientFallbackFactory.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/XpRoutePlanClientFallbackFactory.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/XpTestPlanClientFallbackFactory.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/XpTestPointClientFallbackFactory.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/order/XpTestOrderClientFallbackFactory.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/operation/XpOpenCityClient.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/operation/XpRoutePlanClient.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/operation/XpTestPlanClient.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/operation/XpTestPointClient.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/order/XpTestOrderClient.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTestPlanPoint.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/OrderType.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/OrderMissionController.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-common/xp-common-core/src/main/java/com/xiaopeng/common/core/constant/TokenConstants.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpCruisePlanController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpOpenCityController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpRoutePlanController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpTestPlanController.java 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpTestPointManagementController.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/dto/XpTestPlanAddDTO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/mapper/XpTestPointMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpOpenCityService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpTestPointService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpOpenCityServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTestPlanServiceImpl.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTestPointServiceImpl.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/vo/XpTestPlanPointVO.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/constant/I18nKeyConstant.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpTestOrderController.java 314 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/model/vo/AddTestOrderVo.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/IXpTestOrderService.java 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpTestOrderServiceImpl.java 4664 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/webSocket/handler/WebSocketAuthHandler.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/service/impl/XpVehicleServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/XpOpenCityClientFallbackFactory.java
@@ -6,6 +6,7 @@
import com.xiaopeng.api.feignClient.operation.XpElectronicClient;
import com.xiaopeng.api.feignClient.operation.XpOpenCityClient;
import com.xiaopeng.api.model.operation.XpElectronicFence;
import com.xiaopeng.api.model.operation.XpOpenCity;
import com.xiaopeng.api.query.operation.ElectronicPageListQuery;
import com.xiaopeng.api.vo.operation.ElectronicFenceDetailVo;
import com.xiaopeng.common.core.domain.R;
@@ -28,6 +29,12 @@
                log.error("获取开通城市列表失败");
                return R.ok(new ArrayList<>());
            }
            @Override
            public R<XpOpenCity> getXpOpenCity(String provinceCode, String cityCode, String districtCode) {
                log.error("获取开通城市失败");
                return R.fail("获取开通城市失败");
            }
        };
    }
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/XpRoutePlanClientFallbackFactory.java
New file
@@ -0,0 +1,25 @@
package com.xiaopeng.api.factory.operation;
import com.xiaopeng.api.feignClient.operation.XpRoutePlanClient;
import com.xiaopeng.api.feignClient.operation.XpTestPlanClient;
import com.xiaopeng.api.model.operation.XpRoutePlan;
import com.xiaopeng.common.core.domain.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class XpRoutePlanClientFallbackFactory implements FallbackFactory<XpRoutePlanClient> {
    @Override
    public XpRoutePlanClient create(Throwable cause) {
        return new XpRoutePlanClient() {
            @Override
            public R<XpRoutePlan> getXpRoutePlanOpenCityId(Long openCityId) {
                log.error("根据openCityId获取路线规划配置失败:{}", cause.getMessage());
                return R.fail("根据openCityId获取路线规划配置失败");
            }
        };
    }
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/XpTestPlanClientFallbackFactory.java
New file
@@ -0,0 +1,48 @@
package com.xiaopeng.api.factory.operation;
import com.xiaopeng.api.feignClient.operation.XpTestPlanClient;
import com.xiaopeng.api.model.operation.XpTestPlan;
import com.xiaopeng.api.model.operation.XpTestPlanPoint;
import com.xiaopeng.api.model.operation.XpTestPlanVehicle;
import com.xiaopeng.api.model.operation.XpTestPoint;
import com.xiaopeng.common.core.domain.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import java.util.List;
@Slf4j
@Component
public class XpTestPlanClientFallbackFactory implements FallbackFactory<XpTestPlanClient> {
    @Override
    public XpTestPlanClient create(Throwable cause) {
        return new XpTestPlanClient() {
            @Override
            public R<XpTestPlan> getXpTestPlanById(Long id) {
                log.error("获取测试计划失败:{}", cause.getMessage());
                return R.fail("获取测试计划失败");
            }
            @Override
            public R<XpTestPlanPoint> getXpTestPlanPointById(Long id) {
                log.error("获取测试计划点失败:{}", cause.getMessage());
                return R.fail("获取测试计划点失败");
            }
            @Override
            public R<XpTestPoint> getXpTestPointById(Long id) {
                log.error("获取测试计划点位失败:{}", cause.getMessage());
                return R.fail("获取测试计划点位失败");
            }
            @Override
            public R<List<XpTestPlanVehicle>> getXpTestPlanVehicleByTestPlanId(Long testPlanId) {
                log.error("获取测试计划车辆失败:{}", cause.getMessage());
                return R.fail("获取测试计划车辆失败");
            }
        };
    }
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/XpTestPointClientFallbackFactory.java
New file
@@ -0,0 +1,48 @@
package com.xiaopeng.api.factory.operation;
import com.xiaopeng.api.dto.map.XpPointExportExcelQuery;
import com.xiaopeng.api.dto.operation.PointAddDto;
import com.xiaopeng.api.dto.operation.PointMapQuery;
import com.xiaopeng.api.dto.operation.PointUpdateDto;
import com.xiaopeng.api.dto.operation.XpPointEnableDisableDto;
import com.xiaopeng.api.dto.order.HistoryEndPointsDto;
import com.xiaopeng.api.dto.order.HistoryStartPointsDto;
import com.xiaopeng.api.feignClient.operation.XpPointClient;
import com.xiaopeng.api.feignClient.operation.XpTestPointClient;
import com.xiaopeng.api.model.operation.XpElectronicFenceArea;
import com.xiaopeng.api.model.operation.XpTestPoint;
import com.xiaopeng.api.query.operation.PointListQuery;
import com.xiaopeng.api.query.operation.PointPageListListQuery;
import com.xiaopeng.api.vo.order.XpHistoryEndPointsVo;
import com.xiaopeng.api.vo.order.XpHistoryStartPointsVo;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.page.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
@Slf4j
@Component
public class XpTestPointClientFallbackFactory implements FallbackFactory<XpTestPointClient> {
    @Override
    public XpTestPointClient create(Throwable cause) {
        return new XpTestPointClient() {
            @Override
            public R<XpTestPoint> queryById(Long id) {
                log.error("获取点位详情失败:{}", cause.getMessage());
                return R.fail("获取点位详情失败");
            }
            @Override
            public R<Boolean> nowInTimePoint(Long pointId) {
                log.error("判断点位是在有效期内失败:{}", cause.getMessage());
                return R.fail("判断点位是在有效期内失败");
            }
        };
    }
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/order/XpTestOrderClientFallbackFactory.java
New file
@@ -0,0 +1,32 @@
package com.xiaopeng.api.factory.order;
import com.xiaopeng.api.feignClient.order.XpTestOrderClient;
import com.xiaopeng.api.model.order.XpTestOrder;
import com.xiaopeng.common.core.domain.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class XpTestOrderClientFallbackFactory implements FallbackFactory<XpTestOrderClient> {
    @Override
    public XpTestOrderClient create(Throwable cause) {
        return new XpTestOrderClient(){
            @Override
            public R<XpTestOrder> queryOrderById(Long orderId) {
                log.error("通过订单id查询订单信息失败:{}",  cause.getMessage());
                return R.fail("通过订单id查询订单信息失败");
            }
            @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/operation/XpOpenCityClient.java
@@ -1,6 +1,7 @@
package com.xiaopeng.api.feignClient.operation;
import com.xiaopeng.api.factory.operation.XpOpenCityClientFallbackFactory;
import com.xiaopeng.api.model.operation.XpOpenCity;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.dto.ServiceNameConstantsEnum;
import org.springframework.cloud.openfeign.FeignClient;
@@ -15,4 +16,15 @@
    @GetMapping("/base/v1/mini-program/api/v1/openCity/nameList")
    R<List<String>> pageList(@RequestParam String cityIds);
    /**
     * 根据省市区获取开通城市数据
     * @param provinceCode
     * @param cityCode
     * @param districtCode
     * @return
     */
    R<XpOpenCity> getXpOpenCity(@RequestParam("provinceCode") String provinceCode,
                                @RequestParam("cityCode") String cityCode,
                                @RequestParam("districtCode") String districtCode);
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/operation/XpRoutePlanClient.java
New file
@@ -0,0 +1,22 @@
package com.xiaopeng.api.feignClient.operation;
import com.xiaopeng.api.factory.operation.XpRoutePlanClientFallbackFactory;
import com.xiaopeng.api.model.operation.XpRoutePlan;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.dto.ServiceNameConstantsEnum;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(contextId = "XpRoutePlanClient", value = ServiceNameConstantsEnum.XP_OPERATION_SERVICE, fallbackFactory = XpRoutePlanClientFallbackFactory.class)
public interface XpRoutePlanClient {
    /**
     * 根据openCityId获取路线规划配置
     * @param openCityId
     * @return
     */
    @PostMapping("/inner/v1/routePlan/getXpRoutePlanOpenCityId")
    R<XpRoutePlan> getXpRoutePlanOpenCityId(@RequestParam Long openCityId);
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/operation/XpTestPlanClient.java
New file
@@ -0,0 +1,57 @@
package com.xiaopeng.api.feignClient.operation;
import com.xiaopeng.api.factory.operation.XpTestPlanClientFallbackFactory;
import com.xiaopeng.api.model.operation.XpTestPlan;
import com.xiaopeng.api.model.operation.XpTestPlanPoint;
import com.xiaopeng.api.model.operation.XpTestPlanVehicle;
import com.xiaopeng.api.model.operation.XpTestPoint;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.dto.ServiceNameConstantsEnum;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(contextId = "XpTestPlanClient", value = ServiceNameConstantsEnum.XP_OPERATION_SERVICE, fallbackFactory = XpTestPlanClientFallbackFactory.class)
public interface XpTestPlanClient {
    /**
     * 根据id获取测试计划
     * @param id
     * @return
     */
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPlanById")
    R<XpTestPlan> getXpTestPlanById(@RequestParam Long id);
    /**
     * 根据id获取测试计划点
     * @param id
     * @return
     */
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPlanPointById")
    R<XpTestPlanPoint> getXpTestPlanPointById(@RequestParam Long id);
    /**
     * 根据id获取测试计划点位
     * @param id
     * @return
     */
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPointById")
    R<XpTestPoint> getXpTestPointById(@RequestParam Long id);
    /**
     * 根据测试计划获取车辆信息
     * @param testPlanId
     * @return
     */
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPlanVehicleByTestPlanId")
    R<List<XpTestPlanVehicle>> getXpTestPlanVehicleByTestPlanId(@RequestParam Long testPlanId);
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/operation/XpTestPointClient.java
New file
@@ -0,0 +1,32 @@
package com.xiaopeng.api.feignClient.operation;
import com.xiaopeng.api.factory.operation.XpTestPointClientFallbackFactory;
import com.xiaopeng.api.model.operation.XpTestPoint;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.dto.ServiceNameConstantsEnum;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(contextId = "XpTestPointClient", value = ServiceNameConstantsEnum.XP_OPERATION_SERVICE, fallbackFactory = XpTestPointClientFallbackFactory.class)
public interface XpTestPointClient {
    /**
     * 点位详情
     */
    @GetMapping("/api/v1/testPoint/queryPointById")
    R<XpTestPoint> queryById(@RequestParam Long id);
    /**
     * 判断点位是在有效期内
     *
     * @param pointId
     * @return
     */
    @GetMapping("/inner/v1/testPoint/nowInTimePoint")
    R<Boolean> nowInTimePoint(@RequestParam Long pointId);
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/order/XpTestOrderClient.java
New file
@@ -0,0 +1,36 @@
package com.xiaopeng.api.feignClient.order;
import com.xiaopeng.api.factory.order.XpTestOrderClientFallbackFactory;
import com.xiaopeng.api.model.order.XpTestOrder;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.dto.ServiceNameConstantsEnum;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(contextId = "XpTestOrderClient",
        value = ServiceNameConstantsEnum.XP_ORDER_SERVICE,
        fallbackFactory = XpTestOrderClientFallbackFactory.class)
public interface XpTestOrderClient {
    /**
     * 通过订单id查询订单信息
     *
     * @param orderId 订单id
     * @return 订单详情
     */
    @PostMapping("/inner/v1/testOrder/queryOrderById")
    R<XpTestOrder> queryOrderById(@RequestParam Long orderId);
    /**
     * 修改订单状态
     * @param orderId
     * @param status
     * @return
     */
    @PostMapping("/inner/v1/testOrder/updateOrderStatus")
    R<String> updateOrderStatus(@RequestParam Long orderId,
                                @RequestParam Integer status);
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpTestPlanPoint.java
@@ -35,13 +35,19 @@
    @ApiModelProperty(value = "测试计划ID")
    private Long testPlanId;
    @ApiModelProperty(value = "点位ID")
    private Long testPointId;
    @ApiModelProperty(value = "测试起点id")
    private Long startTestPointId;
    @ApiModelProperty(value = "排序")
    private Integer sortOrder;
    @ApiModelProperty(value = "测试终点id")
    private Long endTestPointId;
    @ApiModelProperty(value = "是否停车 0-否 1-是")
    private Integer stopFlag;
    @ApiModelProperty(value = "测试订单id")
    private Long testOrderId;
    @ApiModelProperty(value = "测试订单类型(1=测试单,2=巡游单)")
    private Long testOrderType;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/vo/OrderType.java
@@ -12,4 +12,8 @@
     * 乘客订单
     */
    String USER_ORDER = "user_order";
    /**
     * 测试订单
     */
    String TEST_ORDER = "test_order";
}
xp-robotaxi-api/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -44,4 +44,8 @@
com.xiaopeng.api.factory.maintenance.XpTaskRuleClientFallbackFactory
com.xiaopeng.api.factory.maintenance.XpWorkOrderClientFallbackFactory
com.xiaopeng.api.factory.pushMessage.XpAliPushMessageClientFallbackFactory
com.xiaopeng.api.factory.maintenance.XpVehicleRepairClientFallbackFactory
com.xiaopeng.api.factory.maintenance.XpVehicleRepairClientFallbackFactory
com.xiaopeng.api.factory.operation.XpTestPointClientFallbackFactory
com.xiaopeng.api.factory.operation.XpTestPlanClientFallbackFactory
com.xiaopeng.api.factory.operation.XpRoutePlanClientFallbackFactory
com.xiaopeng.api.factory.order.XpTestOrderClientFallbackFactory
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/OrderMissionController.java
@@ -98,7 +98,65 @@
            taskBuilder.setSequence(1);
            taskBuilder.addOrderPhase(OrderPhase.ROUTE_TO_CRUISE);
            taskListBuilder.addTasks(taskBuilder.build());
        }else{
        }else if(dto.getOrderType().equals(com.xiaopeng.api.vo.OrderType.USER_ORDER)){
            for (int i = 1; i < 3; i++) {
                RtTask.Builder taskBuilder = RtTask.newBuilder();
                taskBuilder.setOrderId(dto.getOrderId().toString());
                taskBuilder.setTaskId(snowflake.nextId() + "");
                taskBuilder.setTaskType(OrderType.ORDER_TYPE_ROBOTAXI);
                if(i == 1){
                    VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(dto.getVin())), VehiclePosition.class);
                    //构建车辆当前位置数据
                    pointBuilderStart.setWaypointId(dto.getOrderId() + "-JJ-001");
                    pointBuilderStart.setPointType(PointType.START_POINT);
                    pointBuilderStart.setActionType(ActionType.ACTION_UNSPECIFIED);
                    pointBuilderStart.setSequence(1);
                    GeoPoint.Builder geoPointBuilder = GeoPoint.newBuilder();
                    geoPointBuilder.setLatitude(vehiclePosition.getPoint().getY());
                    geoPointBuilder.setLongitude(vehiclePosition.getPoint().getX());
                    pointBuilderStart.setPoint(geoPointBuilder.build());
                    taskBuilder.addPoints(pointBuilderStart);
                    //构建上车点位置信息
                    pointBuilderEnd.setWaypointId(dto.getOrderId() + "-JJ-002");
                    pointBuilderEnd.setPointType(PointType.PICK_UP_POINT);
                    pointBuilderEnd.setActionType(ActionType.PICK_UP);
                    pointBuilderEnd.setSequence(2);
                    geoPointBuilder = GeoPoint.newBuilder();
                    geoPointBuilder.setLatitude(dto.getStartLatitude());
                    geoPointBuilder.setLongitude(dto.getStartLongitude());
                    pointBuilderEnd.setPoint(geoPointBuilder.build());
                    taskBuilder.addPoints(pointBuilderEnd);
                    taskBuilder.setSequence(i);
                    taskBuilder.addOrderPhase(OrderPhase.ROUTE_TO_PICKUP);
                }else{
                    //构建上车点位置信息
                    pointBuilderStart.setWaypointId(dto.getOrderId() + "-SD-001");
                    pointBuilderStart.setPointType(PointType.PICK_UP_POINT);
                    pointBuilderStart.setActionType(ActionType.PICK_UP);
                    pointBuilderStart.setSequence(1);
                    GeoPoint.Builder geoPointBuilder = GeoPoint.newBuilder();
                    geoPointBuilder.setLatitude(dto.getStartLatitude());
                    geoPointBuilder.setLongitude(dto.getStartLongitude());
                    pointBuilderStart.setPoint(geoPointBuilder.build());
                    taskBuilder.addPoints(pointBuilderStart);
                    //构建下车点位置信息
                    pointBuilderEnd.setWaypointId(dto.getOrderId() + "-SD-002");
                    pointBuilderEnd.setPointType(PointType.END_POINT);
                    pointBuilderEnd.setActionType(ActionType.DROP_OFF);
                    pointBuilderEnd.setSequence(2);
                    geoPointBuilder = GeoPoint.newBuilder();
                    geoPointBuilder.setLatitude(dto.getEndLatitude());
                    geoPointBuilder.setLongitude(dto.getEndLongitude());
                    pointBuilderEnd.setPoint(geoPointBuilder.build());
                    taskBuilder.addPoints(pointBuilderEnd);
                    taskBuilder.setSequence(i);
                    taskBuilder.addOrderPhase(OrderPhase.ROUTE_TO_DESTINATION);
                }
                taskListBuilder.addTasks(taskBuilder.build());
            }
        }else if(dto.getOrderType().equals(com.xiaopeng.api.vo.OrderType.TEST_ORDER)){
            for (int i = 1; i < 3; i++) {
                RtTask.Builder taskBuilder = RtTask.newBuilder();
                taskBuilder.setOrderId(dto.getOrderId().toString());
@@ -165,10 +223,17 @@
            // 修改车子为接单状态
            xpVehicleClient.updateVehicleStatus(new UpdateVehicleStateDto(dto.getVin(), 1));
        }
        if(null != mqttPublishDto && mqttPublishDto.getCode() == 200){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("event", SystemEventType.CREATE_ORDER);
            jsonObject.put("orderType", dto.getOrderId().contains("XU") ? com.xiaopeng.api.vo.OrderType.CRUISE_ORDER : com.xiaopeng.api.vo.OrderType.USER_ORDER);
            if(dto.getOrderId().contains("XU")){
                jsonObject.put("orderType",  com.xiaopeng.api.vo.OrderType.CRUISE_ORDER);
            }else if(dto.getOrderId().contains("TEST")){
                jsonObject.put("orderType",  com.xiaopeng.api.vo.OrderType.TEST_ORDER);
            }else {
                jsonObject.put("orderType",  com.xiaopeng.api.vo.OrderType.CRUISE_ORDER);
            }
            jsonObject.put("orderId", dto.getOrderId());
            jsonObject.put("vin", dto.getVin());
            redisService.setCacheObject("CREATE_ORDER:" + dto.getOrderId().toString(), jsonObject.toJSONString(),30L, TimeUnit.MINUTES);
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -21,11 +21,13 @@
import com.xiaopeng.api.feignClient.operation.XpCruisePlanClient;
import com.xiaopeng.api.feignClient.order.XpCruiseOrderClient;
import com.xiaopeng.api.feignClient.order.XpOrderClient;
import com.xiaopeng.api.feignClient.order.XpTestOrderClient;
import com.xiaopeng.api.feignClient.pushMessage.XpPushMessageClient;
import com.xiaopeng.api.feignClient.vehicleConvoy.UserVehicleClient;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.model.order.XpCruiseOrder;
import com.xiaopeng.api.model.order.XpOrder;
import com.xiaopeng.api.model.order.XpTestOrder;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import com.xiaopeng.api.vo.OrderType;
import com.xiaopeng.api.vo.automaticPilot.VehiclePosition;
@@ -111,6 +113,9 @@
    @Resource
    private XpTaskClient xpTaskClient;
    @Resource
    private XpTestOrderClient testOrderClient;
    private static final JsonFormat.Printer jsonPrinter = JsonFormat.printer()
            .printingEnumsAsInts()
@@ -265,7 +270,13 @@
                        String vin = jsonObject.getString("vin");
                        String orderType = jsonObject.getString("orderType");
                        PopOrderDto dto = new PopOrderDto();
                        dto.setOrderId(Long.valueOf(orderId.contains("XU") ? orderId.substring(2) : orderId));
                        if(orderId.contains("XU")){
                            dto.setOrderId(Long.valueOf(orderId.substring(2)));
                        }else if(orderId.contains("TEST")){
                            dto.setOrderId(Long.valueOf(orderId.substring(4)));
                        }else{
                            dto.setOrderId(Long.valueOf(orderId));
                        }
                        dto.setXpVehicleVin(vin);
                        dto.setOrderType(orderType);
                        xpOrderClient.popOrder(dto);
@@ -323,7 +334,9 @@
            if (order_id.contains("XU")) {
                hasOrder = 1;
                orderId = Long.parseLong(order_id.substring(2));
            } else {
            } else if(order_id.contains("TEST")) {
                orderId = Long.parseLong(order_id.substring(4));
            }else{
                orderId = Long.parseLong(order_id);
            }
        }
@@ -355,7 +368,7 @@
                mongoTemplate.updateFirst(new Query(Criteria.where("vin").is(vin)), update, VehiclePosition.class);
            }
            //调用推送服务接口
            if (null != orderId && !order_id.contains("XU")) {
            if (null != orderId && !order_id.contains("XU") && !order_id.contains("TEST")) {
                RtTripInfo rtTripInfo = systemRuntimeStatus.getRtTripInfo();
                PushOrderRouteDTO dto = new PushOrderRouteDTO();
                dto.setOrderId(orderId);
@@ -448,6 +461,24 @@
            }
            //添加车辆异常任务和发送消息
            xpTaskClient.saveVehicleAccidentError(vehicle.getId());
            // 封装埋点消息实体
            VehicleEventDTO vehicleEventDTO = new VehicleEventDTO();
            vehicleEventDTO.setVin(vehicle.getVehicleVin());
            vehicleEventDTO.setXpuId("");
            vehicleEventDTO.setOrderId("");
            vehicleEventDTO.setEventKey("RT_web_vehicle_status_changed");
            vehicleEventDTO.setEventTime(System.currentTimeMillis());
            Map<String,Object> attributes = new HashMap<>();
            attributes.put("vin",vehicle.getVehicleVin());
            attributes.put("order_id","");
            attributes.put("timestamp",vehicleEventDTO.getEventTime());
            attributes.put("main_status","OFFLINE");
            // TODO 预留位置 目前无状态
            attributes.put("sub_status","");
            attributes.put("prev_sub_status","");
            vehicleEventDTO.setAttributes(attributes);
            vehicleBuriedPointClient.sendVehicleEvent(vehicleEventDTO);
        }
    }
@@ -644,7 +675,73 @@
                vehicleId = xpCruiseOrder.getVehicleId();
            }
        } else {
        } else if(orderId.contains("TEST")){
            orderType = OrderType.TEST_ORDER;
            //正常单
            R<XpTestOrder> xpOrderR = testOrderClient.queryOrderById(Long.parseLong(orderId.substring(4)));
            if (200 != xpOrderR.getCode()) {
                throw new RuntimeException("订单不存在 " + orderId);
            }
            XpTestOrder xpOrder = xpOrderR.getData();
            XpVehicle xpVehicle = xpVehicleClient.queryById(xpOrder.getVehicleId()).getData();
            //驶往上车点的行程
            if (orderPhase.equals(OrderPhase.ROUTE_TO_PICKUP)) {
                //查询车辆位置
                VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class);
                if (Objects.isNull(vehiclePosition)) {
                    throw new RuntimeException("车辆位置信息不存在");
                }
                //查询司机当前位置到起点的线路
                origin.setLongitude(vehiclePosition.getPoint().getX());
                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);
                dto.setRouteType(1);
                R<RouteVo> routeVoR = xpMapClient.getOrderDistanceAndDuration(dto);
                if (200 != routeVoR.getCode()) {
                    throw new RuntimeException("获取订单线路和运费失败");
                }
                RouteVo routeVo = routeVoR.getData();
                routeID = routeVo.getRouteID();
                //缓存数据,用于后续推给乘客导航线路
                redisService.setCacheObject("TEST_ORDER_NAVIGATION_START_DATA:" + xpOrder.getVehicleId(), JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS);
            }
            //驶往下车点的行程
            if (orderPhase.equals(OrderPhase.ROUTE_TO_DESTINATION)) {
                //直接取缓存中的导航数据推送给车端和乘客
                Object cacheObject = redisService.getCacheObject("TEST_ORDER_NAVIGATION_END_DATA:" + xpOrder.getVehicleId());
                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);
                    dto.setRouteType(2);
                    R<RouteVo> routeVoR = xpMapClient.getOrderDistanceAndDuration(dto);
                    if (200 != routeVoR.getCode()) {
                        throw new RuntimeException("获取订单线路和运费失败");
                    }
                    RouteVo routeVo = routeVoR.getData();
                    routeID = routeVo.getRouteID();
                    //缓存导航数据,用于后面的逻辑中给乘客端推送导航数据
                    redisService.setCacheObject("TEST_ORDER_NAVIGATION_END_DATA:" + xpOrder.getVehicleId(), JSON.toJSONString(routeVo), 24L, TimeUnit.HOURS);
                }else{
                    RouteVo routeVo = JSON.parseObject(cacheObject.toString(), RouteVo.class);
                    routeID = routeVo.getRouteID();
                }
            }
            vehicleId = xpOrder.getVehicleId();
        }else{
            orderType = OrderType.USER_ORDER;
            //正常单
            R<XpOrder> xpOrderR = xpOrderClient.queryOrderById(Long.parseLong(orderId));
@@ -812,8 +909,12 @@
                case ORDER_RECEIVED:
                    //收到订单
                    if(!orderId.contains("XU")){
                        buildPushOrderStatus(orderId, OrderStatusEnum.READY_DEPART, sequence);
                        xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.READY_DEPART.getCode());
                        if(orderId.contains("TEST")){
                            testOrderClient.updateOrderStatus(Long.parseLong(orderId.substring(4)), OrderStatusEnum.READY_DEPART.getCode());
                        }else{
                            buildPushOrderStatus(orderId, OrderStatusEnum.READY_DEPART, sequence);
                            xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.READY_DEPART.getCode());
                        }
                    }
                    break;
                case ORDER_STARTED:
@@ -823,8 +924,12 @@
                case ORDER_EN_ROUTE_TO_PICKUP:
                    //前往上车点
                    if(!orderId.contains("XU")){
                        buildPushOrderStatus(orderId, OrderStatusEnum.PICK_UP, sequence);
                        xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.PICK_UP.getCode());
                        if(orderId.contains("TEST")){
                            testOrderClient.updateOrderStatus(Long.parseLong(orderId.substring(4)), OrderStatusEnum.PICK_UP.getCode());
                        }else{
                            buildPushOrderStatus(orderId, OrderStatusEnum.PICK_UP, sequence);
                            xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.PICK_UP.getCode());
                        }
                    }
                    break;
                case ORDER_ARRIVED_AT_PICKUP:
@@ -834,22 +939,34 @@
                case ORDER_WAITING_FOR_PICKUP:
                    //等待乘客上车
                    if(!orderId.contains("XU")){
                        buildPushOrderStatus(orderId, OrderStatusEnum.PICK_UP_GUESTS, sequence);
                        xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.PICK_UP_GUESTS.getCode());
                        if(orderId.contains("TEST")){
                            testOrderClient.updateOrderStatus(Long.parseLong(orderId.substring(4)), OrderStatusEnum.PICK_UP_GUESTS.getCode());
                        }else{
                            buildPushOrderStatus(orderId, OrderStatusEnum.PICK_UP_GUESTS, sequence);
                            xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.PICK_UP_GUESTS.getCode());
                        }
                    }
                    break;
                case ORDER_PASSENGER_ONBOARD:
                    //乘客已上车
                    if(!orderId.contains("XU")){
                        buildPushOrderStatus(orderId, OrderStatusEnum.PASSENGER_BOARDED, sequence);
                        xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.PASSENGER_BOARDED.getCode());
                        if(orderId.contains("TEST")){
                            testOrderClient.updateOrderStatus(Long.parseLong(orderId.substring(4)), OrderStatusEnum.PASSENGER_BOARDED.getCode());
                        }else{
                            buildPushOrderStatus(orderId, OrderStatusEnum.PASSENGER_BOARDED, sequence);
                            xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.PASSENGER_BOARDED.getCode());
                        }
                    }
                    break;
                case ORDER_EN_ROUTE_TO_DESTINATION:
                    //前往目的地
                    if(!orderId.contains("XU")){
                        buildPushOrderStatus(orderId, OrderStatusEnum.IN_SERVICE, sequence);
                        xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.IN_SERVICE.getCode());
                        if(orderId.contains("TEST")){
                            testOrderClient.updateOrderStatus(Long.parseLong(orderId.substring(4)), OrderStatusEnum.IN_SERVICE.getCode());
                        }else{
                            buildPushOrderStatus(orderId, OrderStatusEnum.IN_SERVICE, sequence);
                            xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.IN_SERVICE.getCode());
                        }
                    }
                    break;
                case ORDER_ARRIVED_AT_DESTINATION:
@@ -859,8 +976,12 @@
                case ORDER_WAITING_FOR_DROPOFF:
                    //等待乘客下车,开始倒计时发下巡游单
                    if(!orderId.contains("XU")){
                        buildPushOrderStatus(orderId, OrderStatusEnum.SEE_OFF_GUESTS, sequence);
                        xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.SEE_OFF_GUESTS.getCode());
                        if(orderId.contains("TEST")){
                            testOrderClient.updateOrderStatus(Long.parseLong(orderId.substring(4)), OrderStatusEnum.SEE_OFF_GUESTS.getCode());
                        }else{
                            buildPushOrderStatus(orderId, OrderStatusEnum.SEE_OFF_GUESTS, sequence);
                            xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.SEE_OFF_GUESTS.getCode());
                        }
                    }
                    break;
                case ORDER_DROPOFF_COMPLETED:
@@ -878,23 +999,39 @@
                case ORDER_CANCELLED:
                    //已取消
                    if(!orderId.contains("XU")){
                        //判断订单状态,已经取消的不作处理
                        Object cacheObject = redisService.getCacheObject("ORDER_STATUS:" + orderId);
                        if(null != cacheObject){
                            int order_status = Integer.parseInt(cacheObject.toString());
                            if(0 == order_status){
                                return;
                        if(orderId.contains("TEST")){
                            //判断订单状态,已经取消的不作处理
                            Object cacheObject = redisService.getCacheObject("ORDER_STATUS:" + orderId.substring(4));
                            if(null != cacheObject){
                                int order_status = Integer.parseInt(cacheObject.toString());
                                if(0 == order_status){
                                    return;
                                }
                            }
                            //行程中取消订单,按照行程结束处理
                            testOrderClient.updateOrderStatus(Long.parseLong(orderId.substring(4)), OrderStatusEnum.SEE_OFF_GUESTS.getCode());
                        }else{
                            //判断订单状态,已经取消的不作处理
                            Object cacheObject = redisService.getCacheObject("ORDER_STATUS:" + orderId);
                            if(null != cacheObject){
                                int order_status = Integer.parseInt(cacheObject.toString());
                                if(0 == order_status){
                                    return;
                                }
                            }
                            //行程中取消订单,按照行程结束处理
                            buildPushOrderStatus(orderId, OrderStatusEnum.SEE_OFF_GUESTS, sequence);
                            xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.SEE_OFF_GUESTS.getCode());
                        }
                        //行程中取消订单,按照行程结束处理
                        buildPushOrderStatus(orderId, OrderStatusEnum.SEE_OFF_GUESTS, sequence);
                        xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.SEE_OFF_GUESTS.getCode());
                    }
                    break;
                case ORDER_ARRIVED_AT_CRUISE_DESTINATION:
                    //到达巡游终点
                    if(orderId.contains("XU")){
                        buildPushOrderStatus(orderId, OrderStatusEnum.COMPLETED, sequence);
                    }else if(orderId.contains("TEST")){
                        //测试巡游单处理逻辑
                        testOrderClient.updateOrderStatus(Long.parseLong(orderId.substring(4)), OrderStatusEnum.COMPLETED.getCode());
                    }
                    break;
                case ORDER_PAUSED:
xp-robotaxi-common/xp-common-core/src/main/java/com/xiaopeng/common/core/constant/TokenConstants.java
@@ -20,7 +20,7 @@
    /**
     * 令牌秘钥
     */
    public final static String SECRET = "abcdefghijklmnopqrstuvwxyz";
    public final static String SECRET = "iymGhx1XkAAHrex2Zf4ASbiD9P2ksTam";
    
    /**
     * 参数签名
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpCruisePlanController.java
@@ -235,6 +235,9 @@
    public R<XpCruiseOrder> findReturnCruisePoint(@RequestBody XpCruiseOrder xpCruiseOrder) {
        // 先找计划
        XpCruisePlanVehicle plan = xpCruisePlanVehicleService.getOne(new LambdaQueryWrapper<XpCruisePlanVehicle>().eq(XpCruisePlanVehicle::getVehicleId, xpCruiseOrder.getVehicleId()));
        if(null == plan){
            return R.fail("没有巡游计划,执行收车失败");
        }
        // 找对应的多个点位
        List<XpCruisePlanPoint> planPointList = xpCruisePlanPointService.list(new LambdaQueryWrapper<XpCruisePlanPoint>().eq(XpCruisePlanPoint::getCruisePlanId, plan.getCruisePlanId()).orderByAsc(XpCruisePlanPoint::getSortOrder));
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpOpenCityController.java
@@ -133,4 +133,20 @@
        xpOpenCityService.upDown(id, status);
        return R.ok();
    }
    /**
     * 根据省市区获取开通城市数据
     * @param provinceCode
     * @param cityCode
     * @param districtCode
     * @return
     */
    @PostMapping("/inner/v1/openCity/getXpOpenCity")
    public R<XpOpenCity> getXpOpenCity(@RequestParam("provinceCode") String provinceCode,
                                @RequestParam("cityCode") String cityCode,
                                @RequestParam("districtCode") String districtCode){
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpRoutePlanController.java
@@ -1,5 +1,6 @@
package com.xiaopeng.operation.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiaopeng.api.model.operation.XpRoutePlan;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.page.PageInfo;
@@ -25,7 +26,7 @@
 * @since 2026-02-03
 */
@RestController
@RequestMapping("/api/v1/routePlan")
@RequestMapping("")
@Api(tags = "路线规划配置管理")
@Slf4j
public class XpRoutePlanController {
@@ -37,7 +38,7 @@
     * 分页查询路线规划配置列表
     */
    @ApiOperation(value = "路线规划配置分页列表", tags = {"管理后台-交易管理-导航及路线规划"}, response = XpRoutePlan.class)
    @PostMapping("/pageList")
    @PostMapping("/api/v1/routePlan/pageList")
    public R<PageInfo<XpRoutePlan>> pageList(@RequestBody RoutePlanPageListQuery query) {
        PageInfo<XpRoutePlan> pageInfo = routePlanService.pageList(query);
        return R.ok(pageInfo);
@@ -47,7 +48,7 @@
     * 新增路线规划配置
     */
    @ApiOperation(value = "新增路线规划配置", tags = {"管理后台-交易管理-导航及路线规划"})
    @PostMapping("/add")
    @PostMapping("/api/v1/routePlan/add")
    public R<?> add(@Validated @RequestBody RoutePlanAddDTO dto) {
        routePlanService.add(dto);
        return R.ok();
@@ -57,7 +58,7 @@
     * 编辑路线规划配置
     */
    @ApiOperation(value = "编辑路线规划配置", tags = {"管理后台-交易管理-导航及路线规划"})
    @PostMapping("/edit")
    @PostMapping("/api/v1/routePlan/edit")
    public R<?> edit(@Validated @RequestBody RoutePlanEditDTO dto) {
        routePlanService.edit(dto);
        return R.ok();
@@ -67,9 +68,21 @@
     * 删除路线规划配置
     */
    @ApiOperation(value = "删除路线规划配置", tags = {"管理后台-交易管理-导航及路线规划"})
    @DeleteMapping("/deleteById/{id}")
    @DeleteMapping("/api/v1/routePlan/deleteById/{id}")
    public R<?> deleteById(@ApiParam(name = "id", value = "线路ID") @PathVariable Long id) {
        routePlanService.deleteById(id);
        return R.ok();
    }
    /**
     * 根据openCityId获取路线规划配置
     * @param openCityId
     * @return
     */
    @PostMapping("/inner/v1/routePlan/getXpRoutePlanOpenCityId")
    public R<XpRoutePlan> getXpRoutePlanOpenCityId(@RequestParam Long openCityId) {
        XpRoutePlan routePlan = routePlanService.getOne(new QueryWrapper<XpRoutePlan>().eq("open_city_id", openCityId).eq("auth_status", 2));
        return R.ok(routePlan);
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpTestPlanController.java
@@ -1,15 +1,11 @@
package com.xiaopeng.operation.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xiaopeng.api.dto.operation.CruisePointDto;
import com.xiaopeng.api.dto.operation.NewCruiseOrderDto;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.model.operation.XpTestPlan;
import com.xiaopeng.api.model.operation.XpTestPlanPoint;
import com.xiaopeng.api.model.operation.XpTestPlanVehicle;
import com.xiaopeng.api.model.operation.XpTestPoint;
import com.xiaopeng.api.model.order.XpCruiseOrder;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.operation.dto.XpTestPlanAddDTO;
@@ -24,14 +20,11 @@
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.mongodb.core.geo.GeoJsonPoint;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
 * <p>
@@ -46,10 +39,12 @@
@RequiredArgsConstructor(onConstructor_ = @Lazy)
public class XpTestPlanController {
    private final IXpTestPlanService xpTestPlanService;
    private final IXpTestPlanVehicleService xpTestPlanVehicleService;
    private final IXpTestPlanPointService xpTestPlanPointService;
    private final XpTestPointService testPointService;
    private final XpVehicleClient xpVehicleClient;
    private final IXpTestPlanPointService xpTestPlanPointService;
    private final XpTestPointService xpTestPointService;
    private final IXpTestPlanVehicleService xpTestPlanVehicleService;
    @ApiOperation(value = "获取测试计划分页列表", tags = {"管理后台-测试计划"})
    @PostMapping(value = {"/api/v1/xp-test-plan/pageList"})
@@ -86,172 +81,53 @@
    /**
     * 获取车辆下个点位
     * 根据id获取测试计划
     * @param id
     * @return
     */
    @PostMapping("/inner/cruise/getCruisePoint")
    public R<XpTestOrder> getCruisePoint(@RequestBody CruisePointDto dto) {
        // 先找计划
        XpTestPlanVehicle plan = xpTestPlanVehicleService.getOne(new LambdaQueryWrapper<XpTestPlanVehicle>().eq(XpTestPlanVehicle::getVehicleId, dto.getVehicleId()));
        if (plan == null) {
            return R.fail("没有找到对应的计划");
        }
        // 找对应的多个点位
        List<XpTestPlanPoint> planPointList = xpTestPlanPointService.list(new LambdaQueryWrapper<XpTestPlanPoint>().eq(XpTestPlanPoint::getTestPlanId, plan.getTestPlanId()).orderByAsc(XpTestPlanPoint::getSortOrder));
        // 找到现在这个点位
        // 根据dto的pointId 是第几个
        int index = 0;
        for (int i = 0; i < planPointList.size(); i++) {
            if (planPointList.get(i).getTestPointId().equals(dto.getPointId())) {
                index = i;
                break;
            }
        }
        XpCruiseOrder newXpCruiseOrder = dto.getNewXpCruiseOrder();
        XpTestPlanPoint xpCruisePlanPoint = null;
        //   判断是否是最后一个 是则往前一个  否找下一个
        if (index == planPointList.size() - 1) {
            // 最后一个 找上一个
            xpCruisePlanPoint = planPointList.get(index - 1);
            newXpCruiseOrder.setOrderReverse(2);
        } else if (index == 0) {
            // 第一个 找下一个
            xpCruisePlanPoint = planPointList.get(index + 1);
            newXpCruiseOrder.setOrderReverse(1);
        } else {
            // 中间点位
            if (dto.getOrderReverse() == 1) {
                // 正向 找下一个
                xpCruisePlanPoint = planPointList.get(index + 1);
                newXpCruiseOrder.setOrderReverse(1);
            } else {
                // 反向找上一个
                xpCruisePlanPoint = planPointList.get(index - 1);
                newXpCruiseOrder.setOrderReverse(2);
            }
        }
        Long pointId = xpCruisePlanPoint.getTestPointId();
        XpTestPoint point = testPointService.getById(pointId);
        newXpCruiseOrder.setEndPointId(pointId);
        newXpCruiseOrder.setEndPointName(point.getPointName());
        newXpCruiseOrder.setEndLon(point.getPointLon());
        newXpCruiseOrder.setEndLat(point.getPointLat());
        newXpCruiseOrder.setMissionId(xpCruisePlanPoint.getTestPlanId());
        return R.ok(newXpCruiseOrder);
    }
    /**
     * 获取测试计划
     * @param vehicleId
     * @return
     */
    @PostMapping("/inner/cruise/getCruisePlan")
    public R<XpTestPlanVehicle> getCruisePlan(@RequestParam Long vehicleId) {
        XpTestPlanVehicle plan = xpTestPlanVehicleService.getOne(new LambdaQueryWrapper<XpTestPlanVehicle>().eq(XpTestPlanVehicle::getVehicleId, vehicleId));
        return R.ok(plan);
    }
    /**
     * 获取测试计划点位列表
     * @param vehicleId
     * @return
     */
    @PostMapping("/inner/cruise/getCruisePlanPointList")
    public R<List<XpTestPlanPoint>> getCruisePlanPointList(@RequestParam Long vehicleId) {
        // 先找计划
        XpTestPlanVehicle plan = xpTestPlanVehicleService.getOne(new LambdaQueryWrapper<XpTestPlanVehicle>().eq(XpTestPlanVehicle::getVehicleId, vehicleId));
        // 找对应的多个点位
        List<XpTestPlanPoint> planPointList = xpTestPlanPointService.list(new LambdaQueryWrapper<XpTestPlanPoint>().eq(XpTestPlanPoint::getTestPlanId, plan.getTestPlanId()).orderByAsc(XpTestPlanPoint::getSortOrder));
        return R.ok(planPointList);
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPlanById")
    public R<XpTestPlan> getXpTestPlanById(@RequestParam Long id){
        XpTestPlan xpTestPlan = xpTestPlanService.getById(id);
        return R.ok(xpTestPlan);
    }
    /**
     * 获取测试订单数据
     * 根据id获取测试计划点
     * @param id
     * @return
     */
    @PostMapping("/inner/cruise/getNewCruiseOrder")
    public R<XpCruiseOrder> getNewCruiseOrder(@RequestBody NewCruiseOrderDto dto) {
        // 先找计划
        XpTestPlanVehicle plan = xpTestPlanVehicleService.getOne(new LambdaQueryWrapper<XpTestPlanVehicle>().eq(XpTestPlanVehicle::getVehicleId, dto.getVehicleId()));
        // 找对应的多个点位
        List<XpTestPlanPoint> planPointList = xpTestPlanPointService.list(new LambdaQueryWrapper<XpTestPlanPoint>().eq(XpTestPlanPoint::getTestPlanId, plan.getTestPlanId()).orderByAsc(XpTestPlanPoint::getSortOrder));
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPlanPointById")
    public R<XpTestPlanPoint> getXpTestPlanPointById(@RequestParam Long id){
        XpTestPlanPoint xpTestPlanPoint = xpTestPlanPointService.getById(id);
        return R.ok(xpTestPlanPoint);
    }
        XpCruiseOrder newXpCruiseOrder = new XpCruiseOrder();
        newXpCruiseOrder.setFleetId(dto.getFleetId());
        newXpCruiseOrder.setVehicleId(dto.getVehicleId());
        newXpCruiseOrder.setVehicleVin(dto.getVehicleVin());
        newXpCruiseOrder.setOrderType(1);
        newXpCruiseOrder.setMissionId(plan.getTestPlanId());
        newXpCruiseOrder.setStatus(1);
        newXpCruiseOrder.setOrderReverse(1);
        GeoJsonPoint point = dto.getPoint();
        // 起点
        newXpCruiseOrder.setStartLon(point.getX());
        newXpCruiseOrder.setStartLat(point.getY());
        // 终点
        XpTestPlanPoint endCruisePlanPoint = planPointList.get(0);
        Long endPointId = endCruisePlanPoint.getPointId();
        XpTestPoint endPoint = testPointService.getById(endPointId);
        newXpCruiseOrder.setEndPointId(endPointId);
        newXpCruiseOrder.setEndPointName(endPoint.getPointName());
        newXpCruiseOrder.setEndLon(endPoint.getPointLon());
        newXpCruiseOrder.setEndLat(endPoint.getPointLat());
        return R.ok(newXpCruiseOrder);
    /**
     * 根据id获取测试计划点位
     * @param id
     * @return
     */
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPointById")
    public R<XpTestPoint> getXpTestPointById(@RequestParam Long id){
        XpTestPoint xpTestPoint = xpTestPointService.getById(id);
        return R.ok(xpTestPoint);
    }
    /**
     * 获取车辆返回点位
     * @param xpCruiseOrder
     * 根据测试计划获取车辆信息
     * @param testPlanId
     * @return
     */
    @PostMapping("/inner/cruise/findReturnCruisePoint")
    public R<XpCruiseOrder> findReturnCruisePoint(@RequestBody XpCruiseOrder xpCruiseOrder) {
        // 先找计划
        XpTestPlanVehicle plan = xpTestPlanVehicleService.getOne(new LambdaQueryWrapper<XpTestPlanVehicle>().eq(XpTestPlanVehicle::getVehicleId, xpCruiseOrder.getVehicleId()));
        // 找对应的多个点位
        List<XpTestPlanPoint> planPointList = xpTestPlanPointService.list(new LambdaQueryWrapper<XpTestPlanPoint>().eq(XpTestPlanPoint::getTestPlanId, plan.getTestPlanId()).orderByAsc(XpTestPlanPoint::getSortOrder));
        XpTestPoint xpPoint = testPointService.list(new LambdaQueryWrapper<XpTestPoint>().eq(XpTestPoint::getParkingPoint, 1).in(XpTestPoint::getId, planPointList.stream().map(XpTestPlanPoint::getPointId).collect(Collectors.toList()))).get(0);
        xpCruiseOrder.setEndPointId(xpPoint.getId());
        xpCruiseOrder.setEndPointName(xpPoint.getPointName());
        xpCruiseOrder.setEndLon(xpPoint.getPointLon());
        xpCruiseOrder.setEndLat(xpPoint.getPointLat());
        xpCruiseOrder.setMissionId(plan.getTestPlanId());
        return R.ok(xpCruiseOrder);
    }
    /**
     * 判断点位ID列表是否存在关联的测试计划点位(内部接口)
     */
    @PostMapping("/inner/cruise/existsCruisePlanPointByPointIds")
    public R<Boolean> existsCruisePlanPointByPointIds(@RequestBody List<Long> pointIds) {
        List<Long> distinctPointIds = pointIds == null
                ? java.util.Collections.emptyList()
                : pointIds.stream().filter(Objects::nonNull).distinct().collect(Collectors.toList());
        if (distinctPointIds.isEmpty()) {
            return R.ok(Boolean.FALSE);
        }
        XpTestPlanPoint exists = xpTestPlanPointService.getOne(
                new LambdaQueryWrapper<XpTestPlanPoint>()
                        .in(XpTestPlanPoint::getPointId, distinctPointIds)
                        .last("limit 1")
        );
        return R.ok(exists != null);
    @PostMapping("/inner/v1/xp-test-plan/getXpTestPlanVehicleByTestPlanId")
    public R<List<XpTestPlanVehicle>> getXpTestPlanVehicleByTestPlanId(@RequestParam Long testPlanId){
        List<XpTestPlanVehicle> xpTestPlanVehicleList = xpTestPlanVehicleService.lambdaQuery()
                .eq(XpTestPlanVehicle::getTestPlanId, testPlanId)
                .list();
        return R.ok(xpTestPlanVehicleList);
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpTestPointManagementController.java
@@ -37,7 +37,7 @@
@Slf4j
@RestController
@RequestMapping("/api/v1/testPoint")
@RequestMapping("")
@Api(tags = "测试demo-点位管理")
public class XpTestPointManagementController extends BaseController {
@@ -50,7 +50,7 @@
    @ApiOperation(value = "获取所有运营中的区域", response = XpElectronicFenceArea.class)
    @PostMapping("/listElectronicFenceArea")
    @PostMapping("/api/v1/testPoint/listElectronicFenceArea")
    public R<List<XpElectronicFenceArea>> listElectronicFenceArea() {
        // 获取所有启用的电子围栏
        List<XpElectronicFence> electronicFences = xpElectronicFenceService.lambdaQuery().eq(XpElectronicFence::getStatus, 2).list();
@@ -65,20 +65,20 @@
    }
    @ApiOperation(value = "点位管理列表", response = XpTestPoint.class)
    @PostMapping("/listPoint")
    @PostMapping("/api/v1/testPoint/listPoint")
    public R<List<XpTestPoint>> list(@RequestBody PointListQuery query) {
        List<XpTestPoint> pageList = xpTestPointService.listAll(query);
        return R.ok(pageList);
    }
    @ApiOperation(value = "点位管理分页列表", response = XpTestPoint.class)
    @PostMapping("/pageList")
    @PostMapping("/api/v1/testPoint/pageList")
    public R<PageInfo<XpTestPoint>> pageList(@RequestBody PointPageListListQuery query) {
        PageInfo<XpTestPoint> pageList = xpTestPointService.pageList(query);
        return R.ok(pageList);
    }
    @PostMapping("/getByIds")
    @PostMapping("/api/v1/testPoint/getByIds")
    public R<List<XpTestPoint>> getByIds(@RequestBody XpPointExportExcelQuery query) {
        List<XpTestPoint> list = xpTestPointService.lambdaQuery().in(XpTestPoint::getId, query.getPointIds()).list();
        return R.ok(list);
@@ -87,7 +87,7 @@
    /**
     * 新增点位
     */
    @PostMapping("/addPoint")
    @PostMapping("/api/v1/testPoint/addPoint")
    @ResponseBody
    @ApiOperation(value = "新增点位")
    public R add(@Validated @RequestBody PointAddDto pointAddDto) {
@@ -101,7 +101,7 @@
    /**
     * 批量删除点位
     */
    @GetMapping("/deletePoint")
    @GetMapping("/api/v1/testPoint/deletePoint")
    @ResponseBody
    @ApiOperation(value = "删除点位")
    public R deletePoint(@RequestParam("ids") String ids) {
@@ -113,7 +113,7 @@
    /**
     * 编辑点位
     */
    @PostMapping("/editPoint")
    @PostMapping("/api/v1/testPoint/editPoint")
    @ApiOperation(value = "编辑点位")
    public R edit(@Validated @RequestBody PointUpdateDto pointAddDto) {
        XpTestPoint xpPoint = new XpTestPoint();
@@ -126,7 +126,7 @@
    /**
     * 点位详情
     */
    @GetMapping("/queryPointById")
    @GetMapping("/api/v1/testPoint/queryPointById")
    @ApiOperation(value = "点位详情")
    public R<XpTestPoint> queryById(@RequestParam Long id) {
        return R.ok(xpTestPointService.getById(id));
@@ -135,7 +135,7 @@
    /**
     * 启用/禁用
     */
    @PostMapping("/enableDisablePoint")
    @PostMapping("/api/v1/testPoint/enableDisablePoint")
    @ApiOperation(value = "启用/禁用")
    public R enableDisable(@RequestBody XpPointEnableDisableDto dto) {
        XpTestPoint xpPoint = xpTestPointService.getById(dto.getId());
@@ -149,7 +149,7 @@
    /**
     * 设置特殊点位
     */
    @PostMapping("/setSpecialPoint")
    @PostMapping("/api/v1/testPoint/setSpecialPoint")
    @ApiOperation(value = "设置特殊点位", tags = "后台管理-特殊点位")
    public R setSpecialPoint(@RequestBody XpPointSpecialDto dto) {
        xpTestPointService.update(new LambdaUpdateWrapper<XpTestPoint>().set(XpTestPoint::getChargePoint, 0)
@@ -172,7 +172,7 @@
    }
    @GetMapping("/listSpecialPoint")
    @GetMapping("/api/v1/testPoint/listSpecialPoint")
    @ApiOperation(value = "获取特殊点位", tags = "后台管理-特殊点位")
    public R<SpecialPointVo> getSpecialPoint() {
        List<XpTestPoint> chargePoints = xpTestPointService.list(new LambdaQueryWrapper<XpTestPoint>().eq(XpTestPoint::getChargePoint, 1));
@@ -202,4 +202,15 @@
        return R.ok(specialPointVo);
    }
    /**
     * 判断点位是在有效期内
     * @param pointId
     * @return
     */
    @GetMapping("/inner/v1/testPoint/nowInTimePoint")
    public R<Boolean> nowInTimePoint(@RequestParam Long pointId){
        return R.ok(xpTestPointService.nowInTimePoint(pointId));
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/dto/XpTestPlanAddDTO.java
@@ -34,14 +34,12 @@
    @Data
    @Accessors(chain = true)
    public static class TestPlanPointDTO{
        @ApiModelProperty(value = "点位ID")
        private Long pointId;
        private Long startTestPointId;
        @ApiModelProperty(value = "排序")
        private Integer sortOrder;
        @ApiModelProperty(value = "是否停车 0-否 1-是")
        private Integer stopFlag;
        @ApiModelProperty(value = "点位ID")
        private Long endTestPointId;
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/mapper/XpTestPointMapper.java
@@ -31,5 +31,5 @@
    List<XpPointsListVo> queryPointByName(@Param("query") PointByNameQuery query);
    List<XpTestPoint> pageList(@Param("pageInfo") PageInfo<XpPoint> pageInfo, @Param("query") PointPageListListQuery query);
    List<XpTestPoint> pageList(@Param("pageInfo") PageInfo<XpTestPoint> pageInfo, @Param("query") PointPageListListQuery query);
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpOpenCityService.java
@@ -9,6 +9,7 @@
import com.xiaopeng.operation.query.OpenCityPageQuery;
import com.xiaopeng.operation.vo.OpenCityListVO;
import com.xiaopeng.operation.vo.XpOpenCityVo;
import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.Valid;
import java.util.List;
@@ -74,4 +75,14 @@
     * @return
     */
    String getNameWithCityName(Long cityId);
    /**
     * 获取开通城市数据
     * @param provinceCode
     * @param cityCode
     * @param districtCode
     * @return
     */
    XpOpenCity getXpOpenCity(String provinceCode, String cityCode, String districtCode);
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpTestPointService.java
@@ -65,13 +65,6 @@
    List<XpHistoryEndPointsVo> getHistoryEndPoints(HistoryEndPointsDto historyEndPointsDto);
    /**
     * 根据名称获取点位列表
     * @param query
     * @return
     */
    XpPointsSearchVo queryPointByName(@Valid PointByNameQuery query);
    /**
     * 获取可下单距离
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpOpenCityServiceImpl.java
@@ -158,4 +158,29 @@
        }
        return cityName;
    }
    /**
     * 根据省、市、区县编码查询开通城市
     * @param provinceCode
     * @param cityCode
     * @param districtCode
     * @return
     */
    @Override
    public XpOpenCity getXpOpenCity(String provinceCode, String cityCode, String districtCode) {
        //先根据区编码获取,没有再根据市编码获取,没有再根据省编码获取
        XpOpenCity xpOpenCity = this.baseMapper.selectOne(new LambdaQueryWrapper<XpOpenCity>()
                .eq(XpOpenCity::getDistrictCode, districtCode));
        if (Objects.isNull(xpOpenCity)) {
            xpOpenCity = this.baseMapper.selectOne(new LambdaQueryWrapper<XpOpenCity>()
                    .eq(XpOpenCity::getCityCode, cityCode).isNull(XpOpenCity::getDistrictCode));
        }
        if (Objects.isNull(xpOpenCity)) {
            xpOpenCity = this.baseMapper.selectOne(new LambdaQueryWrapper<XpOpenCity>()
                    .eq(XpOpenCity::getProvinceCode, provinceCode)
                    .isNull(XpOpenCity::getCityCode).isNull(XpOpenCity::getDistrictCode));
        }
        return xpOpenCity;
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTestPlanServiceImpl.java
@@ -170,24 +170,35 @@
        }
        List<XpTestPlanPoint> planPoints = xpTestPlanPointService.lambdaQuery()
                .eq(XpTestPlanPoint::getTestPlanId, id)
                .orderByAsc(XpTestPlanPoint::getSortOrder)
                .list();
        List<Long> pointIds = planPoints.stream()
                .map(XpTestPlanPoint::getTestPointId)
                .map(XpTestPlanPoint::getStartTestPointId)
                .filter(Objects::nonNull)
                .collect(Collectors.toList());
        List<Long> pointIds1 = planPoints.stream()
                .map(XpTestPlanPoint::getEndTestPointId)
                .filter(Objects::nonNull)
                .collect(Collectors.toList());
        pointIds.addAll(pointIds1);
        Map<Long, XpTestPoint> pointMap = CollUtil.isNotEmpty(pointIds)
                ? xpTestPointService.listByIds(pointIds).stream()
                .collect(Collectors.toMap(XpTestPoint::getId, v -> v))
                : Collections.emptyMap();
        List<XpTestPlanPointVO> pointList = planPoints.stream().map(planPoint -> {
            XpTestPlanPointVO vo = new XpTestPlanPointVO();
            vo.setPointId(planPoint.getTestPointId());
            vo.setSortOrder(planPoint.getSortOrder());
            XpTestPoint point = pointMap.get(planPoint.getTestPointId() == null ? null : planPoint.getTestPointId().longValue());
            vo.setStartTestPointId(planPoint.getStartTestPointId());
            vo.setEndTestPointId(planPoint.getEndTestPointId());
            vo.setStopFlag(planPoint.getStopFlag());
            vo.setTestOrderType(planPoint.getTestOrderType());
            XpTestPoint point = pointMap.get(planPoint.getStartTestPointId() == null ? null : planPoint.getStartTestPointId().longValue());
            if (point != null) {
                vo.setPointName(point.getPointName());
                vo.setPointAddress(point.getPointAddress());
                vo.setStartTestPointName(point.getPointName());
                vo.setStartTestPointAddress(point.getPointAddress());
            }
            XpTestPoint point1 = pointMap.get(planPoint.getEndTestPointId() == null ? null : planPoint.getEndTestPointId().longValue());
            if (point != null) {
                vo.setEndTestPointName(point1.getPointName());
                vo.setEndTestPointAddress(point1.getPointAddress());
            }
            return vo;
        }).collect(Collectors.toList());
@@ -288,13 +299,10 @@
        }
        Set<Long> pointIdSet = new HashSet<>();
        for (XpTestPlanAddDTO.TestPlanPointDTO pointDTO : pointList) {
            if (pointDTO.getPointId() == null || pointDTO.getSortOrder() == null || pointDTO.getStopFlag() == null) {
            if (pointDTO.getStartTestPointId() == null || pointDTO.getEndTestPointId() == null) {
                throw new ServiceException("点位参数不完整", I18nKeyConstant.CRUISE_PLAN_POINT_INCOMPLETE);
            }
            if (pointDTO.getStopFlag() != 0 && pointDTO.getStopFlag() != 1) {
                throw new ServiceException("点位停车标识不合法", I18nKeyConstant.CRUISE_PLAN_STOP_FLAG_INVALID);
            }
            if (!pointIdSet.add(pointDTO.getPointId())) {
            if (!pointIdSet.add(pointDTO.getStartTestPointId()) || !pointIdSet.add(pointDTO.getEndTestPointId())) {
                throw new ServiceException("点位ID重复", I18nKeyConstant.CRUISE_PLAN_POINT_DUPLICATE);
            }
        }
@@ -353,9 +361,8 @@
        for (XpTestPlanAddDTO.TestPlanPointDTO pointDTO : pointList) {
            XpTestPlanPoint point = new XpTestPlanPoint();
            point.setTestPlanId(planId);
            point.setTestPlanId(pointDTO.getPointId());
            point.setSortOrder(pointDTO.getSortOrder());
            point.setStopFlag(pointDTO.getStopFlag());
            point.setStartTestPointId(pointDTO.getStartTestPointId());
            point.setEndTestPointId(pointDTO.getEndTestPointId());
            result.add(point);
        }
        return result;
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTestPointServiceImpl.java
@@ -375,70 +375,6 @@
        return resultList;
    }
    @Override
    public XpPointsSearchVo queryPointByName(PointByNameQuery query) {
        XpPointsSearchVo searchVo = new XpTestPointsSearchVo();
        List<XpPointsListVo> list = this.baseMapper.queryPointByName(query);
        if (list.isEmpty()) {
            return searchVo;
        }
        LocalTime now = LocalTime.now();
        List<Long> areaIds = list.stream().map(XpPointsListVo::getElectronicAreaId).collect(Collectors.toList());
        List<XpElectronicFenceArea> xpElectronicFenceAreas = xpElectronicFenceAreaService.listByIds(areaIds);
        List<Long> fenceIds = xpElectronicFenceAreas.stream().map(XpElectronicFenceArea::getElectronicId).collect(Collectors.toList());
        List<XpElectronicFence> xpElectronicFences = new ArrayList<>();
        if (CollUtil.isNotEmpty(fenceIds)) {
            xpElectronicFences = xpElectronicFenceService.listByIds(fenceIds);
        }
        for (XpPointsListVo xpPointsListVo : list) {
            Integer operationType = xpPointsListVo.getOperationType();
            if(1 == operationType){
                //与运营区同步
                XpElectronicFenceArea xpElectronicFenceArea = xpElectronicFenceAreas.stream().filter(s -> s.getId().equals(xpPointsListVo.getElectronicAreaId())).findFirst().orElse(null);
                if(null == xpElectronicFenceArea){
                    // 不在运营段
                    xpPointsListVo.setState(0);
                }
                XpElectronicFence xpElectronicFence = xpElectronicFences.stream().filter(s -> s.getId().equals(xpElectronicFenceArea.getElectronicId())).findFirst().orElse(null);
                if(null == xpElectronicFence){
                    // 不在运营段
                    xpPointsListVo.setState(0);
                }
                //失效类型 1=永不失效 2=定时失效
                Integer failureType = xpElectronicFence.getFailureType();
                //永不失效,但是还未到开始时间
                if(1 == failureType && LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime())){
                    xpPointsListVo.setState(0);
                }else if(2 == failureType && (LocalDateTime.now().isBefore(xpElectronicFence.getEffectTime()) || LocalDateTime.now().isAfter(xpElectronicFence.getFailureTime()))){
                    //定时失效,但是当前时间不在时间范围内
                    xpPointsListVo.setState(0);
                }
            }else{
                //自定义时间段
                // 判断是否在时间段内
                boolean intime = getInTime(now, xpPointsListVo.getEffectivePeriod(), xpPointsListVo.getEffectiveTimePeriod());
                if (!intime) {
                    // 不在运营段
                    xpPointsListVo.setState(0);
                }
            }
        }
        // 组装数据 并排序 剔除不在运营段的 数据
        List<XpPointsListVo> resultList = list.stream()
                .peek(vo -> vo.setDistance(BigDecimal.valueOf(FastDistanceCalculator.distanceFast(query.getLat(), query.getLon(), vo.getLatitude(), vo.getLongitude())).setScale(2, RoundingMode.HALF_UP).doubleValue()))
                .filter(vo -> vo.getState() == 1).collect(Collectors.toList());
        // 可用点位
        List<XpPointsListVo> availablePoints = resultList.stream().filter(e -> query.getElectronicAreaId() != null && e.getElectronicAreaId().equals(query.getElectronicAreaId())).sorted(Comparator.comparing(XpPointsListVo::getDistance)).collect(Collectors.toList());//
        // 不可用点位
        List<XpPointsListVo> unavailablePoints = resultList.stream().filter(e -> query.getElectronicAreaId() == null || !e.getElectronicAreaId().equals(query.getElectronicAreaId())).sorted(Comparator.comparing(XpPointsListVo::getDistance)).collect(Collectors.toList());
        searchVo.setAvailablePoints(availablePoints);
        searchVo.setUnavailablePoints(unavailablePoints);
        return searchVo;
    }
    @Override
    public OrderDistanceVo getOrderDistance() {
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/vo/XpTestPlanPointVO.java
@@ -16,15 +16,28 @@
@ApiModel(value = "测试计划点位VO", description = "测试计划点位响应对象")
public class XpTestPlanPointVO {
    @ApiModelProperty(value = "点位ID")
    private Long pointId;
    @ApiModelProperty(value = "起点点位ID")
    private Long startTestPointId;
    @ApiModelProperty(value = "点位名称")
    private String pointName;
    @ApiModelProperty(value = "起点点位名称")
    private String startTestPointName;
    @ApiModelProperty(value = "详细地址")
    private String pointAddress;
    @ApiModelProperty(value = "起点详细地址")
    private String startTestPointAddress;
    @ApiModelProperty(value = "排序")
    private Integer sortOrder;
    @ApiModelProperty(value = "终点点位ID")
    private Long endTestPointId;
    @ApiModelProperty(value = "终点点位名称")
    private String endTestPointName;
    @ApiModelProperty(value = "终点详细地址")
    private String endTestPointAddress;
    @ApiModelProperty(value = "是否停车 0-否 1-是")
    private Integer stopFlag;
    @ApiModelProperty(value = "测试订单类型(1=测试单,2=巡游单)")
    private Long testOrderType;
}
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/constant/I18nKeyConstant.java
@@ -26,4 +26,7 @@
    String ORDER_CHANGE_AMOUNT_STATUS_INVALID = "order.change.amount.status.invalid";
    String ORDER_CHANGE_AMOUNT_FAILED = "order.change.amount.failed";
    String VEHICLE_NOT_EXISTS = "vehicle.not.exists";
    String NO_CURRENT_POINT = "no.current.point";
    String NO_CURRENT_REGION = "no.current.region";
    String PATH_NOT_FOUND = "path.not.found";
}
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpTestOrderController.java
@@ -12,7 +12,7 @@
import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO;
import com.xiaopeng.api.dto.statistics.StatisticsQueryDTO;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.model.order.XpOrder;
import com.xiaopeng.api.model.order.XpTestOrder;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import com.xiaopeng.api.vo.automaticPilot.VehiclePosition;
import com.xiaopeng.api.vo.operation.RouteVo;
@@ -75,11 +75,52 @@
public class XpTestOrderController {
    private final IXpTestOrderService xpTestOrderService;
    private final RedisService redisService;
    @Autowired
    private MongoTemplate mongoTemplate;
    @Autowired
    private XpVehicleClient xpVehicleClient;
    /**
     * 通过订单id查询订单信息
     *
     * @param orderId 订单id
     * @return 订单详情
     */
    @PostMapping("/inner/testOrder/queryOrderById")
    public R<XpTestOrder> queryOrderById(@RequestParam Long orderId){
        XpTestOrder xpTestOrder = xpTestOrderService.getById(orderId);
        return R.ok(xpTestOrder);
    }
    /**
     * 修改订单状态
     * @param orderId
     * @param status
     * @return
     */
    @PostMapping("/inner/v1/testOrder/updateOrderStatus")
    public R<String> updateOrderStatus(@RequestParam Long orderId,
                                @RequestParam Integer status){
        xpTestOrderService.updateOrderStatus(orderId, status);
        return R.ok();
    }
    /**
     * 生成订单
     * @param query
     * @return
     */
    @ApiOperation(value = "生成订单", tags = {"管理后台-测试计划"})
    @PostMapping("/api/v1/testOrder/addTestOrder")
    public R<?> addTestOrder(@RequestBody AddTestOrderVo query){
        xpTestOrderService.addTestOrder(query);
        return R.ok();
    }
    /**
@@ -102,7 +143,7 @@
     * @return 订单详情
     */
    @ApiOperation(value = "订单详情", tags = {"管理后台-测试计划"})
    @GetMapping("/api/v1/order/queryById")
    @GetMapping("/api/v1/testOrder/queryById")
    public R<XpTestOrderDetailVO> queryById(@ApiParam(value = "订单id", required = true) @RequestParam Long id) {
        XpTestOrderDetailVO detail = xpTestOrderService.getOrderDetail(id);
        return R.ok(detail);
@@ -115,7 +156,7 @@
     * @return 操作结果
     */
    @ApiOperation(value = "删除订单", tags = {"管理后台-测试计划"})
    @DeleteMapping("/api/v1/order/deleteById")
    @DeleteMapping("/api/v1/testOrder/deleteById")
    public R<?> deleteById(@ApiParam(value = "订单id", required = true) @RequestParam Long id) {
        xpTestOrderService.deleteOrder(id);
        return R.ok();
@@ -129,7 +170,7 @@
     * @return 操作结果
     */
    @ApiOperation(value = "取消/关闭订单", tags = {"管理后台-测试计划"})
    @PostMapping("/api/v1/order/cancelAndCloseById")
    @PostMapping("/api/v1/testOrder/cancelAndCloseById")
    public R<?> cancelAndCloseById(@Validated @RequestBody XpOrderOperateDTO dto) {
        xpTestOrderService.cancelOrCloseOrder(dto.getOrderId(), dto.getType());
        return R.ok();
@@ -141,10 +182,10 @@
     * @param dto 改派请求参数
     * @return 操作结果
     */
    @ApiOperation(value = "改派订单", tags = {"管理后台-交易管理-订单管理"}, notes = "车辆列表在vehicleConvoy服务")
    @PostMapping("/api/v1/order/reassignById")
    @ApiOperation(value = "改派订单", tags = {"管理后台-测试计划"}, notes = "车辆列表在vehicleConvoy服务")
    @PostMapping("/api/v1/testOrder/reassignById")
    public R<?> reassignById(@Validated @RequestBody XpOrderReassignDTO dto) {
        xpOrderService.reassignOrder(
        xpTestOrderService.reassignOrder(
                dto.getOrderId(),
                dto.getVehicleId(),
                dto.getReassignReason()
@@ -153,276 +194,35 @@
    }
    @ApiOperation(value = "订单改价", tags = {"管理后台-交易管理-订单管理"})
    @PostMapping("/api/v1/order/changeAmount")
    @ApiOperation(value = "订单改价", tags = {"管理后台-测试计划"})
    @PostMapping("/api/v1/testOrder/changeAmount")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long"),
            @ApiImplicitParam(name = "amount", value = "新的订单金额", required = true, dataType = "BigDecimal")
    })
    public R<?> changeAmount(@RequestParam("id") Long id, @RequestParam("amount") BigDecimal amount) {
        xpOrderService.changeAmount(id, amount);
        xpTestOrderService.changeAmount(id, amount);
        return R.ok();
    }
    /**
     * 获取用户快捷胶囊 历史 时段 终点高点
     */
    @ApiOperation(value = "获取用户快捷胶囊 历史 时段 终点高点", tags = {"小程序-获取用户快捷胶囊 历史 时段 终点高点"})
    @GetMapping("/api/v1/mini-program/order/getUserQuickCapsule")
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<XpPointInfoVo> getUserQuickCapsule(HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        return R.ok(xpOrderService.getUserQuickCapsule(uid));
    }
    /**
     * 获取订单详情
     */
    @PutMapping("/api/v1/mini-program/order/orderDetail/{orderId}")
    @ApiOperation(value = "获取订单详情", tags = {"小程序-获取订单详情"})
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<OrderDetailVo> orderDetail(@PathVariable("orderId") Long orderId, HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        OrderDetailVo orderDetailVo = xpOrderService.orderDetail(orderId, uid);
        BigDecimal orderMoney = orderDetailVo.getOrderMoney();
        if(orderMoney==null){
            orderDetailVo.setOrderMoneyStr("0.00");
        }else {
            orderDetailVo.setOrderMoneyStr(orderMoney.setScale(2, RoundingMode.HALF_UP).toString());
        }
        return R.ok(orderDetailVo);
    }
    /**
     * 获取历史下单成功起点10条数据列表
     */
    @ApiOperation(value = "获取历史下单成功起点10条数据列表", tags = {"小程序-获取历史下单成功起点10条数据列表"})
    @GetMapping("/base/v1/mini-program/history/startPoints")
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<List<XpHistoryStartPointsVo>> getHistoryStartPoints(double lon, double lat,Long electronicAreaId, HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        return R.ok(xpOrderService.getHistoryStartPoints(uid, lon, lat,electronicAreaId));
    }
    /**
     * 获取历史下单成功终点点10条数据列表
     */
    @ApiOperation(value = "获取历史下单成功终点10条数据列表", tags = {"小程序-获取历史下单成功终点10条数据列表"})
    @GetMapping("/base/v1/mini-program/history/endPoints")
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<List<XpHistoryEndPointsVo>> getHistoryEndPoints(double lon, double lat,Long electronicAreaId, HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        return R.ok(xpOrderService.getHistoryEndPoints(uid, lon, lat,electronicAreaId));
    }
    /**
     * 获取正在进行中的订单
     */
    @ApiOperation(value = "获取正在进行中的订单", tags = {"小程序-获取正在进行中的订单"})
    @GetMapping("/api/v1/mini-program/order/active")
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<XpOrderDetailVO> getActiveOrder(HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        return R.ok(xpOrderService.getActiveOrder(uid));
    }
    /**
     * 查询历史订单列表
     */
    @ApiOperation(value = "查询历史订单列表", tags = {"小程序-查询历史订单列表"})
    @PostMapping("/api/v1/mini-program/order/history/list")
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<XpOrderHistoryVO> getHistoryOrderList(@RequestBody XpHistoryOrderListQuery query, HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        return R.ok(xpOrderService.getHistoryOrderList(query, uid));
    }
    /**
     * +
     * 取消订单
     */
    @PutMapping("/api/v1/mini-program/order/cancel/{orderId}")
    @ApiOperation(value = "取消订单", tags = {"小程序-取消订单"})
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R cancelOrder(@PathVariable("orderId") Long orderId, HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        xpOrderService.cancelOrder(orderId, uid);
        return R.ok();
    }
    /**
     * +
     * 手动结束订单
     */
    @PutMapping("/api/v1/mini-program/order/endTrip/{orderId}")
    @ApiOperation(value = "结束行程", tags = {"小程序-结束行程"})
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<?> endTrip(@PathVariable("orderId") Long orderId, HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        try {
            Boolean b = xpOrderService.endTrip(orderId, uid);
            return R.ok(b);
        } catch (Exception e) {
            return R.ok();
        }
    }
    /**
     * +
     * 获取行程费用明细
     */
    @PutMapping("/api/v1/mini-program/order/fare-breakdown/{orderId}")
    @ApiOperation(value = "获取行程费用明细", tags = {"小程序-获取行程费用明细"})
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<FareBreakdownVo> fareBreakdown(@PathVariable("orderId") Long orderId, HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        return xpOrderService.fareBreakdown(orderId, uid);
    }
    /**
     * +
     * 获取行程费用明细
     */
    @PutMapping("/api/v1/mini-program/order/feeDescription/{orderId}")
    @ApiOperation(value = "获取费用说明", tags = {"小程序-获取费用说明"})
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<String> feeDescription(@PathVariable("orderId") Long orderId, HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        return xpOrderService.feeDescription(orderId, uid);
    }
    /**
     * 订单评价
     */
    @PostMapping("/api/v1/mini-program/order/payment")
    @ApiOperation(value = "发起支付", tags = {"小程序-发起支付"})
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R payment(@Validated @RequestBody XpOrderPayDto dto, HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        return xpOrderService.payment(dto, uid);
    }
    /**
     * 订单评价
     */
    @PostMapping("/api/v1/mini-program/order/comment")
    @ApiOperation(value = "订单评价", tags = {"小程序-订单评价"})
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R comment(@Validated @RequestBody XpOrderCommentDto dto, HttpServletRequest request) {
        // uid已通过拦截器otp校验,可以直接使用
        String uid = request.getHeader("XP-Uid");
        xpOrderService.comment(dto, uid);
        return R.ok();
    }
    /**
     * 订单状态修改-车控消息推送我方调用(内部接口)
     */
    @ApiOperation(value = "订单状态推送修改")
    @PostMapping("/inner/v1/order/updateOrderStatus")
    public R<String> updateOrderStatus(@RequestParam Long orderId,
                                       @RequestParam Integer status) {
        return xpOrderService.updateOrderStatus(orderId, status);
    }
    /**
     * 业务流程-通过订单id查询车辆信息
     */
    @ApiOperation(value = "通过订单id查询车辆信息", tags = {"小程序-业务流程"})
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    @GetMapping("/api/v1/mini-program/order/queryVehicleByOrderId")
    public R<XpVehicle> queryVehicleByOrderId(@RequestParam Long orderId, HttpServletRequest request) {
        String uid = request.getHeader("XP-Uid");
        return R.ok(xpOrderService.queryVehicleByOrderId(orderId, uid));
    }
    /**
     * 订单车辆定位实时存储-订单车辆定位实时存储(内部接口)
     */
    @ApiOperation(value = "订单车辆定位实时存储")
    @PostMapping("/inner/v1/order/saveVehicleLocation")
    @PostMapping("/inner/v1/testOrder/saveVehicleLocation")
    public R<String> saveVehicleLocation(@RequestBody OrderTrajectoryVo vo) {
        OrderTrajectory orderTrajectory = new OrderTrajectory();
        BeanUtils.copyProperties(vo, orderTrajectory);
        xpOrderService.saveVehicleLocation(orderTrajectory);
        xpTestOrderService.saveVehicleLocation(orderTrajectory);
        return R.ok();
    }
    /**
     * 订单查询实时轨迹路线
     */
    @ApiOperation(value = "订单查询实时轨迹路线")
    @PostMapping("/api/v1/mini-program/order/queryOrderRoute")
    public R<RouteVo> queryOrderRoute(@Validated @RequestBody QueryOrderRouteDTO dto, HttpServletRequest request) {
        String uid = request.getHeader("XP-Uid");
        // 查询订单信息
        XpOrder xpOrder = xpOrderService.getById(dto.getOrderId());
        // 获取路线规划
//        RouteVo routeVo = redisService.getCacheObject(CacheConstants.ORDER_ROUTE_CAPTURE + "_" + dto.getOrderId() + "_" +dto.getRouteType());
        String key = "";
        //接驾情况,获取车辆位置到起点的导航
        if (xpOrder.getStatus() < 5) {
            key = "ORDER_NAVIGATION_START_DATA:" + xpOrder.getAppUserId();
        }
        //服务中,获取起点到终点的导航数据
        if (xpOrder.getStatus() >= 5) {
            key = "ORDER_NAVIGATION_END_DATA:" + xpOrder.getAppUserId();
        }
        Object cacheObject = redisService.getCacheObject(key);
        RouteVo routeVo = JSON.parseObject(cacheObject.toString(), RouteVo.class);
        XpVehicle xpVehicle = xpVehicleClient.queryById(xpOrder.getVehicleId()).getData();
        VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class);
        routeVo.setDirection(null != vehiclePosition ? vehiclePosition.getCourse() : 90);
        return R.ok(routeVo);
    }
    /**
     * 订单查询轨迹路线
     */
    @ApiOperation(value = "订单查询轨迹路线")
    @GetMapping("/api/v1/mini-program/order/queryOrderTrajectory")
    public R<RouteVo> queryOrderTrajectory(@RequestParam String orderId, HttpServletRequest request) {
        String uid = request.getHeader("XP-Uid");
        List<OrderTrajectory> trajectories = mongoTemplate.find(
                new Query(Criteria.where("orderId").is(Long.valueOf(orderId)))
                        .with(Sort.by(Sort.Direction.ASC, "locatetime")),
                OrderTrajectory.class
        );
        // 封装信息
        RouteVo routeVo = new RouteVo();
        List<LonLatDto> polyline = new ArrayList<>();
        if(!CollectionUtils.isEmpty(trajectories)){
            for (OrderTrajectory trajectory : trajectories) {
                LonLatDto lonLatDto = new LonLatDto();
                String[] split = trajectory.getLocation().split(",");
                lonLatDto.setLongitude(Double.valueOf(split[0]));
                lonLatDto.setLatitude(Double.valueOf(split[1]));
                polyline.add(lonLatDto);
            }
        }
        routeVo.setPolyline(polyline);
        return R.ok(routeVo);
    }
}
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/model/vo/AddTestOrderVo.java
New file
@@ -0,0 +1,22 @@
package com.xiaopeng.order.model.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel
public class AddTestOrderVo {
    @ApiModelProperty("测试计划id")
    private Long testPlanId;
    @ApiModelProperty("测试计划点位id")
    private Long testPlanPointId;
    @ApiModelProperty("订单类型(1=测试单,2=巡游单)")
    private Integer orderType;
    @ApiModelProperty("是否停车(0=否,1=是)")
    private Integer stopFlag;
}
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/IXpTestOrderService.java
@@ -23,6 +23,7 @@
import com.xiaopeng.order.model.query.XpTestOrderPageQuery;
import com.xiaopeng.order.model.vo.*;
import com.xiaopeng.order.vo.OrderDetailVo;
import org.springframework.web.bind.annotation.RequestBody;
import java.math.BigDecimal;
import java.util.List;
@@ -38,12 +39,11 @@
public interface IXpTestOrderService extends IService<XpTestOrder> {
    /**
     * 获取订单统计数据
     *
     * @param query 查询参数
     * @return 订单统计数据
     * 添加测试单
     * @param query
     */
    OrderStatisticsDTO getOrderStatistics(StatisticsQueryDTO query);
    void addTestOrder(AddTestOrderVo query);
    /**
     * 订单分页列表
@@ -68,13 +68,6 @@
     */
    void deleteOrder(Long id);
    /**
     * 导出订单列表
     *
     * @param query 查询参数
     * @return 订单列表
     */
    List<XpOrderPageVO> exportList(XpOrderExcelQuery query);
    /**
     * 取消或关闭订单
@@ -93,62 +86,6 @@
     */
    void reassignOrder(Long orderId, Long newVehicleId, String reassignReason);
    /**
     *  获取用户快捷胶囊
     * @param uid
     * @return
     */
    XpPointInfoVo getUserQuickCapsule(String uid);
    /**
     * 获取历史下单成功起点10条数据列表
     * @param uid
     * @return
     */
    List<XpHistoryStartPointsVo> getHistoryStartPoints(String uid,double lon,double lat,Long electronicAreaId);
    /**
     * 获取正在进行中的订单
     * @param uid
     * @return
     */
    XpOrderDetailVO getActiveOrder(String uid);
    /**
     * 获取历史下单成功终点10条数据列表
     * @param uid
     * @return
     */
    List<XpHistoryEndPointsVo> getHistoryEndPoints(String uid, double lon, double lat,Long electronicAreaId);
    /**
     * 获取历史订单列表
     * @param query
     * @param uid
     * @return
     */
    XpOrderHistoryVO getHistoryOrderList(XpHistoryOrderListQuery query, String uid);
    /**
     * 取消订单
     * @param orderId
     * @param uid
     */
    void cancelOrder(Long orderId,String uid);
    /**
     * 取消订单
     * @param orderId
     */
    XpOrder cancelOrder(String orderId);
    /**
     * 评价订单
     * @param dto
     * @param uid
     */
    void comment(XpOrderCommentDto dto, String uid);
    /**
     * 修改订单状态
@@ -158,52 +95,18 @@
     */
    R<String> updateOrderStatus(Long orderId, Integer status);
    Boolean endTrip(Long orderId, String uid);
    /**
     * 添加巡游任务 下发命令
     * @param vehicle
     * @param order
     */
    void addCruiseMission(Long vehicleId, XpTestOrder order);
    Boolean endTrip(Long orderId);
    /**
     * 取消订单后的继续巡游任务
     */
    void addCruiseMission(Long vehicleId);
    R<FareBreakdownVo> fareBreakdown(Long orderId, String uid);
    R payment(XpOrderPayDto dto, String uid);
    /**
     * 添加订单
     * @param xpOrder
     * @return
     */
    boolean addOrder(XpTestOrder xpOrder);
    /**
     * 根据订单ID查询车辆信息
     * @param orderId 订单ID
     * @param uid
     * @return
     */
    XpVehicle queryVehicleByOrderId(Long orderId, String uid);
    /**
     * 获取订单数量
     * @return
     */
    Integer getOrderNum(GetOrderNumDto dto);
    /**
     * 查询指定城市进行中的订单数量(status=1)
     *
     * @param cityId 开通城市ID
     * @return 进行中订单数量
     */
    Integer countActiveOrdersByCityId(Long cityId);
    /**
     * 保存车辆位置信息
@@ -211,15 +114,6 @@
     */
    void saveVehicleLocation(OrderTrajectory orderTrajectory);
    /**
     * 成功操作下发命令后调用 用于弹出redis队列的获取成功的数据
     * @param dto
     */
    void popOrder(PopOrderDto dto);
    OrderDetailVo orderDetail(Long orderId, String uid);
    R<String> feeDescription(Long orderId, String uid);
    /**
     * 订单改价
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -83,10 +83,7 @@
import com.xiaopeng.order.model.query.XpOrderExcelQuery;
import com.xiaopeng.order.model.query.XpOrderPageQuery;
import com.xiaopeng.order.model.vo.*;
import com.xiaopeng.order.service.IXpOrderCancelService;
import com.xiaopeng.order.service.IXpOrderEvaluateService;
import com.xiaopeng.order.service.IXpOrderReassignService;
import com.xiaopeng.order.service.IXpOrderService;
import com.xiaopeng.order.service.*;
import com.xiaopeng.order.utils.GDMapGeocodingUtil;
import com.xiaopeng.order.utils.TaxiPricingDemoService;
import com.xiaopeng.order.utils.RegionCodeFilterUtil;
@@ -156,6 +153,7 @@
    private final XpCruisePlanClient xpCruisePlanClient;
    private final XpPricingUtil xpPricingUtil;
    private final GDMapGeocodingUtil gdMapGeocodingUtil;
    private final IXpTestOrderService xpTestOrderService;
    @Autowired
@@ -995,7 +993,6 @@
                    log.info("已将原车辆状态设为空闲,车辆ID: {}", oldVehicleId);
                    // 6.1.4 为原车辆创建返程巡游订单
                    --------------
                    createReturnCruiseOrder(oldVehicle.getId(), order);
                } else {
                    log.warn("查询原车辆信息失败,车辆ID: {}", oldVehicleId);
@@ -2197,9 +2194,11 @@
                xpVehicleClient.updateVehicleById(vehicle1);
                //找到车辆的收车点位 更新终点点位
                R<XpCruiseOrder> returnCruisePoint = xpCruisePlanClient.findReturnCruisePoint(xpCruiseOrder);
                xpCruiseOrder = returnCruisePoint.getData();
                xpCruiseOrder.setOrderType(2);
                xpCruiseOrder.setOrderReverse(1);
                if(200 != returnCruisePoint.getCode()){
                    xpCruiseOrder = returnCruisePoint.getData();
                    xpCruiseOrder.setOrderType(2);
                    xpCruiseOrder.setOrderReverse(1);
                }
            }
        }
        xpCruiseOrderMapper.insert(xpCruiseOrder);
@@ -2309,9 +2308,11 @@
                xpVehicleClient.updateVehicleById(vehicle1);
                //找到车辆的收车点位 更新终点点位
                R<XpCruiseOrder> returnCruisePoint = xpCruisePlanClient.findReturnCruisePoint(xpCruiseOrder);
                xpCruiseOrder = returnCruisePoint.getData();
                xpCruiseOrder.setOrderType(2);
                xpCruiseOrder.setOrderReverse(1);
                if(200 != returnCruisePoint.getCode()){
                    xpCruiseOrder = returnCruisePoint.getData();
                    xpCruiseOrder.setOrderType(2);
                    xpCruiseOrder.setOrderReverse(1);
                }
            }
        }
@@ -2922,6 +2923,32 @@
                sendRoute(addTaxiPassengerVo.getUid(), orderId, "ORDER_NAVIGATION_START_DATA", dto.getXpVehicleVin());
            }
        }
        //测试订单
        if (OrderType.TEST_ORDER.equals(orderType)) {
            XpTestOrder xpTestOrder = xpTestOrderService.getById(orderId);
            //订单为待接单状态
            if (xpTestOrder.getStatus() < 4) {
                xpTestOrder.setAcceptanceTime(LocalDateTime.now());
                R<XpVehicle> byVehicleVin = xpVehicleClient.findByVehicleVin(dto.getXpVehicleVin());
                XpVehicle vehicle = null;
                if (byVehicleVin.getCode() == 200) {
                    vehicle = byVehicleVin.getData();
                    xpTestOrder.setVehicleId(vehicle.getId());
                    xpTestOrder.setFleetId(vehicle.getFleetId());
                }
                xpTestOrder.setStatus(2);
                // 修改车辆信息
                XpVehicle vehicle1 = new XpVehicle();
                vehicle1.setId(vehicle.getId());
                vehicle1.setState(1);
                xpVehicleClient.updateVehicleById(vehicle1);
                xpTestOrder.setVehicleId(null);
                xpTestOrderService.updateById(xpTestOrder);
                redisService.setCacheObject("ORDER_STATUS:" + xpTestOrder.getId(), 2, 24L, TimeUnit.HOURS);
            }
        }
    }
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpTestOrderServiceImpl.java
Diff too large
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/webSocket/handler/WebSocketAuthHandler.java
@@ -37,7 +37,7 @@
    
    // 令牌秘钥
//    @Value("${token.secret}")
    private String secret = "abcdefghijklmnopqrstuvwxyz";
    private String secret = "iymGhx1XkAAHrex2Zf4ASbiD9P2ksTam";
    /**
     * 验证用户认证信息
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/service/impl/XpVehicleServiceImpl.java
@@ -1015,7 +1015,7 @@
    public Boolean getVehicleTrunkOpenStatus(Long uid, Long id) {
        XpVehicle xpVehicle = this.getById(id);
        try {
            VehicleTemperatureDto vehicleTemperatureDto = vehicleControlUtil.queryVehicleTemperature(uid, xpVehicle.getVehicleVin());
            VehicleTemperatureDto vehicleTemperatureDto = vehicleControlUtil.queryVehicleTemperature(uid.toString(), xpVehicle.getVehicleVin());
            log.info("查询车辆温度成功:{}", vehicleTemperatureDto);
            VehicleStateVo trunkAjarCloseSt = vehicleTemperatureDto.getStateMap().get("trunkAjarCloseSt");
            if(null == trunkAjarCloseSt){