“mitao”
2026-03-02 103726c48a510af9fcdd8d7e88d8c5fd5fef0cc9
Merge remote-tracking branch 'origin/master'
1个文件已添加
32个文件已修改
1072 ■■■■■ 已修改文件
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/config/MyLocaleResolver.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCouponServiceImpl.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/order/AddCruiseMissionDto.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/XpCruisePlanClientFallbackFactory.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/order/XpCruiseOrderClientFallbackFactory.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/operation/XpCruisePlanClient.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/order/XpCruiseOrderClient.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/config/MyLocaleResolver.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/OrderMissionController.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/config/MyLocaleResolver.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/config/MyLocaleResolver.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/config/MyLocaleResolver.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/constant/I18nKeyConstant.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpPointManagementController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java 331 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/resources/i18n/messages.properties 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/resources/i18n/messages_en_US.properties 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/resources/i18n/messages_zh_CN.properties 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpCruisePlanController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/resources/i18n/messages.properties 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/resources/i18n/messages_en_US.properties 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/resources/i18n/messages_zh_CN.properties 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/config/MyLocaleResolver.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpCruiseOrderController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpOrderController.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/job/jobs/EndTripJob.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/IXpOrderService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java 258 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-payment-boot/src/main/java/com/xiaopeng/payment/config/MyLocaleResolver.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/config/MyLocaleResolver.java 161 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-remote-driving-boot/src/main/java/com/xiaopeng/remoteDriving/config/MyLocaleResolver.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/config/MyLocaleResolver.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/config/MyLocaleResolver.java
@@ -23,6 +23,7 @@
        Locale locale = null;
        if (StringUtils.isEmpty(language)) {
            locale = Locale.getDefault();
            language = "1";
        }
        //如果请求不为空 
        //If the request is not empty.
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCouponServiceImpl.java
@@ -155,7 +155,7 @@
                    xpAppUserCoupon.setCouponId(dto.getCouponId());
                    xpAppUserCoupon.setAppUserId(uid);
                    xpAppUserCoupon.setExpirationTime(LocalDateTime.now().plusDays(100));
                    xpAppUserCoupon.setStatus(0);
                    xpAppUserCoupon.setStatus(1);
                    xpAppUserCoupon.setCouponType(xpCoupon.getCouponType());
                    xpAppUserCoupon.setPhone(phone);
@@ -171,7 +171,7 @@
                    xpAppUserCoupon.setCouponId(dto.getCouponId());
                    xpAppUserCoupon.setAppUserId(uid);
                    xpAppUserCoupon.setExpirationTime(LocalDateTime.now().plusDays(100));
                    xpAppUserCoupon.setStatus(0);
                    xpAppUserCoupon.setStatus(1);
                    xpAppUserCoupon.setCouponType(xpCoupon.getCouponType());
                    xpAppUserCoupon.setPhone(phone);
xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/order/AddCruiseMissionDto.java
New file
@@ -0,0 +1,12 @@
package com.xiaopeng.api.dto.order;
import com.xiaopeng.api.model.order.XpOrder;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import lombok.Data;
@Data
public class AddCruiseMissionDto {
    private XpVehicle vehicle;
    private XpOrder order;
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/operation/XpCruisePlanClientFallbackFactory.java
@@ -6,6 +6,7 @@
import com.xiaopeng.api.dto.order.HistoryStartPointsDto;
import com.xiaopeng.api.feignClient.operation.XpCruisePlanClient;
import com.xiaopeng.api.feignClient.operation.XpPointClient;
import com.xiaopeng.api.model.operation.XpCruisePlanVehicle;
import com.xiaopeng.api.model.operation.XpElectronicFenceArea;
import com.xiaopeng.api.model.operation.XpPoint;
import com.xiaopeng.api.model.order.XpCruiseOrder;
@@ -47,6 +48,12 @@
                return null;
            }
            @Override
            public R<XpCruisePlanVehicle> getCruisePlan(Long vehicleId) {
                log.error("XpCruisePlanClientFallbackFactory getCruisePlan error:{}", cause.getMessage());
                return null;
            }
        };
    }
xp-robotaxi-api/src/main/java/com/xiaopeng/api/factory/order/XpCruiseOrderClientFallbackFactory.java
@@ -1,5 +1,6 @@
package com.xiaopeng.api.factory.order;
import com.xiaopeng.api.dto.order.AddCruiseMissionDto;
import com.xiaopeng.api.dto.order.GetOrderNumDto;
import com.xiaopeng.api.dto.order.PopOrderDto;
import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO;
@@ -36,6 +37,12 @@
            }
            @Override
            public R<?> addCruiseMission(AddCruiseMissionDto dto) {
                log.error("订单服务调用失败: {}", cause.getMessage());
                return null;
            }
            @Override
            public R<String> updateCruiseOrder(String vin) {
                log.error("订单服务调用失败: {}", cause.getMessage());
                return null;
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/operation/XpCruisePlanClient.java
@@ -6,9 +6,7 @@
import com.xiaopeng.api.dto.order.HistoryStartPointsDto;
import com.xiaopeng.api.factory.operation.XpCruisePlanClientFallbackFactory;
import com.xiaopeng.api.factory.operation.XpPointClientFallbackFactory;
import com.xiaopeng.api.model.operation.XpCruisePlanPoint;
import com.xiaopeng.api.model.operation.XpElectronicFenceArea;
import com.xiaopeng.api.model.operation.XpPoint;
import com.xiaopeng.api.model.operation.*;
import com.xiaopeng.api.model.order.XpCruiseOrder;
import com.xiaopeng.api.query.operation.PointListQuery;
import com.xiaopeng.api.query.operation.PointPageListListQuery;
@@ -52,4 +50,15 @@
    @PostMapping("/inner/cruise/findReturnCruisePoint")
    R<XpCruiseOrder> findReturnCruisePoint(@RequestBody XpCruiseOrder xpCruiseOrder);
    /**
     * 获取巡游计划
     * @param vehicleId
     * @return
     */
    @PostMapping("/inner/cruise/getCruisePlan")
    R<XpCruisePlanVehicle> getCruisePlan(@RequestParam Long vehicleId);
}
xp-robotaxi-api/src/main/java/com/xiaopeng/api/feignClient/order/XpCruiseOrderClient.java
@@ -1,5 +1,6 @@
package com.xiaopeng.api.feignClient.order;
import com.xiaopeng.api.dto.order.AddCruiseMissionDto;
import com.xiaopeng.api.dto.order.GetOrderNumDto;
import com.xiaopeng.api.dto.order.PopOrderDto;
import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO;
@@ -37,6 +38,16 @@
    /**
     * 添加巡游任务 下发命令
     * @param dto
     * @return
     */
    @PostMapping("/inner/cruiseOrder/addCruiseMission")
    R<?> addCruiseMission(@RequestBody AddCruiseMissionDto dto);
    /**
     * 查询并关闭订单信息  返回id信息
     *
     * @param vin 订单信息
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/config/MyLocaleResolver.java
@@ -23,6 +23,7 @@
        Locale locale = null;
        if (StringUtils.isEmpty(language)) {
            locale = Locale.getDefault();
            language = "1";
        }
        //如果请求不为空 
        //If the request is not empty.
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/controller/OrderMissionController.java
@@ -153,9 +153,22 @@
     * @return
     */
    @GetMapping("/base/v1/order/acceptingOrder")
    public R acceptingOrder(Long orderId, Long vehicleId, Double startLon, Double startLat){
    public R acceptingOrder(Long orderId, String code, Long vehicleId, Double startLon, Double startLat){
        if(null == vehicleId){
            vehicleId = 1L;
        }
        if(null == startLat || null == startLon){
            startLat = 23.157155D;
            startLon = 113.382373D;
        }
        XpVehicle xpVehicle = xpVehicleClient.queryById(vehicleId).getData();
        XpOrder xpOrder = xpOrderClient.queryOrderById(orderId).getData();
        XpOrder xpOrder = null;
        if(null != orderId){
            xpOrder = xpOrderClient.queryOrderById(orderId).getData();
        }
        if(StringUtils.isNotEmpty(code)){
            xpOrder = xpOrderClient.queryOrderByOrderNo(code).getData();
        }
        OrderRouteAndFareDto dto = new OrderRouteAndFareDto();
        dto.setOrderId(orderId);
        LonLatDto origin = new LonLatDto();
@@ -199,17 +212,6 @@
            log.error("推送消息失败:{}", stringR.getMsg());
        }
        xpOrderClient.updateOrderStatus(orderId, OrderStatusEnum.PICK_UP.getCode());
//        PushOrderRouteDTO dto3 = new PushOrderRouteDTO();
//        dto3.setOrderId(orderId);
//        dto3.setRouteType(1);
//        dto3.setLongitude(startLon);
//        dto3.setLatitude(startLat);
//        dto3.setDuration(10);
//        dto3.setDistance(2);
//        dto3.setDirection(60);
//        xpPushMessageClient.pushOrderRoute(dto3);
        return r;
    }
@@ -219,9 +221,18 @@
     * @param orderId
     */
    @GetMapping("/base/v1/order/pushStartDriverLocation")
    private void pushStartDriverLocation(Long vehicleId, Long orderId){
    private void pushStartDriverLocation(Long vehicleId, Long orderId, String code){
        if(null == vehicleId){
            vehicleId = 1L;
        }
        XpVehicle xpVehicle = xpVehicleClient.queryById(vehicleId).getData();
        XpOrder xpOrder = xpOrderClient.queryOrderById(orderId).getData();
        XpOrder xpOrder = null;
        if(null != orderId){
            xpOrder = xpOrderClient.queryOrderById(orderId).getData();
        }
        if(StringUtils.isNotEmpty(code)){
            xpOrder = xpOrderClient.queryOrderByOrderNo(code).getData();
        }
        String vin = xpVehicle.getVehicleVin();
        Long appUserId = xpOrder.getAppUserId();
        Object cacheObject = redisService.getCacheObject("ORDER_NAVIGATION_START_DATA:" + xpOrder.getAppUserId());
@@ -309,8 +320,14 @@
     * @return
     */
    @GetMapping("/base/v1/order/updateOrderStatus")
    public R updateOrderStatus(Long orderId, Integer status) {
        XpOrder xpOrder = xpOrderClient.queryOrderById(orderId).getData();
    public R updateOrderStatus(Long orderId, String code, Integer status) {
        XpOrder xpOrder = null;
        if(null != orderId){
            xpOrder = xpOrderClient.queryOrderById(orderId).getData();
        }
        if(StringUtils.isNotEmpty(code)){
            xpOrder = xpOrderClient.queryOrderByOrderNo(code).getData();
        }
        //构建推送消息
        Map<String, Object> params = new HashMap<>();
        Map<String, Object> content = new HashMap<>();
@@ -368,9 +385,18 @@
     * @param orderId
     */
    @GetMapping("/base/v1/order/pushEndDriverLocation")
    private void pushEndDriverLocation(Long vehicleId, Long orderId){
    private void pushEndDriverLocation(Long vehicleId, Long orderId, String code){
        if(null == vehicleId){
            vehicleId = 1L;
        }
        XpVehicle xpVehicle = xpVehicleClient.queryById(vehicleId).getData();
        XpOrder xpOrder = xpOrderClient.queryOrderById(orderId).getData();
        XpOrder xpOrder = null;
        if(null != orderId){
            xpOrder = xpOrderClient.queryOrderById(orderId).getData();
        }
        if(StringUtils.isNotEmpty(code)){
            xpOrder = xpOrderClient.queryOrderByOrderNo(code).getData();
        }
        String vin = xpVehicle.getVehicleVin();
        Long appUserId = xpOrder.getAppUserId();
        Object cacheObject = redisService.getCacheObject("ORDER_NAVIGATION_END_DATA:" + xpOrder.getAppUserId());
xp-robotaxi-automatic-pilot-boot/src/main/java/com/xiaopeng/automaticPilot/service/KafkaConsumerService.java
@@ -9,6 +9,7 @@
import com.xiaopeng.api.dto.operation.CruisePointDto;
import com.xiaopeng.api.dto.operation.LonLatDto;
import com.xiaopeng.api.dto.operation.ReassignOrderDTO;
import com.xiaopeng.api.dto.order.AddCruiseMissionDto;
import com.xiaopeng.api.dto.order.PopOrderDto;
import com.xiaopeng.api.dto.pushMessage.PushOrderRouteDTO;
import com.xiaopeng.api.dto.pushMessage.SendMessageDTO;
@@ -22,10 +23,16 @@
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.vehicleConvoy.XpFleet;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import com.xiaopeng.api.vo.OrderType;
import com.xiaopeng.api.vo.SystemEventType;
import com.xiaopeng.api.vo.automaticPilot.VehiclePosition;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.ActionType;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.OrderOperationType;
import com.xiaopeng.api.vo.automaticPilot.proto.down.cloudOrderOperation.PointType;
import com.xiaopeng.api.vo.automaticPilot.proto.up.navigationDeviationEvent.NavigationDeviationMessage;
import com.xiaopeng.api.vo.automaticPilot.proto.up.orderStateUpdateEvent.OrderStatusInfoEvent;
import com.xiaopeng.api.vo.automaticPilot.protobuf.*;
import com.xiaopeng.api.vo.automaticPilot.protobuf.AbnormalReason;
import com.xiaopeng.api.vo.automaticPilot.protobuf.GearLevel;
@@ -107,6 +114,7 @@
    @Resource
    private XpCruisePlanClient xpCruisePlanClient;
@@ -785,6 +793,26 @@
                    //下车完成
                    buildPushOrderStatus(orderId, OrderStatusEnum.APPROVAL_REJECTION, sequence);
                    xpOrderClient.updateOrderStatus(Long.parseLong(orderId), OrderStatusEnum.APPROVAL_REJECTION.getCode());
                    // 下发巡游任务
                    R<XpOrder> xpOrderR = xpOrderClient.queryOrderById(Long.parseLong(orderId));
                    if(xpOrderR.getCode()==200){
                        XpOrder orderData = xpOrderR.getData();
                        Long vehicleId =orderData.getVehicleId();
                        R<XpVehicle> xpVehicleR = xpVehicleClient.queryById(vehicleId);
                        if(xpVehicleR.getData()!=null){
                            XpVehicle xpVehicle = xpVehicleR.getData();
                            AddCruiseMissionDto addCruiseMissionDto = new AddCruiseMissionDto();
                            addCruiseMissionDto.setOrder(orderData);
                            addCruiseMissionDto.setVehicle(xpVehicle);
                            xpCruiseOrderClient.addCruiseMission(addCruiseMissionDto);
                        }
                    }
                    break;
                case ORDER_COMPLETED:
                    //已完成
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/config/MyLocaleResolver.java
@@ -23,11 +23,9 @@
        Locale locale = null;
        if (StringUtils.isEmpty(language)) {
            locale = Locale.getDefault();
            language = "1";
        }
        if(language==null){
            language="1";
        }
        //如果请求不为空
        //如果请求不为空
        //If the request is not empty.
        if (language.equals("1")) {
            locale = new Locale("zh", "CN");
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/config/MyLocaleResolver.java
@@ -23,12 +23,10 @@
        Locale locale = null;
        if (StringUtils.isEmpty(language)) {
            locale = Locale.getDefault();
            language = "1";
        }
        //如果请求不为空 
        //If the request is not empty.
        if(null == language){
            language = "1";
        }
        if (language.equals("1")) {
            locale = new Locale("zh", "CN");
        } else if (language.equals("2")) {
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/config/MyLocaleResolver.java
@@ -23,6 +23,7 @@
        Locale locale = null;
        if (StringUtils.isEmpty(language)) {
            locale = Locale.getDefault();
            language = "1";
        }
        //如果请求不为空 
        //If the request is not empty.
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/constant/I18nKeyConstant.java
@@ -26,7 +26,7 @@
    // 添加电子围栏失败
    String ADD_ELECTRONIC_ERROR = "add.electronic.error";
    // 区域重叠
    String AREA_OVERLAP = "area.overlap";
    String AREA_OVERLAP_ERROR = "area.overlap.error";
    // 围栏构成不存在
    String FENCE_STRUCTURE_NOT_EXIST = "fence.structure.not.exist";
    // 围栏不存在
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpPointManagementController.java
@@ -48,7 +48,8 @@
    @PostMapping("/listElectronicFenceArea")
    public R<List<XpElectronicFenceArea>> listElectronicFenceArea() {
        // 获取所有启用的电子围栏
        List<XpElectronicFence> electronicFences = xpElectronicFenceService.lambdaQuery().eq(XpElectronicFence::getStatus, 2).list();
        List<XpElectronicFence> electronicFences = xpElectronicFenceService.lambdaQuery()
                .eq(XpElectronicFence::getStatus, 2).list();
        List<Long> electronicFenceIds = electronicFences.stream().map(XpElectronicFence::getId).collect(Collectors.toList());
        if (electronicFenceIds.isEmpty()) {
            return R.ok(new ArrayList<XpElectronicFenceArea>());
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpElectronicFenceServiceImpl.java
@@ -11,7 +11,6 @@
import com.xiaopeng.api.model.map.XpGeoFencingProhibitedPolygon;
import com.xiaopeng.api.model.operation.*;
import com.xiaopeng.api.query.operation.ElectronicPageListQuery;
import com.xiaopeng.api.vo.operation.XpElectronicFenceVo;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.exception.ServiceException;
import com.xiaopeng.common.core.utils.DateUtils;
@@ -41,7 +40,6 @@
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -110,182 +108,177 @@
    }
    @Override
    public R addElectronic(ElectronicFenceAddDto dto) {
        try {
            // 获取现有的运营区域(areaType=1)
            LambdaQueryWrapper<XpElectronicFenceArea> xpElectronicFenceAreaLambdaQueryWrapper = new LambdaQueryWrapper<>();
            xpElectronicFenceAreaLambdaQueryWrapper.eq(XpElectronicFenceArea::getAreaType, 1);
            List<XpElectronicFenceArea> existingOperationAreas = xpElectronicFenceAreaMapper.selectList(xpElectronicFenceAreaLambdaQueryWrapper);
        // 获取现有的运营区域(areaType=1)
        LambdaQueryWrapper<XpElectronicFenceArea> xpElectronicFenceAreaLambdaQueryWrapper = new LambdaQueryWrapper<>();
        xpElectronicFenceAreaLambdaQueryWrapper.eq(XpElectronicFenceArea::getAreaType, 1);
        List<XpElectronicFenceArea> existingOperationAreas = xpElectronicFenceAreaMapper.selectList(xpElectronicFenceAreaLambdaQueryWrapper);
            // 获取待添加的新区域
            List<XpElectronicFenceArea> newElectronicFenceAreas = dto.getElectronicFenceAreas();
        // 获取待添加的新区域
        List<XpElectronicFenceArea> newElectronicFenceAreas = dto.getElectronicFenceAreas();
            // 检查新区域与现有运营区域是否有重叠
            for (XpElectronicFenceArea newArea : newElectronicFenceAreas) {
                if (newArea.getAreaType() == 1) { // 只检查运营区域
                    for (XpElectronicFenceArea existingArea : existingOperationAreas) {
                        if (polygonOverlapService.checkPolygonOverlap(
                                newArea.getFencePoints(),
                                existingArea.getFencePoints())) {
                            throw new ServiceException(
                                    "运营区域{}与现有运营区域{}发生重叠",
                                    I18nKeyConstant.EDIT_ELECTRONIC_ERROR,
                                    new Object[]{existingArea.getAreaName(), existingArea.getAreaName()}
                            );
                        }
                    }
                }
            }
            // 保存主表数据
            XpElectronicFence xpElectronicFence = new XpElectronicFence();
            BeanUtils.copyProperties(dto, xpElectronicFence);
            xpElectronicFence.setStatus(0);
            if (dto.getStatus() == 0) {
                xpElectronicFence.setStatus(0);
            } else if (dto.getStatus() == 1) {
                if (dto.getEffectType() == 1) {
                    // 设置为启用中
                    xpElectronicFence.setStatus(2);
                    xpElectronicFence.setEffectTime(LocalDateTime.now());
                } else {
                    if (dto.getEffectTime().isBefore(LocalDateTime.now())) {
                        // 设置为启用中
                        xpElectronicFence.setStatus(2);
                    } else {
                        xpElectronicFence.setStatus(1);
                    }
                }
            }
            xpElectronicFence.setCityCode(dto.getCityCode());
            // 生成围栏id 规则:城市首字母-类型简写-4位自增流水号(如 SZ-OP-001),支持复制;数据停用或删除后,流水号不回收
            XpRegion xpRegion = xpRegionMapper.selectOne(new LambdaQueryWrapper<XpRegion>()
                    .eq(XpRegion::getCode, dto.getCityCode()));
            String name = xpRegion.getName();
            this.save(xpElectronicFence);
            // 根据城市中文名,截取前两位的首字母并且大写
            // 截取前两个字符
            String prefix = name.substring(0, 2);
            // 获取拼音首字母并大写
            String result = getPinyinInitials(prefix).toUpperCase();
            xpElectronicFence.setElectronicNumber(result + "-OP-" + String.format("%04d", xpElectronicFence.getId()));
            if (dto.getStatus() == 0) {
                xpElectronicFence.setStatus(0);
            } else if (dto.getStatus() == 1) {
                if (dto.getEffectType() == 1) {
                    // 设置为启用中
                    xpElectronicFence.setStatus(2);
                    xpElectronicFence.setEffectTime(LocalDateTime.now());
                } else {
                    if (dto.getEffectTime().isBefore(LocalDateTime.now())) {
                        // 设置为启用中
                        xpElectronicFence.setStatus(2);
                    } else {
                        // 添加定时任务job type=1电子围栏生效 type=2电子围栏失效
                        Map<String, ? extends Object> maps =
                                new ImmutableMap.Builder<String, Long>().
                                        put("type", 1L)
                                        .put("id", xpElectronicFence.getId())
                                        .build();
                        QuartzManager.addJob(
                                ElectronicEffectJob.class,
                                (ElectronicEffectJob.effect + xpElectronicFence.getId()).toUpperCase(),
                                TimeJobType.ELECTRONIC_EFFECT,
                                DateUtils.localDateTimeToDate(dto.getEffectTime()),
                                maps
        // 检查新区域与现有运营区域是否有重叠
        for (XpElectronicFenceArea newArea : newElectronicFenceAreas) {
            if (newArea.getAreaType() == 1) { // 只检查运营区域
                for (XpElectronicFenceArea existingArea : existingOperationAreas) {
                    if (polygonOverlapService.checkPolygonOverlap(
                            newArea.getFencePoints(),
                            existingArea.getFencePoints())) {
                        throw new ServiceException(
                                "运营区域{}与现有运营区域{}发生重叠",
                                I18nKeyConstant.EDIT_ELECTRONIC_ERROR,
                                new Object[]{existingArea.getAreaName(), existingArea.getAreaName()}
                        );
                        xpElectronicFence.setStatus(1);
                    }
                }
                if (dto.getFailureType() != null && dto.getFailureType() == 2) {
                    if (dto.getFailureTime().isBefore(LocalDateTime.now())) {
                        // 设置待启用
                        xpElectronicFence.setStatus(1);
                    } else {
                        // 添加定时任务job type=1电子围栏生效 type=2电子围栏失效
                        Map<String, ? extends Object> maps =
                                new ImmutableMap.Builder<String, Long>().
                                        put("type", 2L)
                                        .put("id", xpElectronicFence.getId())
                                        .build();
                        QuartzManager.addJob(
                                ElectronicEffectJob.class,
                                (ElectronicEffectJob.failure + xpElectronicFence.getId()).toUpperCase(),
                                TimeJobType.ELECTRONIC_FAILURE,
                                DateUtils.localDateTimeToDate(dto.getEffectTime()),
                                maps
                        );
                        xpElectronicFence.setStatus(1);
                    }
                }
            }
            this.updateById(xpElectronicFence);
            if (xpElectronicFence.getStatus() == 2) {
                // 设置电子围栏ID并保存区域数据
                for (XpElectronicFenceArea area : newElectronicFenceAreas) {
                    area.setElectronicId(xpElectronicFence.getId());
                    area.setAreaStatus(1);
                    area.setArea(area.getArea());
                    area.setCityCode(dto.getCityCode());
                    xpElectronicFenceAreaMapper.insert(area);
                }
            }else{
                // 设置电子围栏ID并保存区域数据
                for (XpElectronicFenceArea area : newElectronicFenceAreas) {
                    area.setElectronicId(xpElectronicFence.getId());
                    area.setAreaStatus(2);
                    area.setArea(area.getArea());
                    area.setCityCode(dto.getCityCode());
                    xpElectronicFenceAreaMapper.insert(area);
                }
            }
            if (xpElectronicFence.getStatus() == 2) {
                for (XpElectronicFenceArea newElectronicFenceArea : newElectronicFenceAreas) {
                    if (newElectronicFenceArea.getAreaType() == 1
                            && newElectronicFenceArea.getAreaStatus() == 1) {
                        XpGeoFencingPolygon xpGeoFencingPolygon = new XpGeoFencingPolygon();
                        xpGeoFencingPolygon.setFenceId(String.valueOf(xpElectronicFence.getId()));
                        xpGeoFencingPolygon.setName(xpElectronicFence.getElectronicName());
                        xpGeoFencingPolygon.setAreaId(String.valueOf(newElectronicFenceArea.getId()));
                        xpGeoFencingPolygon.setCityCode(xpElectronicFence.getCityCode());
                        xpGeoFencingPolygon.setOperationStrategy(xpElectronicFence.getOperationStrategy());
                        // 将围栏点转换为GeoJSON多边形
                        GeoJsonPolygon geoJsonPolygon = convertToGeoJsonPolygon(newElectronicFenceArea.getFencePoints());
                        xpGeoFencingPolygon.setPoints(geoJsonPolygon);
                        mongoTemplate.insert(xpGeoFencingPolygon);
                    }
                    if (newElectronicFenceArea.getAreaType() == 2
                            && newElectronicFenceArea.getAreaStatus() == 1) {
                        XpGeoFencingProhibitedPolygon xpGeoFencingProhibitedPolygon = new XpGeoFencingProhibitedPolygon();
                        xpGeoFencingProhibitedPolygon.setFenceId(String.valueOf(xpElectronicFence.getId()));
                        xpGeoFencingProhibitedPolygon.setName(xpElectronicFence.getElectronicName());
                        xpGeoFencingProhibitedPolygon.setAreaId(String.valueOf(newElectronicFenceArea.getId()));
                        // 将围栏点转换为GeoJSON多边形
                        GeoJsonPolygon geoJsonPolygon = convertToGeoJsonPolygon(newElectronicFenceArea.getFencePoints());
                        xpGeoFencingProhibitedPolygon.setPoints(geoJsonPolygon);
                        mongoTemplate.save(xpGeoFencingProhibitedPolygon);
                    }
                }
            }
            return R.ok();
        } catch (Exception e) {
            log.error("新增电子围栏失败", e);
            throw new ServiceException("新增电子围栏失败", I18nKeyConstant.ADD_ELECTRONIC_ERROR);
        }
        // 保存主表数据
        XpElectronicFence xpElectronicFence = new XpElectronicFence();
        BeanUtils.copyProperties(dto, xpElectronicFence);
        xpElectronicFence.setStatus(0);
        if (dto.getStatus() == 0) {
            xpElectronicFence.setStatus(0);
        } else if (dto.getStatus() == 1) {
            if (dto.getEffectType() == 1) {
                // 设置为启用中
                xpElectronicFence.setStatus(2);
                xpElectronicFence.setEffectTime(LocalDateTime.now());
            } else {
                if (dto.getEffectTime().isBefore(LocalDateTime.now())) {
                    // 设置为启用中
                    xpElectronicFence.setStatus(2);
                } else {
                    xpElectronicFence.setStatus(1);
                }
            }
        }
        xpElectronicFence.setCityCode(dto.getCityCode());
        // 生成围栏id 规则:城市首字母-类型简写-4位自增流水号(如 SZ-OP-001),支持复制;数据停用或删除后,流水号不回收
        XpRegion xpRegion = xpRegionMapper.selectOne(new LambdaQueryWrapper<XpRegion>()
                .eq(XpRegion::getCode, dto.getCityCode()));
        String name = xpRegion.getName();
        this.save(xpElectronicFence);
        // 根据城市中文名,截取前两位的首字母并且大写
        // 截取前两个字符
        String prefix = name.substring(0, 2);
        // 获取拼音首字母并大写
        String result = getPinyinInitials(prefix).toUpperCase();
        xpElectronicFence.setElectronicNumber(result + "-OP-" + String.format("%04d", xpElectronicFence.getId()));
        if (dto.getStatus() == 0) {
            xpElectronicFence.setStatus(0);
        } else if (dto.getStatus() == 1) {
            if (dto.getEffectType() == 1) {
                // 设置为启用中
                xpElectronicFence.setStatus(2);
                xpElectronicFence.setEffectTime(LocalDateTime.now());
            } else {
                if (dto.getEffectTime().isBefore(LocalDateTime.now())) {
                    // 设置为启用中
                    xpElectronicFence.setStatus(2);
                } else {
                    // 添加定时任务job type=1电子围栏生效 type=2电子围栏失效
                    Map<String, ? extends Object> maps =
                            new ImmutableMap.Builder<String, Long>().
                                    put("type", 1L)
                                    .put("id", xpElectronicFence.getId())
                                    .build();
                    QuartzManager.addJob(
                            ElectronicEffectJob.class,
                            (ElectronicEffectJob.effect + xpElectronicFence.getId()).toUpperCase(),
                            TimeJobType.ELECTRONIC_EFFECT,
                            DateUtils.localDateTimeToDate(dto.getEffectTime()),
                            maps
                    );
                    xpElectronicFence.setStatus(1);
                }
            }
            if (dto.getFailureType() != null && dto.getFailureType() == 2) {
                if (dto.getFailureTime().isBefore(LocalDateTime.now())) {
                    // 设置待启用
                    xpElectronicFence.setStatus(1);
                } else {
                    // 添加定时任务job type=1电子围栏生效 type=2电子围栏失效
                    Map<String, ? extends Object> maps =
                            new ImmutableMap.Builder<String, Long>().
                                    put("type", 2L)
                                    .put("id", xpElectronicFence.getId())
                                    .build();
                    QuartzManager.addJob(
                            ElectronicEffectJob.class,
                            (ElectronicEffectJob.failure + xpElectronicFence.getId()).toUpperCase(),
                            TimeJobType.ELECTRONIC_FAILURE,
                            DateUtils.localDateTimeToDate(dto.getEffectTime()),
                            maps
                    );
                    xpElectronicFence.setStatus(1);
                }
            }
        }
        this.updateById(xpElectronicFence);
        if (xpElectronicFence.getStatus() == 2) {
            // 设置电子围栏ID并保存区域数据
            for (XpElectronicFenceArea area : newElectronicFenceAreas) {
                area.setElectronicId(xpElectronicFence.getId());
                area.setAreaStatus(1);
                area.setArea(area.getArea());
                area.setCityCode(dto.getCityCode());
                xpElectronicFenceAreaMapper.insert(area);
            }
        }else{
            // 设置电子围栏ID并保存区域数据
            for (XpElectronicFenceArea area : newElectronicFenceAreas) {
                area.setElectronicId(xpElectronicFence.getId());
                area.setAreaStatus(2);
                area.setArea(area.getArea());
                area.setCityCode(dto.getCityCode());
                xpElectronicFenceAreaMapper.insert(area);
            }
        }
        if (xpElectronicFence.getStatus() == 2) {
            for (XpElectronicFenceArea newElectronicFenceArea : newElectronicFenceAreas) {
                if (newElectronicFenceArea.getAreaType() == 1
                        && newElectronicFenceArea.getAreaStatus() == 1) {
                    XpGeoFencingPolygon xpGeoFencingPolygon = new XpGeoFencingPolygon();
                    xpGeoFencingPolygon.setFenceId(String.valueOf(xpElectronicFence.getId()));
                    xpGeoFencingPolygon.setName(xpElectronicFence.getElectronicName());
                    xpGeoFencingPolygon.setAreaId(String.valueOf(newElectronicFenceArea.getId()));
                    xpGeoFencingPolygon.setCityCode(xpElectronicFence.getCityCode());
                    xpGeoFencingPolygon.setOperationStrategy(xpElectronicFence.getOperationStrategy());
                    // 将围栏点转换为GeoJSON多边形
                    GeoJsonPolygon geoJsonPolygon = convertToGeoJsonPolygon(newElectronicFenceArea.getFencePoints());
                    xpGeoFencingPolygon.setPoints(geoJsonPolygon);
                    mongoTemplate.insert(xpGeoFencingPolygon);
                }
                if (newElectronicFenceArea.getAreaType() == 2
                        && newElectronicFenceArea.getAreaStatus() == 1) {
                    XpGeoFencingProhibitedPolygon xpGeoFencingProhibitedPolygon = new XpGeoFencingProhibitedPolygon();
                    xpGeoFencingProhibitedPolygon.setFenceId(String.valueOf(xpElectronicFence.getId()));
                    xpGeoFencingProhibitedPolygon.setName(xpElectronicFence.getElectronicName());
                    xpGeoFencingProhibitedPolygon.setAreaId(String.valueOf(newElectronicFenceArea.getId()));
                    // 将围栏点转换为GeoJSON多边形
                    GeoJsonPolygon geoJsonPolygon = convertToGeoJsonPolygon(newElectronicFenceArea.getFencePoints());
                    xpGeoFencingProhibitedPolygon.setPoints(geoJsonPolygon);
                    mongoTemplate.save(xpGeoFencingProhibitedPolygon);
                }
            }
        }
        return R.ok();
    }
    @Override
    public R editElectronic(ElectronicFenceUpdateDto dto) {
        try {
            // 获取现有的运营区域(areaType=1),排除当前正在编辑的电子围栏
            LambdaQueryWrapper<XpElectronicFenceArea> xpElectronicFenceAreaLambdaQueryWrapper = new LambdaQueryWrapper<>();
            xpElectronicFenceAreaLambdaQueryWrapper.eq(XpElectronicFenceArea::getAreaType, 1);
            xpElectronicFenceAreaLambdaQueryWrapper.eq(XpElectronicFenceArea::getAreaStatus, 1);
            xpElectronicFenceAreaLambdaQueryWrapper.ne(XpElectronicFenceArea::getElectronicId, dto.getId());
            List<XpElectronicFenceArea> existingOperationAreas = xpElectronicFenceAreaMapper.selectList(xpElectronicFenceAreaLambdaQueryWrapper);
@@ -299,10 +292,13 @@
                        if (polygonOverlapService.checkPolygonOverlap(
                                updatedArea.getFencePoints(),
                                existingArea.getFencePoints())) {
                           List<String> res = new ArrayList<>();
                            res.add(updatedArea.getAreaName());
                            res.add(existingArea.getAreaName());
                            throw new ServiceException(
                                    "运营区域{}与现有运营区域{}发生重叠",
                                    I18nKeyConstant.AREA_OVERLAP,
                                    new Object[]{existingArea.getAreaName(), existingArea.getAreaName()}
                                    I18nKeyConstant.AREA_OVERLAP_ERROR,
                                    res.toArray()
                            );
                        }
                    }
@@ -493,10 +489,7 @@
            }
            return R.ok();
        } catch (Exception e) {
            log.error("编辑电子围栏失败", e);
            throw new ServiceException("编辑电子围栏失败", I18nKeyConstant.EDIT_ELECTRONIC_ERROR);
        }
    }
    /**
xp-robotaxi-map-boot/src/main/resources/i18n/messages.properties
@@ -1,3 +1,36 @@
# 中文
no.walking.route.found=no.walking.route.found
welcome.message=欢迎来到我们的应用程序!
city.information.does.not.exist=城市信息不存在
no.current.region=当前区域未开通服务
system.exception=系统异常
to.work=当前上下车点距离过近,建议步行前往
wait.time=当前区域正在等待中,请耐心等待
welcome.message=欢迎来到我们的应用程序!
edit.electronic.error=编辑电子围栏失败;
add.electronic.error=添加电子围栏失败;
area.overlap.error=运营区域{0}与现有运营区域{1}发生重叠;
fence.structure.not.exist=围栏构成不存在
fence.not.exist=围栏不存在
fence.status.cannot.copied=围栏启用状态不可复制;
order.create.fail=订单创建失败
open.city.exists=该城市已存在
pricing.exists=该车型/渠道/城市的定价已存在
pricing.not.exist=定价不存在
pricing.json.invalid=价格配置JSON格式不正确
pricing.rule.empty=价格规则不能为空
no.current.point=?????????
path.not.found=路径不存在
has.unpaid.order=有正在进行的订单
cruise.plan.name.empty=计划名称不能为空
cruise.plan.id.empty=巡游计划ID不能为空
cruise.plan.name.exists=计划名称已存在
cruise.plan.not.exist=巡游计划不存在
cruise.plan.point.empty=关联点位列表不能为空
cruise.plan.vehicle.empty=关联车辆列表不能为空
cruise.plan.point.incomplete=点位参数不完整
cruise.plan.stop.flag.invalid=点位停车标识不合法
cruise.plan.point.duplicate=点位ID重复
cruise.plan.vehicle.incomplete=车辆参数不完整
cruise.plan.vehicle.duplicate=车辆ID重复
cruise.plan.vehicle.already.bound=车辆已关联其他巡游计划
cruise.plan.add.fail=新增巡游计划失败
cruise.plan.edit.fail=编辑巡游计划失败
xp-robotaxi-map-boot/src/main/resources/i18n/messages_en_US.properties
@@ -1,3 +1,29 @@
# English (US)
no.walking.route.found=No walking route found
welcome.message=Welcome to our application!
city.information.does.not.exist=City information does not exist
no.current.region=The service is not currently available in the current region
system.exception=System Error
to.work=The current pick-up and drop-off points are too close to each other. It is recommended to walk there
wait.time=The current area is in a waiting state. Please be patient
welcome.message=Welcome to our application!
edit.electronic.error=Failed to edit the electronic fence
add.electronic.error=Failed to add electronic fence;
area.overlap.error=The operational area {0} overlaps with the existing operational area {1};
fence.structure.not.exist=The fence composition does not exist\
fence.status.cannot.copied=The enabled state of the fence cannot be copied;
fence.not.exist=The fence does not exist.
order.create.fail=Order creation failed
open.city.exists=This city already exists
pricing.exists=Pricing for this vehicle model/channel/city already exists
pricing.not.exist=Pricing does not exist
pricing.json.invalid=Invalid JSON format for pricing configuration
pricing.rule.empty=Price rule cannot be empty
no.current.point=The current location is not open for service
path.not.found=Path does not exist
has.unpaid.order=There are ongoing orders
cruise.plan.name.exists=The name of the plan already exists
cruise.plan.point.incomplete=The point parameters are incomplete
cruise.plan.stop.flag.invalid=The parking sign at the location is invalid.
cruise.plan.point.duplicate=The point ID is duplicated
cruise.plan.vehicle.duplicate=Duplicate vehicle ID
cruise.plan.vehicle.already.bound=Vehicle [{0}] has been associated with other cruising plans
cruise.plan.add.fail=The new cruise plan failed
xp-robotaxi-map-boot/src/main/resources/i18n/messages_zh_CN.properties
@@ -1,3 +1,29 @@
# 中文
no.walking.route.found=未找到步行路线
welcome.message=欢迎来到我们的应用程序!
city.information.does.not.exist=城市信息不存在
no.current.region=当前区域未开通服务
system.exception=系统异常
to.work=当前上下车点距离过近,建议步行前往
wait.time=当前区域正在等待中,请耐心等待
welcome.message=欢迎来到我们的应用程序!
edit.electronic.error=编辑电子围栏失败;
add.electronic.error=添加电子围栏失败;
area.overlap.error=运营区域{0}与现有运营区域{1}发生重叠;
fence.structure.not.exist=围栏构成不存在
fence.not.exist=围栏不存在
fence.status.cannot.copied=围栏启用状态不可复制
order.create.fail=订单创建失败
open.city.exists=该城市已存在
pricing.exists=该车型/渠道/城市的定价已存在
pricing.not.exist=定价不存在
pricing.json.invalid=价格配置JSON格式不正确
pricing.rule.empty=价格规则不能为空
no.current.point=?????????
path.not.found=路径不存在
has.unpaid.order=有正在进行的订单
cruise.plan.name.exists=计划名称已存在
cruise.plan.point.incomplete=点位参数不完整
cruise.plan.stop.flag.invalid=点位停车标识不合法
cruise.plan.point.duplicate=点位ID重复
cruise.plan.vehicle.duplicate=车辆ID重复
cruise.plan.vehicle.already.bound=车辆[{0}]已关联其他巡游计划
cruise.plan.add.fail=新增巡游计划失败
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpCruisePlanController.java
@@ -102,6 +102,9 @@
    public R<XpCruiseOrder> getCruisePoint(@RequestBody CruisePointDto dto) {
        // 先找计划
        XpCruisePlanVehicle plan = xpCruisePlanVehicleService.getOne(new LambdaQueryWrapper<XpCruisePlanVehicle>().eq(XpCruisePlanVehicle::getVehicleId, dto.getVehicleId()));
        if (plan == null) {
            return R.fail("没有找到对应的计划");
        }
        // 找对应的多个点位
        List<XpCruisePlanPoint> planPointList = xpCruisePlanPointService.list(new LambdaQueryWrapper<XpCruisePlanPoint>().eq(XpCruisePlanPoint::getCruisePlanId, plan.getCruisePlanId()).orderByAsc(XpCruisePlanPoint::getSortOrder));
        // 找到现在这个点位
@@ -149,6 +152,16 @@
        return R.ok(newXpCruiseOrder);
    }
    /**
     * 获取巡游计划
     * @param vehicleId
     * @return
     */
    @PostMapping("/inner/cruise/getCruisePlan")
    public R<XpCruisePlanVehicle> getCruisePlan(@RequestParam Long vehicleId) {
        XpCruisePlanVehicle plan = xpCruisePlanVehicleService.getOne(new LambdaQueryWrapper<XpCruisePlanVehicle>().eq(XpCruisePlanVehicle::getVehicleId, vehicleId));
        return R.ok(plan);
    }
    /**
     * 获取巡游订单数据
@@ -167,7 +180,7 @@
        Long pointId = xpCruisePlanPoint.getPointId();
        XpPoint point = pointService.getById(pointId);
        XpCruiseOrder newXpCruiseOrder = new XpCruiseOrder();
        newXpCruiseOrder.setId("XU"+ IdUtil.fastUUID());
        newXpCruiseOrder.setId("XU" + IdUtil.fastUUID());
        newXpCruiseOrder.setFleetId(dto.getFleetId());
        newXpCruiseOrder.setVehicleId(dto.getVehicleId());
        newXpCruiseOrder.setVehicleVin(dto.getVehicleVin());
@@ -203,7 +216,7 @@
     * @return
     */
    @PostMapping("/inner/cruise/findReturnCruisePoint")
    public R<XpCruiseOrder> findReturnCruisePoint(@RequestBody XpCruiseOrder xpCruiseOrder){
    public R<XpCruiseOrder> findReturnCruisePoint(@RequestBody XpCruiseOrder xpCruiseOrder) {
        // 先找计划
        XpCruisePlanVehicle plan = xpCruisePlanVehicleService.getOne(new LambdaQueryWrapper<XpCruisePlanVehicle>().eq(XpCruisePlanVehicle::getVehicleId, xpCruiseOrder.getVehicleId()));
        // 找对应的多个点位
xp-robotaxi-operation-boot/src/main/resources/i18n/messages.properties
@@ -7,7 +7,7 @@
welcome.message=欢迎来到我们的应用程序!
edit.electronic.error=编辑电子围栏失败;
add.electronic.error=添加电子围栏失败;
area.overlap=区域重叠;
area.overlap=运营区域{0}与现有运营区域{1}发生重叠;
fence.structure.not.exist=围栏构成不存在
fence.not.exist=围栏不存在
fence.status.cannot.copied=围栏启用状态不可复制;
xp-robotaxi-operation-boot/src/main/resources/i18n/messages_en_US.properties
@@ -7,7 +7,7 @@
welcome.message=Welcome to our application!
edit.electronic.error=Failed to edit the electronic fence
add.electronic.error=Failed to add electronic fence;
area.overlap=area overlap;
area.overlap=The operational area {0} overlaps with the existing operational area {1};
fence.structure.not.exist=The fence composition does not exist\
fence.status.cannot.copied=The enabled state of the fence cannot be copied;
fence.not.exist=The fence does not exist.
xp-robotaxi-operation-boot/src/main/resources/i18n/messages_zh_CN.properties
@@ -7,7 +7,7 @@
welcome.message=欢迎来到我们的应用程序!
edit.electronic.error=编辑电子围栏失败;
add.electronic.error=添加电子围栏失败;
area.overlap=区域重叠;
area.overlap=运营区域{0}与现有运营区域{1}发生重叠;
fence.structure.not.exist=围栏构成不存在
fence.not.exist=围栏不存在
fence.status.cannot.copied=围栏启用状态不可复制
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/config/MyLocaleResolver.java
@@ -23,8 +23,6 @@
        Locale locale = null;
        if (StringUtils.isEmpty(language)) {
            locale = Locale.getDefault();
        }
        if (!StringUtils.hasLength(language)){
            language = "1";
        }
        //如果请求不为空 
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpCruiseOrderController.java
@@ -2,6 +2,7 @@
import cn.hutool.core.util.IdUtil;
import com.xiaopeng.api.dto.automaticPilot.PushOrderDto;
import com.xiaopeng.api.dto.order.AddCruiseMissionDto;
import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient;
import com.xiaopeng.api.model.order.XpCruiseOrder;
import com.xiaopeng.common.core.domain.R;
@@ -9,6 +10,7 @@
import com.xiaopeng.order.service.IXpCruiseOrderService;
import com.xiaopeng.order.model.query.XpCruiseOrderPageQuery;
import com.xiaopeng.order.model.vo.XpCruiseOrderPageVO;
import com.xiaopeng.order.service.IXpOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -34,6 +36,7 @@
    private final IXpCruiseOrderService xpCruiseOrderService;
    private final OrderMissionClient orderMissionClient;
    private final IXpOrderService xpOrderService;
    /**
@@ -105,4 +108,15 @@
        return R.ok(pageInfo);
    }
    /**
     * 添加巡游任务 下发命令
     * @param
     * @param
     */
    @PostMapping("/inner/cruiseOrder/addCruiseMission")
    public R<?> addCruiseMission(@RequestBody AddCruiseMissionDto dto){
        xpOrderService.addCruiseMission(dto.getVehicle(),dto.getOrder());
        return R.ok();
    }
}
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpOrderController.java
@@ -6,6 +6,7 @@
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xiaopeng.api.dto.QueryOrderRouteDTO;
import com.xiaopeng.api.dto.order.AddCruiseMissionDto;
import com.xiaopeng.api.dto.order.GetOrderNumDto;
import com.xiaopeng.api.dto.order.PopOrderDto;
import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO;
@@ -399,6 +400,9 @@
        return R.ok();
    }
    /**+
     * 获取行程费用明细
     */
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/job/jobs/EndTripJob.java
@@ -2,6 +2,8 @@
import com.xiaopeng.api.model.order.XpOrder;
import com.xiaopeng.api.model.order.XpOrderTimeoutLog;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.order.job.base.AbstractJob;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobDataMap;
@@ -33,6 +35,9 @@
            xpOrderTimeoutLog.setOrderId(xpOrder.getId());
            xpOrderTimeoutLog.setUserId(xpOrder.getAppUserId());
            xpOrderTimeoutLogService.save(xpOrderTimeoutLog);
            R<XpVehicle> xpVehicleR = xpVehicleClient.queryById(xpOrder.getVehicleId());
            xpOrderService.addCruiseMission(xpVehicleR.getData(),xpOrder);
        }catch(Exception e){
            e.printStackTrace();
        }
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/IXpOrderService.java
@@ -159,6 +159,14 @@
    void endTrip(Long orderId, String uid);
    /**
     * 添加巡游任务 下发命令
     * @param vehicle
     * @param order
     */
    void addCruiseMission(XpVehicle vehicle, XpOrder order);
    R<FareBreakdownVo> fareBreakdown(Long orderId, String uid);
    R payment(XpOrderPayDto dto, String uid);
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -41,10 +41,7 @@
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.model.account.XpAppUser;
import com.xiaopeng.api.model.maintenance.XpTaskRule;
import com.xiaopeng.api.model.operation.XpFeedbackType;
import com.xiaopeng.api.model.operation.XpGeoQueryEntity;
import com.xiaopeng.api.model.operation.XpPoint;
import com.xiaopeng.api.model.operation.XpPricing;
import com.xiaopeng.api.model.operation.*;
import com.xiaopeng.api.model.order.*;
import com.xiaopeng.api.model.vehicleConvoy.XpFleet;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
@@ -1469,92 +1466,173 @@
            // 修改车辆状态
            vehicle.setState(0);
            // 获取配置 根据配置判断是否该收车 如果是则找到收车点位进行收车操作
            R<XpTaskRule> xpTaskRuleR = xpTaskRuleClient.queryDetail();
            XpTaskRule xpTaskRule = xpTaskRuleR.getData();
            // 生成新的巡游单子 回到最新巡游的初始起点位置
            XpCruiseOrder xpCruiseOrders = xpCruiseOrderMapper.selectOne(new LambdaQueryWrapper<XpCruiseOrder>().eq(XpCruiseOrder::getVehicleId, vehicle.getId()).eq(XpCruiseOrder::getStatus, 2).orderByDesc(BaseModel::getCreateTime).last("limit 1"));
            int temp=0;
            if(xpCruiseOrders==null){
                temp=1;
                //特殊情况 可能没有产生终止的订单  (到站点就被正常接单了)所以找正常订单
                xpCruiseOrders=xpCruiseOrderMapper.selectOne(new LambdaQueryWrapper<XpCruiseOrder>().eq(XpCruiseOrder::getVehicleId, vehicle.getId()).eq(XpCruiseOrder::getStatus, 3).orderByDesc(BaseModel::getCreateTime).last("limit 1"));
            }
            XpCruiseOrder xpCruiseOrder = new XpCruiseOrder();
            xpCruiseOrder.setVehicleId(vehicle.getId());
            xpCruiseOrder.setFleetId(vehicle.getFleetId());
            xpCruiseOrder.setVehicleVin(vehicle.getVehicleVin());
            xpCruiseOrder.setOrderType(2);
            // 返程起点是当前正常订单的终点
            xpCruiseOrder.setStartPointId(order.getEndPointId());
            xpCruiseOrder.setStartPointName(order.getEndPointName());
            xpCruiseOrder.setStartLon(order.getEndLon());
            xpCruiseOrder.setStartLat(order.getEndLat());
            // 完成的直接走终点   终止的走起点
            if(temp==0){
                xpCruiseOrder.setEndPointId(xpCruiseOrders.getStartPointId());
                xpCruiseOrder.setEndPointName(xpCruiseOrders.getStartPointName());
                xpCruiseOrder.setEndLon(xpCruiseOrders.getStartLon());
                xpCruiseOrder.setEndLat(xpCruiseOrders.getStartLat());
            }else {
                xpCruiseOrder.setEndPointId(xpCruiseOrders.getEndPointId());
                xpCruiseOrder.setEndPointName(xpCruiseOrders.getEndPointName());
                xpCruiseOrder.setEndLon(xpCruiseOrders.getEndLon());
                xpCruiseOrder.setEndLat(xpCruiseOrders.getEndLat());
            }
            xpCruiseOrder.setStatus(1);
            xpCruiseOrder.setLastOrderId(xpCruiseOrders.getId());
            xpCruiseOrder.setCreateTime(LocalDateTime.now());
            xpCruiseOrder.setId("XU"+ IdUtil.fastUUID());
            // 判断当前时分秒是否大于收车时间
            LocalTime vehicleCollectionTime = xpTaskRule.getVehicleCollectionTime();
            if (vehicleCollectionTime.isBefore(LocalTime.now())) {
                vehicle.setOperatingStatus(3);
                //找到车辆的收车点位 更新终点点位
                R<XpCruiseOrder> returnCruisePoint = xpCruisePlanClient.findReturnCruisePoint(xpCruiseOrder);
                xpCruiseOrder = returnCruisePoint.getData();
            }
            xpVehicleClient.updateVehicleById(vehicle);
            xpCruiseOrderMapper.insert(xpCruiseOrder);
            R<XpPoint> xpPointR = xpPointClient.queryById(order.getEndPointId());
            XpPoint data = xpPointR.getData();
            //下发命令
            // 添加自动结束行程定时任务job
            Map<String, ? extends Object> jobMaps =
                    new ImmutableMap.Builder<String, String>().
                            put("id", xpCruiseOrder.getId())
                            .build();
            QuartzManager.addJob(
                    AddCruiseMissionJob.class,
                    (AddCruiseMissionJob.name + xpCruiseOrder.getId()).toUpperCase(),
                    TimeJobType.ADD_CRUISE_MISSION,
                    DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(data.getParkingTimeLimit())),
                    jobMaps
            );
            addCruiseMission(vehicle,order);
//            // 获取配置 根据配置判断是否该收车 如果是则找到收车点位进行收车操作
//            R<XpTaskRule> xpTaskRuleR = xpTaskRuleClient.queryDetail();
//            XpTaskRule xpTaskRule = xpTaskRuleR.getData();
//
//            // 生成新的巡游单子 回到最新巡游的初始起点位置
//            XpCruiseOrder xpCruiseOrders = xpCruiseOrderMapper.selectOne(new LambdaQueryWrapper<XpCruiseOrder>().eq(XpCruiseOrder::getVehicleId, vehicle.getId()).eq(XpCruiseOrder::getStatus, 2).orderByDesc(BaseModel::getCreateTime).last("limit 1"));
//            int temp=0;
//            if(xpCruiseOrders==null){
//                temp=1;
//                //特殊情况 可能没有产生终止的订单  (到站点就被正常接单了)所以找正常订单
//                xpCruiseOrders=xpCruiseOrderMapper.selectOne(new LambdaQueryWrapper<XpCruiseOrder>().eq(XpCruiseOrder::getVehicleId, vehicle.getId()).eq(XpCruiseOrder::getStatus, 3).orderByDesc(BaseModel::getCreateTime).last("limit 1"));
//            }
//            XpCruiseOrder xpCruiseOrder = new XpCruiseOrder();
//            xpCruiseOrder.setVehicleId(vehicle.getId());
//            xpCruiseOrder.setFleetId(vehicle.getFleetId());
//            xpCruiseOrder.setVehicleVin(vehicle.getVehicleVin());
//            xpCruiseOrder.setOrderType(2);
//            // 返程起点是当前正常订单的终点
//            xpCruiseOrder.setStartPointId(order.getEndPointId());
//            xpCruiseOrder.setStartPointName(order.getEndPointName());
//            xpCruiseOrder.setStartLon(order.getEndLon());
//            xpCruiseOrder.setStartLat(order.getEndLat());
//
//            // 完成的直接走终点   终止的走起点
//            if(temp==0){
//                xpCruiseOrder.setEndPointId(xpCruiseOrders.getStartPointId());
//                xpCruiseOrder.setEndPointName(xpCruiseOrders.getStartPointName());
//                xpCruiseOrder.setEndLon(xpCruiseOrders.getStartLon());
//                xpCruiseOrder.setEndLat(xpCruiseOrders.getStartLat());
//            }else {
//                xpCruiseOrder.setEndPointId(xpCruiseOrders.getEndPointId());
//                xpCruiseOrder.setEndPointName(xpCruiseOrders.getEndPointName());
//                xpCruiseOrder.setEndLon(xpCruiseOrders.getEndLon());
//                xpCruiseOrder.setEndLat(xpCruiseOrders.getEndLat());
//            }
//
//
//            xpCruiseOrder.setStatus(0);
//            xpCruiseOrder.setLastOrderId(xpCruiseOrders.getId());
//            xpCruiseOrder.setCreateTime(LocalDateTime.now());
//            xpCruiseOrder.setId("XU"+ IdUtil.fastUUID());
//
//            // 判断当前时分秒是否大于收车时间
//            LocalTime vehicleCollectionTime = xpTaskRule.getVehicleCollectionTime();
//            if (vehicleCollectionTime.isBefore(LocalTime.now())) {
//                vehicle.setOperatingStatus(3);
//                //找到车辆的收车点位 更新终点点位
//                R<XpCruiseOrder> returnCruisePoint = xpCruisePlanClient.findReturnCruisePoint(xpCruiseOrder);
//                xpCruiseOrder = returnCruisePoint.getData();
//            }
//            xpVehicleClient.updateVehicleById(vehicle);
//
//            xpCruiseOrderMapper.insert(xpCruiseOrder);
//
//
//            R<XpPoint> xpPointR = xpPointClient.queryById(order.getEndPointId());
//            XpPoint data = xpPointR.getData();
//            //下发命令
//            // 添加自动结束行程定时任务job
//            Map<String, ? extends Object> jobMaps =
//                    new ImmutableMap.Builder<String, String>().
//                            put("id", xpCruiseOrder.getId())
//                            .build();
//            QuartzManager.addJob(
//                    AddCruiseMissionJob.class,
//                    (AddCruiseMissionJob.name + xpCruiseOrder.getId()).toUpperCase(),
//                    TimeJobType.ADD_CRUISE_MISSION,
//                    DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(data.getParkingTimeLimit())),
//                    jobMaps
//            );
        }
    }
    /**
     * 添加巡游任务下发命令
     * @param vehicle
     * @param order
     */
    public void addCruiseMission(XpVehicle vehicle, XpOrder order) {
        if(vehicle.getState()!=0 || vehicle.getOperatingStatus()!=1){
            return;
        }
        // 判断是否有计划
        R<XpCruisePlanVehicle> xpCruisePlanR = xpCruisePlanClient.getCruisePlan(vehicle.getId());
        if(xpCruisePlanR==null || xpCruisePlanR.getData()==null){
            return;
        }
        // 获取配置 根据配置判断是否该收车 如果是则找到收车点位进行收车操作
        R<XpTaskRule> xpTaskRuleR = xpTaskRuleClient.queryDetail();
        XpTaskRule xpTaskRule = xpTaskRuleR.getData();
        // 生成新的巡游单子 回到最新巡游的初始起点位置
        XpCruiseOrder xpCruiseOrders = xpCruiseOrderMapper.selectOne(new LambdaQueryWrapper<XpCruiseOrder>().eq(XpCruiseOrder::getVehicleId, vehicle.getId()).eq(XpCruiseOrder::getStatus, 2).orderByDesc(BaseModel::getCreateTime).last("limit 1"));
        int temp=0;
        if(xpCruiseOrders==null){
            temp=1;
            //特殊情况 可能没有产生终止的订单  (到站点就被正常接单了)所以找正常订单
            xpCruiseOrders=xpCruiseOrderMapper.selectOne(new LambdaQueryWrapper<XpCruiseOrder>().eq(XpCruiseOrder::getVehicleId, vehicle.getId()).eq(XpCruiseOrder::getStatus, 3).orderByDesc(BaseModel::getCreateTime).last("limit 1"));
        }
        XpCruiseOrder xpCruiseOrder = new XpCruiseOrder();
        xpCruiseOrder.setVehicleId(vehicle.getId());
        xpCruiseOrder.setFleetId(vehicle.getFleetId());
        xpCruiseOrder.setVehicleVin(vehicle.getVehicleVin());
        xpCruiseOrder.setOrderType(2);
        // 返程起点是当前正常订单的终点
        xpCruiseOrder.setStartPointId(order.getEndPointId());
        xpCruiseOrder.setStartPointName(order.getEndPointName());
        xpCruiseOrder.setStartLon(order.getEndLon());
        xpCruiseOrder.setStartLat(order.getEndLat());
        // 完成的直接走终点   终止的走起点
        if(temp==0){
            xpCruiseOrder.setEndPointId(xpCruiseOrders.getStartPointId());
            xpCruiseOrder.setEndPointName(xpCruiseOrders.getStartPointName());
            xpCruiseOrder.setEndLon(xpCruiseOrders.getStartLon());
            xpCruiseOrder.setEndLat(xpCruiseOrders.getStartLat());
        }else {
            xpCruiseOrder.setEndPointId(xpCruiseOrders.getEndPointId());
            xpCruiseOrder.setEndPointName(xpCruiseOrders.getEndPointName());
            xpCruiseOrder.setEndLon(xpCruiseOrders.getEndLon());
            xpCruiseOrder.setEndLat(xpCruiseOrders.getEndLat());
        }
        xpCruiseOrder.setStatus(0);
        xpCruiseOrder.setLastOrderId(xpCruiseOrders.getId());
        xpCruiseOrder.setCreateTime(LocalDateTime.now());
        xpCruiseOrder.setId("XU"+ IdUtil.fastUUID());
        // 判断当前时分秒是否大于收车时间
        LocalTime vehicleCollectionTime = xpTaskRule.getVehicleCollectionTime();
        if (vehicleCollectionTime.isBefore(LocalTime.now())) {
            vehicle.setOperatingStatus(3);
            //找到车辆的收车点位 更新终点点位
            R<XpCruiseOrder> returnCruisePoint = xpCruisePlanClient.findReturnCruisePoint(xpCruiseOrder);
            xpCruiseOrder = returnCruisePoint.getData();
        }
        xpVehicleClient.updateVehicleById(vehicle);
        xpCruiseOrderMapper.insert(xpCruiseOrder);
        R<XpPoint> xpPointR = xpPointClient.queryById(order.getEndPointId());
        XpPoint data = xpPointR.getData();
        //下发命令
        // 添加自动结束行程定时任务job
        Map<String, ? extends Object> jobMaps =
                new ImmutableMap.Builder<String, String>().
                        put("id", xpCruiseOrder.getId())
                        .build();
        QuartzManager.addJob(
                AddCruiseMissionJob.class,
                (AddCruiseMissionJob.name + xpCruiseOrder.getId()).toUpperCase(),
                TimeJobType.ADD_CRUISE_MISSION,
                DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(data.getParkingTimeLimit())),
                jobMaps
        );
    }
    private MileageDto mileageType(MileageDto param, JSONArray startingFareJsonArray, Date mileageDate, LocalDateTime begin, String num14, String num16, String num17, String num21, String num22, String num24, String num25, String num30, String num31) {
        // 计算出是在哪个普通时间段内
@@ -1978,8 +2056,11 @@
        Long orderId = dto.getOrderId();
        //巡游单处理逻辑
        if(OrderType.CRUISE_ORDER.equals(orderType)){
            // todo 需要处理巡游的逻辑
            XpCruiseOrder xpCruiseOrder = xpCruiseOrderMapper.selectById(orderId);
            if(xpCruiseOrder!=null){
                xpCruiseOrder.setStatus(1);
                xpCruiseOrderMapper.updateById(xpCruiseOrder);
            }
        }
@@ -2114,6 +2195,11 @@
        }
        if(xpOrder.getVehicleId()!=null){
            R<XpVehicle> xpVehicleR = xpVehicleClient.queryById(xpOrder.getVehicleId());
            xpOrderDetailVO.setPlateNumber(xpVehicleR.getData().getPlateNumber());
        }
        return xpOrderDetailVO;
    }
}
xp-robotaxi-payment-boot/src/main/java/com/xiaopeng/payment/config/MyLocaleResolver.java
@@ -23,6 +23,7 @@
        Locale locale = null;
        if (StringUtils.isEmpty(language)) {
            locale = Locale.getDefault();
            language = "1";
        }
        //如果请求不为空 
        //If the request is not empty.
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/config/MyLocaleResolver.java
@@ -1,80 +1,81 @@
//package com.xiaopeng.pushMessage.config;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import org.springframework.util.StringUtils;
//import org.springframework.web.servlet.LocaleResolver;
//
//import javax.servlet.ServletInputStream;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.BufferedReader;
//import java.io.InputStreamReader;
//import java.util.Locale;
//
//public class MyLocaleResolver implements LocaleResolver {
//
//    @Override
//    public Locale resolveLocale(HttpServletRequest request) {
//        //1=中文,2=英文,3=印尼文
//        //1=Chinese, 2=English, 3=Indonesian.
//        String language = getQueryParams(request, "language");
//
//        Locale locale = null;
//        if (StringUtils.isEmpty(language)) {
//            locale = Locale.getDefault();
//        }
//        //如果请求不为空
//        //If the request is not empty.
//        if (language.equals("1")) {
//            locale = new Locale("zh", "CN");
//        } else if (language.equals("2")) {
//            locale = new Locale("en", "US");
//        }
//        return locale;
//    }
//
//    @Override
//    public void setLocale(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Locale locale) {
//    }
//
//
//    public String getQueryParams(HttpServletRequest request, String key) {
//        try {
//            String method = request.getMethod();
//            if("POST".equals(method)){
//                String parameter = request.getParameter(key);
//                if(!StringUtils.isEmpty(parameter)){
//                    return parameter;
//                }
//                Object attribute = request.getAttribute(key);
//                if(null != attribute){
//                    return attribute.toString();
//                }
//                StringBuffer sb = new StringBuffer();
//                ServletInputStream inputStream = request.getInputStream();
//                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
//                String s;
//                while ((s = bufferedReader.readLine()) != null){
//                    sb.append(s);
//                }
//                bufferedReader.close();
//                inputStream.close();
//                JSONObject jsonObject = JSON.parseObject(sb.toString());
//                return jsonObject.getString(key);
//            }else{
//                String parameter = request.getParameter(key);
//                if(!StringUtils.isEmpty(parameter)){
//                    return parameter;
//                }
//                Object attribute = request.getAttribute(key);
//                if(null != attribute){
//                    return attribute.toString();
//                }
//            }
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//        return null;
//    }
//}
package com.xiaopeng.pushMessage.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.LocaleResolver;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Locale;
public class MyLocaleResolver implements LocaleResolver {
    @Override
    public Locale resolveLocale(HttpServletRequest request) {
        //1=中文,2=英文,3=印尼文
        //1=Chinese, 2=English, 3=Indonesian.
        String language = getQueryParams(request, "language");
        Locale locale = null;
        if (StringUtils.isEmpty(language)) {
            locale = Locale.getDefault();
            language = "1";
        }
        //如果请求不为空
        //If the request is not empty.
        if (language.equals("1")) {
            locale = new Locale("zh", "CN");
        } else if (language.equals("2")) {
            locale = new Locale("en", "US");
        }
        return locale;
    }
    @Override
    public void setLocale(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Locale locale) {
    }
    public String getQueryParams(HttpServletRequest request, String key) {
        try {
            String method = request.getMethod();
            if("POST".equals(method)){
                String parameter = request.getParameter(key);
                if(!StringUtils.isEmpty(parameter)){
                    return parameter;
                }
                Object attribute = request.getAttribute(key);
                if(null != attribute){
                    return attribute.toString();
                }
                StringBuffer sb = new StringBuffer();
                ServletInputStream inputStream = request.getInputStream();
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
                String s;
                while ((s = bufferedReader.readLine()) != null){
                    sb.append(s);
                }
                bufferedReader.close();
                inputStream.close();
                JSONObject jsonObject = JSON.parseObject(sb.toString());
                return jsonObject.getString(key);
            }else{
                String parameter = request.getParameter(key);
                if(!StringUtils.isEmpty(parameter)){
                    return parameter;
                }
                Object attribute = request.getAttribute(key);
                if(null != attribute){
                    return attribute.toString();
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
xp-robotaxi-remote-driving-boot/src/main/java/com/xiaopeng/remoteDriving/config/MyLocaleResolver.java
@@ -23,6 +23,7 @@
        Locale locale = null;
        if (StringUtils.isEmpty(language)) {
            locale = Locale.getDefault();
            language = "1";
        }
        //如果请求不为空 
        //If the request is not empty.
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/config/MyLocaleResolver.java
@@ -23,6 +23,7 @@
        Locale locale = null;
        if (StringUtils.isEmpty(language)) {
            locale = Locale.getDefault();
            language = "1";
        }
        //如果请求不为空
        //If the request is not empty.