puzhibing
2026-05-17 993a6e6ea8ae047b9e5fffd249ae7adfcd650d3a
合并代码
1个文件已删除
30个文件已修改
825 ■■■■■ 已修改文件
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/config/MiniprogramConfigurer.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/config/SecurityConfig.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCollectAddrServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCouponServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/config/MiniprogramConfigurer.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/service/impl/XpPricingServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpPointServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpStationServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-map-boot/src/main/resources/mapper/XpStationMapper.xml 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/config/MiniprogramConfigurer.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/OssController.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/ReassignOrderController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpInvitationCodeController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpWhitelistController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/mapper/XpTargetedServiceMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpTargetedServiceService.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpInvitationCodeServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPointServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpRoutePlanServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpSystemSettingServiceImpl.java 1 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTargetedServiceServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/TaskOrderUtil.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-operation-boot/src/main/resources/mapper/operation/XpTargetedServiceMapper.xml 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/config/MiniprogramConfigurer.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/ActiveOrderController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpOrderController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/job/jobs/OrderCancelJob.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java 320 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/config/MiniprogramConfigurer.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-vehicle-convoy-boot/src/main/resources/mapper/vehicleConvoy/XpVehicleMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/config/MiniprogramConfigurer.java
@@ -10,7 +10,7 @@
import javax.annotation.Resource;
@Slf4j
//@Configuration
@Configuration
public class MiniprogramConfigurer extends WebMvcConfigurerAdapter {
    @Resource
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/config/SecurityConfig.java
File was deleted
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCollectAddrServiceImpl.java
@@ -181,10 +181,16 @@
    }
    private void fillPointInfo(XpAppUserCollectAddrVO collectAddrVO, XpPoint point, XpUserCollectAddrListQuery query) {
        Integer parkingTimeLimit = point.getParkingTimeLimit();
        //如果点位位于场站内,则使用场站的限停时间
        if(null != point.getStationId()){
            XpStation xpStation = xpStationClient.getXpStationById(point.getStationId()).getData();
            parkingTimeLimit = xpStation.getParkingTimeLimit();
        }
        collectAddrVO.setPointName(point.getPointName());
        collectAddrVO.setPointAddress(point.getPointAddress());
        collectAddrVO.setElectronicAreaId(point.getElectronicAreaId());
        collectAddrVO.setTime(point.getParkingTimeLimit());
        collectAddrVO.setTime(parkingTimeLimit);
        fillEffectiveTime(collectAddrVO, point.getEffectiveTimePeriod());
        fillDistance(collectAddrVO, point, query);
    }
xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCouponServiceImpl.java
@@ -1,5 +1,6 @@
package com.xiaopeng.account.service.impl;
import cn.hutool.core.util.DesensitizedUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -19,8 +20,7 @@
import com.xiaopeng.account.vo.CouponReceiptRecordDto;
import com.xiaopeng.account.vo.CouponReceiptRecordVo;
import com.xiaopeng.api.model.operation.XpWhitelist;
import com.xiaopeng.api.vo.account.CalculateDiscountAmountVo;
import com.xiaopeng.api.vo.account.CouponVo;
import com.xiaopeng.api.vo.account.*;
import com.xiaopeng.account.vo.UserCouponListVo;
import com.xiaopeng.api.dto.account.NavigationCouponPickerRequest;
import com.xiaopeng.api.dto.account.UcUserInfo;
@@ -30,8 +30,6 @@
import com.xiaopeng.api.feignClient.pushMessage.SubscribeMessageClient;
import com.xiaopeng.api.model.operation.XpActicityStrategy;
import com.xiaopeng.api.query.account.XpAppUserCouponPageListQuery;
import com.xiaopeng.api.vo.account.NavigationCouponItemVo;
import com.xiaopeng.api.vo.account.NavigationCouponPickerVo;
import com.xiaopeng.api.feignClient.account.UserResourcesClient;
import com.xiaopeng.api.feignClient.operation.XpCouponClient;
import com.xiaopeng.api.feignClient.operation.XpWhiteListClient;
@@ -41,8 +39,10 @@
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.enums.MessageTemplateEnum;
import com.xiaopeng.common.core.utils.DateUtils;
import com.xiaopeng.common.core.utils.SensitiveDataCryptoUtil;
import com.xiaopeng.common.core.utils.StringUtils;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.common.security.service.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@@ -82,6 +82,9 @@
    @Resource
    private XpActicityClient xpActicityClient;
    @Resource
    private TokenService tokenService;
    @Override
@@ -602,6 +605,7 @@
     * @return
     */
    public List<CouponReceiptRecordDto> getCouponReceiptRecord(PageInfo<CouponReceiptRecordDto> pageInfo, CouponReceiptRecordVo vo) {
        LoginUser loginUser = tokenService.getLoginUser();
        List<Long> appUserIds = new ArrayList<Long>();
        if(StringUtils.isNotEmpty(vo.getName())){
            List<XpWhitelist> data = xpWhiteListClient.getXpWhitelistByName(vo.getName()).getData();
@@ -625,7 +629,10 @@
            XpWhitelist data = xpWhiteListClient.getXpWhitelistByUid(xpAppUserCoupon.getAppUserId()).getData();
            if(null != data){
                dto.setName(data.getNickName());
                dto.setPhone(data.getAccount());
                dto.setPhone(SensitiveDataCryptoUtil.decryptIfPossible(data.getAccount()));
                if(!loginUser.getPhoneDesensitizationExempt()){
                    dto.setPhone(DesensitizedUtil.mobilePhone(dto.getPhone()));
                }
            }
            dto.setNum(1);
            dto.setExpireTime(xpAppUserCoupon.getExpirationTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/config/MiniprogramConfigurer.java
@@ -10,7 +10,7 @@
import javax.annotation.Resource;
@Slf4j
//@Configuration
@Configuration
public class MiniprogramConfigurer extends WebMvcConfigurerAdapter {
    @Resource
xp-robotaxi-itinerary-boot/src/main/java/com/xiaopeng/itinerary/service/impl/XpPricingServiceImpl.java
@@ -566,19 +566,19 @@
    @Override
    public String saveOrder(XpOrderDto dto, String uid) {
        //校验白名单用户
//        UcUserInfo userInfo = userResourcesClient.getBaseUserByUid(uid);
//        XpWhitelist xpWhitelist = xpWhitelistMapper.selectOne(new QueryWrapper<XpWhitelist>().eq("account", userInfo.getMobile())
//                .eq("status", 1).last(" and (DATE(expire_time) < DATE(NOW()) or expire_time is null)"));
//        if(null == xpWhitelist){
//            throw new ServiceException("未授权用户,不能使用该功能", I18nKeyConstant.NO_PERMISSION);
//        }
        List<XpWhitelist> xpWhitelists = xpWhitelistMapper.selectList(new QueryWrapper<XpWhitelist>().eq("app_user_id", uid)
                .eq("status", 1).eq("is_deleted", 0).last(" and (expire_time >= DATE(NOW()) or expire_time is null)"));
        if(xpWhitelists.isEmpty()){
            throw new ServiceException("未授权用户,不能使用该功能", I18nKeyConstant.NO_PERMISSION);
        }
        XpWhitelist xpWhitelist = xpWhitelists.get(0);
        //判断最大下单数
//        if(null != xpWhitelist.getMaxOrderNum() && xpWhitelist.getMaxOrderNum()>0){
//            Long count = xpOrderClient.getUserOrderNum(Long.valueOf(uid)).getData();
//            if(xpWhitelist.getMaxOrderNum() <= count){
//                throw new ServiceException("已达到最大下单数量,不能使用该功能", I18nKeyConstant.MAX_ORDER_NUM);
//            }
//        }
        if(null != xpWhitelist.getMaxOrderNum() && xpWhitelist.getMaxOrderNum()>0){
            Long count = xpOrderClient.getUserOrderNum(Long.valueOf(uid)).getData();
            if(xpWhitelist.getMaxOrderNum() <= count){
                throw new ServiceException("已达到最大下单数量,不能使用该功能", I18nKeyConstant.MAX_ORDER_NUM);
            }
        }
        // 是否在运营区域时间内
        XpElectronicFenceArea xpElectronicFenceArea = xpElectronicFenceAreaMapper.selectById(dto.getXpElectronicFenceAreaId());
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpElectronicFenceManagementController.java
@@ -200,39 +200,29 @@
            ElectronicFenceDetailVo.Numbers pointsNumbers = new ElectronicFenceDetailVo.Numbers();
            if(CollUtil.isNotEmpty(pointList)){
                LocalTime localTime = LocalTime.now();
                for (XpPoint xpPoint : pointList) {
                    if(xpPoint.getVerificationStatus() !=5){
                        //verificationStatus 验证状态 1=待验证、2=验证中、3=已验证 4验证失败 5待生效
                        if (xpPoint.getVerificationStatus() == 1){
                            pointsNumbers.setToBeTested(pointsNumbers.getToBeTested() + 1);
                        }else if (xpPoint.getVerificationStatus() == 2){
                            pointsNumbers.setTesting(pointsNumbers.getTesting() + 1);
                        }else if (xpPoint.getVerificationStatus() == 4){
                            pointsNumbers.setTestNotPass(pointsNumbers.getTestNotPass() + 1);
                        }
                    }else{
                        //operationStatus 运营状态 1=待启用 2=启用中 3=已停用 4=已失效
                        if(xpPoint.getOperationStatus() == 1){
                            pointsNumbers.setPendingLaunch(pointsNumbers.getPendingLaunch() + 1);
                        }
                        else if (xpPoint.getOperationStatus() == 2) {
                            boolean pointOperation = bootCommonService.getPointOperation(localTime, xpPoint);
                            if (pointOperation) {
                                pointsNumbers.setStartingUp(pointsNumbers.getStartingUp() + 1);
                            }else{
                                pointsNumbers.setPendingLaunch(pointsNumbers.getPendingLaunch() + 1);
                            }
                        }
                        else if (xpPoint.getOperationStatus() == 3) {
                            pointsNumbers.setExpired(pointsNumbers.getExpired() + 1);
                        }
                        else if (xpPoint.getOperationStatus() == 4) {
                            pointsNumbers.setDisabled(pointsNumbers.getDisabled() + 1);
                        }
                    }
                }
                //总数
                pointsNumbers.setTotalNum(pointList.size());
                //待测试
                long count = pointList.stream().filter(xpPoint -> xpPoint.getVerificationStatus() == 1).count();
                pointsNumbers.setToBeTested(Integer.parseInt(count+""));
                //测试中
                long count2 = pointList.stream().filter(xpPoint -> xpPoint.getVerificationStatus() == 2).count();
                pointsNumbers.setTesting(Integer.parseInt(count2+""));
                //测试不通过
                long count3 = pointList.stream().filter(xpPoint -> xpPoint.getVerificationStatus() == 4).count();
                pointsNumbers.setTestNotPass(Integer.parseInt(count3+""));
                //待启用
                long count4 = pointList.stream().filter(xpPoint -> xpPoint.getOperationStatus() == 1 && xpPoint.getVerificationStatus() == 3).count();
                pointsNumbers.setPendingLaunch(Integer.parseInt(count4+""));
                //启用中
                long count5 = pointList.stream().filter(xpPoint -> xpPoint.getOperationStatus() == 2 && xpPoint.getVerificationStatus() == 3).count();
                pointsNumbers.setStartingUp(Integer.parseInt(count5+""));
                //已停用
                long count6 = pointList.stream().filter(xpPoint -> xpPoint.getOperationStatus() == 3 && xpPoint.getVerificationStatus() == 3).count();
                pointsNumbers.setDisabled(Integer.parseInt(count6+""));
                //已失效
                long count7 = pointList.stream().filter(xpPoint -> xpPoint.getOperationStatus() == 4 && xpPoint.getVerificationStatus() == 3).count();
                pointsNumbers.setExpired(Integer.parseInt(count7+""));
            }
            res.setPointsNumbers(pointsNumbers);
        }
@@ -244,34 +234,20 @@
        ElectronicFenceDetailVo.Numbers stationNumbers = new ElectronicFenceDetailVo.Numbers();
        if(CollUtil.isNotEmpty(stationList)){
            LocalTime localTime = LocalTime.now();
            //status 场站状态 0=草稿 1=待启用 2=启用中 3=已停用 4=失效
            for (XpStation xpStation : stationList) {
                switch (xpStation.getStatus()) {
                    case 0:
                        stationNumbers.setDraft(stationNumbers.getDraft() + 1);
                        break;
                    case 1:
                        stationNumbers.setPendingLaunch(stationNumbers.getPendingLaunch() + 1);
                        break;
                    case 2: //启动中 判断 待启动的状态 ,当前时间在 运营时间 内是启动中,否则是 待启动
                        boolean stationOperation = bootCommonService.getStationOperation(localTime, xpStation.getOperationType(), xpStation.getEffectivePeriod(), xpStation.getEffectiveTimePeriod(), xpStation.getFenceOperationStrategy());
                        if (stationOperation) {
                            stationNumbers.setStartingUp(stationNumbers.getStartingUp() + 1);
                        }else{
                            stationNumbers.setPendingLaunch(stationNumbers.getPendingLaunch() + 1);
                        }
                        break;
                    case 3:
                        stationNumbers.setDisabled(stationNumbers.getDisabled() + 1);
                        break;
                    case 4:
                        stationNumbers.setExpired(stationNumbers.getExpired() + 1);
                        break;
                }
            }
            stationNumbers.setTotalNum(stationList.size());
            //待生效
            long count1 = stationList.stream().filter(xpStation -> xpStation.getStatus() == 1).count();
            stationNumbers.setPendingLaunch(Integer.parseInt(count1+""));
            //启用中
            long count2 = stationList.stream().filter(xpStation -> xpStation.getStatus() == 2).count();
            stationNumbers.setStartingUp(Integer.parseInt(count2+""));
            //已停用
            long count3 = stationList.stream().filter(xpStation -> xpStation.getStatus() == 3).count();
            stationNumbers.setDisabled(Integer.parseInt(count3+""));
            //已失效
            long count4 = stationList.stream().filter(xpStation -> xpStation.getStatus() == 4).count();
            stationNumbers.setExpired(Integer.parseInt(count4+""));
        }
        res.setStationNumbers(stationNumbers);
        return R.ok(res);
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpPointServiceImpl.java
@@ -302,6 +302,12 @@
            if (!intime) {
                continue;
            }
            Integer parkingTimeLimit = xpPoint.getParkingTimeLimit();
            //如果点位位于场站内,则使用场站的限停时间
            if(null != xpPoint.getStationId()){
                XpStation xpStation = xpStationService.getById(xpPoint.getStationId());
                parkingTimeLimit = xpStation.getParkingTimeLimit();
            }
            // 计算距离 小于的站点
            double v = FastDistanceCalculator.distanceFast(dto.getLatitude(), dto.getLongitude(), xpPoint.getPointLat(), xpPoint.getPointLon());
            if (v < orderDistance) {
@@ -312,7 +318,7 @@
                nearestNextVo.setLongitude(xpPoint.getPointLon());
                nearestNextVo.setDistance(v);
                nearestNextVo.setAddress(xpPoint.getPointAddress());
                nearestNextVo.setTime(xpPoint.getParkingTimeLimit());
                nearestNextVo.setTime(parkingTimeLimit);
                nearestNextVo.setElectronicAreaId(xpPoint.getElectronicAreaId());
@@ -441,6 +447,12 @@
        List<XpPoint> xpPoints = this.baseMapper.selectBatchIds(historyStartPointsDto.getPointIds());
        ArrayList<XpHistoryStartPointsVo> resultList = new ArrayList<>(10);
        for (XpPoint xpPoint : xpPoints) {
            Integer parkingTimeLimit = xpPoint.getParkingTimeLimit();
            //如果点位位于场站内,则使用场站的限停时间
            if(null != xpPoint.getStationId()){
                XpStation xpStation = xpStationService.getById(xpPoint.getStationId());
                parkingTimeLimit = xpStation.getParkingTimeLimit();
            }
            XpHistoryStartPointsVo xpHistoryStartPointsVo = new XpHistoryStartPointsVo();
            xpHistoryStartPointsVo.setName(xpPoint.getPointName());
            xpHistoryStartPointsVo.setAddress(xpPoint.getPointAddress());
@@ -449,7 +461,7 @@
            xpHistoryStartPointsVo.setId(xpPoint.getId());
            double distanced = FastDistanceCalculator.distanceFastKm(historyStartPointsDto.getLat(), historyStartPointsDto.getLon(), xpPoint.getPointLat(), xpPoint.getPointLon());
            xpHistoryStartPointsVo.setDistance(distanced);
            xpHistoryStartPointsVo.setTime(xpPoint.getParkingTimeLimit());
            xpHistoryStartPointsVo.setTime(parkingTimeLimit);
            xpHistoryStartPointsVo.setElectronicAreaId(xpPoint.getElectronicAreaId());
            resultList.add(xpHistoryStartPointsVo);
@@ -463,6 +475,12 @@
        List<XpPoint> xpPoints = this.baseMapper.selectBatchIds(historyEndPointsDto.getPointIds());
        ArrayList<XpHistoryEndPointsVo> resultList = new ArrayList<>(10);
        for (XpPoint xpPoint : xpPoints) {
            Integer parkingTimeLimit = xpPoint.getParkingTimeLimit();
            //如果点位位于场站内,则使用场站的限停时间
            if(null != xpPoint.getStationId()){
                XpStation xpStation = xpStationService.getById(xpPoint.getStationId());
                parkingTimeLimit = xpStation.getParkingTimeLimit();
            }
            XpHistoryEndPointsVo xpHistoryEndPointsVo = new XpHistoryEndPointsVo();
            xpHistoryEndPointsVo.setName(xpPoint.getPointName());
            xpHistoryEndPointsVo.setAddress(xpPoint.getPointAddress());
@@ -471,7 +489,7 @@
            xpHistoryEndPointsVo.setId(xpPoint.getId());
            double distanced = FastDistanceCalculator.distanceFastKm(historyEndPointsDto.getLat(), historyEndPointsDto.getLon(), xpPoint.getPointLat(), xpPoint.getPointLon());
            xpHistoryEndPointsVo.setDistance(distanced);
            xpHistoryEndPointsVo.setTime(xpPoint.getParkingTimeLimit());
            xpHistoryEndPointsVo.setTime(parkingTimeLimit);
            xpHistoryEndPointsVo.setElectronicAreaId(xpPoint.getElectronicAreaId());
            resultList.add(xpHistoryEndPointsVo);
        }
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/service/serviceimpl/XpStationServiceImpl.java
@@ -3,6 +3,7 @@
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaopeng.api.model.map.XpGeoFencingPolygon;
import com.xiaopeng.api.model.operation.*;
@@ -12,6 +13,7 @@
import com.xiaopeng.api.vo.operation.XpStationVo;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.exception.ServiceException;
import com.xiaopeng.common.core.utils.StringUtils;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.common.security.service.TokenService;
import com.xiaopeng.map.constant.I18nKeyConstant;
@@ -94,6 +96,16 @@
    }
    @Override
    public List<XpStation> findList(PageInfo<XpStation> pageInfo, XpStationQuery query) {
        if(StringUtils.isNotEmpty(query.getStationPointNum())){
            if(query.getStationPointNum().contains(",")){
                throw new ServiceException("点位数量只能单选");
            }
            if(query.getStationPointNum().contains("gt")){
                query.setStationPointNum(query.getStationPointNum().replace("gt", " > "));
            }else{
                query.setStationPointNum(" = " + query.getStationPointNum());
            }
        }
        List<XpStation> list = null;
        if(pageInfo ==null){
            list = this.baseMapper.pageList(query);
@@ -109,8 +121,8 @@
            }
            PointPageListListQuery queryPoint = new PointPageListListQuery();
            queryPoint.setStationIds(stationIds);
            List<XpPoint> xpPoints = xpPointService.pageList(null, queryPoint);
            List<XpPoint> xpPoints = xpPointService.list(new QueryWrapper<XpPoint>().in("station_id", stationIds)
                    .eq("operation_status", 2).eq("is_deleted", 0));
            // 将点位按场站ID分组,提高后续处理效率
            Map<Long, List<XpPoint>> pointMap = xpPoints.stream()
                    .collect(Collectors.groupingBy(XpPoint::getStationId));
xp-robotaxi-map-boot/src/main/resources/mapper/XpStationMapper.xml
@@ -4,9 +4,39 @@
    <select id="pageList" resultType="com.xiaopeng.api.model.operation.XpStation">
        select a.*,b.operation_strategy as fence_operation_strategy
        select
            a.id,
            a.station_name as stationName,
            a.station_number as stationNumber,
            a.status,
            a.city_code as cityCode,
            a.city_name as cityName,
            a.electronic_id as electronicId,
            a.electronic_area_id as electronicAreaId,
            a.default_point_id as defaultPointId,
            a.station_area as stationArea,
            a.fence_points as fencePoints,
            a.center_lon as centerLon,
            a.center_lat as centerLat,
            a.parking_time_limit as parkingTimeLimit,
            a.operation_type as operationType,
            a.effective_period as effectivePeriod,
            a.effective_time_period as effectiveTimePeriod,
            a.sync_points as syncPoints,
            a.remark,
            a.stop_reason as stopReason,
            a.test_fail_reason as testFailReason,
            a.effect_time as effectTime,
            a.sort_no as sortNo,
            a.is_deleted as isDeleted,
            a.create_time as createTime,
            a.update_time as updateTime,
            a.create_by as createBy,
            a.update_by as updateBy,
            b.operation_strategy as fence_operation_strategy
        from xp_station a
        inner join xp_electronic_fence b on a.electronic_id = b.id and b.is_deleted = 0
        left join (select station_id,count(id) as point_num from xp_point where is_deleted=0 group by station_id) c on a.id = c.station_id
        where a.is_deleted = 0
        <if test="query.id != null">
            and a.id = #{query.id}
@@ -40,7 +70,12 @@
        <if test="query.createBy != null and query.createBy!=''">
            and a.create_by like concat('%',#{query.createBy},'%')
        </if>
        <if test="query.createStartTime != null and query.createStartTime!=''">
            and a.create_time >= #{query.createStartTime}
        </if>
        <if test="query.createEndTime != null and query.createEndTime!=''">
            and #{query.createEndTime} >= a.create_time
        </if>
        <if test="query.updateBy != null and query.updateBy!=''">
            and a.update_by like concat('%',#{query.updateBy},'%')
        </if>
@@ -51,9 +86,7 @@
            and #{query.updateEndTime} >= a.update_time
        </if>
        <if test="query.stationPointNum != null and query.stationPointNum!=''">
            and (
                FIND_IN_SET( (SELECT COUNT(xp.id) FROM xp_point xp WHERE xp.is_deleted=0 and xp.station_id = a.id ),#{query.stationPointNum})
            )
            and c.point_num #{query.stationPointNum}
        </if>
        GROUP BY a.id
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/config/MiniprogramConfigurer.java
@@ -10,7 +10,7 @@
import javax.annotation.Resource;
@Slf4j
//@Configuration
@Configuration
public class MiniprogramConfigurer extends WebMvcConfigurerAdapter {
    @Resource
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/OssController.java
@@ -35,22 +35,22 @@
    public R<FileUploadVO> uploadOSS(@RequestParam("file") MultipartFile file) {
        try {
            // 上传并返回访问地址
//            String fileName = file.getOriginalFilename();
//            String prefix = fileName.substring(fileName.lastIndexOf("."));
//            long fileSize = file.getSize();
//            String fileId = UUID.randomUUID().toString();
//            //上传文件
//            aliOssService.uploadFile(file.getBytes(), fileId);
//            String downloadUrl = aliOssService.getDownloadUrl(fileId, fileName,true);
//            FileUploadVO fileUploadVO = new FileUploadVO();
//            fileUploadVO.setId(fileId);
//            fileUploadVO.setName(fileName);
//            fileUploadVO.setUrl(downloadUrl);
            String fileName = file.getOriginalFilename();
            String prefix = fileName.substring(fileName.lastIndexOf("."));
            long fileSize = file.getSize();
            String fileId = UUID.randomUUID().toString();
            //上传文件
            aliOssService.uploadFile(file.getBytes(), fileId);
            String downloadUrl = aliOssService.getDownloadUrl(fileId, fileName,true);
            FileUploadVO fileUploadVO = new FileUploadVO();
            fileUploadVO.setId(UUID.randomUUID().toString());
            fileUploadVO.setName("测试.jpg");
            fileUploadVO.setUrl("https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/552a3a31-e4dd-4a28-8748-fd8b87dd3055.png");
            fileUploadVO.setId(fileId);
            fileUploadVO.setName(fileName);
            fileUploadVO.setUrl(downloadUrl);
//            FileUploadVO fileUploadVO = new FileUploadVO();
//            fileUploadVO.setId(UUID.randomUUID().toString());
//            fileUploadVO.setName("测试.jpg");
//            fileUploadVO.setUrl("https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/552a3a31-e4dd-4a28-8748-fd8b87dd3055.png");
            return R.ok(fileUploadVO);
        } catch (Exception e) {
            System.err.println("上传文件失败"+e);
@@ -66,22 +66,22 @@
    public R<FileUploadVO> uploadOSS1(@RequestParam("file") MultipartFile file) {
        try {
            // 上传并返回访问地址
//            String fileName = file.getOriginalFilename();
//            String prefix = fileName.substring(fileName.lastIndexOf("."));
//            long fileSize = file.getSize();
//            String fileId = UUID.randomUUID().toString();
//            //上传文件
//            aliOssService.uploadFile(file.getBytes(), fileId);
//            String downloadUrl = aliOssService.getDownloadUrl(fileId, fileName,true);
//            FileUploadVO fileUploadVO = new FileUploadVO();
//            fileUploadVO.setId(fileId);
//            fileUploadVO.setName(fileName);
//            fileUploadVO.setUrl(downloadUrl);
            String fileName = file.getOriginalFilename();
            String prefix = fileName.substring(fileName.lastIndexOf("."));
            long fileSize = file.getSize();
            String fileId = UUID.randomUUID().toString();
            //上传文件
            aliOssService.uploadFile(file.getBytes(), fileId);
            String downloadUrl = aliOssService.getDownloadUrl(fileId, fileName,true);
            FileUploadVO fileUploadVO = new FileUploadVO();
            fileUploadVO.setId(UUID.randomUUID().toString());
            fileUploadVO.setName("测试.jpg");
            fileUploadVO.setUrl("https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/552a3a31-e4dd-4a28-8748-fd8b87dd3055.png");
            fileUploadVO.setId(fileId);
            fileUploadVO.setName(fileName);
            fileUploadVO.setUrl(downloadUrl);
//            FileUploadVO fileUploadVO = new FileUploadVO();
//            fileUploadVO.setId(UUID.randomUUID().toString());
//            fileUploadVO.setName("测试.jpg");
//            fileUploadVO.setUrl("https://huishou-1323682843.cos.ap-nanjing.myqcloud.com/images/552a3a31-e4dd-4a28-8748-fd8b87dd3055.png");
            return R.ok(fileUploadVO);
        } catch (Exception e) {
            System.err.println("上传文件失败"+e);
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/ReassignOrderController.java
@@ -53,7 +53,6 @@
     */
    @Scheduled(cron = "0/3 * * * * ?")
    public void taskReassignPushOrder() {
//        System.out.println("3秒执行一次");
        //从redis 获取数据 同步 处理数据
        R<List<XpOrderReassign>> r = xpOrderReassignClient.findListOrderReassign();
        if(r.getCode()==200 && !r.getData().isEmpty()){
@@ -62,7 +61,9 @@
                //改派次数小4
                if(!reassign.getIsComplete() && reassign.getReassignNum()<=3){
                    XpOrderReassign reassign2 = taskOrderUtil.reassignPushOrder(10, String.valueOf(reassign.getAppUserId()),reassign.getLongitude(),reassign.getLatitude(),reassign.getOrderNumber());
                    xpOrderReassignClient.saveOrderReassign(reassign2);
                    if(null != reassign2){
                        xpOrderReassignClient.saveOrderReassign(reassign2);
                    }
                }
            }
        }
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpInvitationCodeController.java
@@ -10,14 +10,18 @@
import cn.hutool.core.util.DesensitizedUtil;
import cn.hutool.core.util.PhoneUtil;
import cn.hutool.core.io.resource.ClassPathResource;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.xiaopeng.api.dto.account.UcUserInfo;
import com.xiaopeng.api.feignClient.account.SysGroupMenuClient;
import com.xiaopeng.api.feignClient.account.UserResourcesClient;
import com.xiaopeng.api.model.operation.XpInvitationCode;
import com.xiaopeng.api.model.operation.XpWhitelist;
import com.xiaopeng.api.vo.account.LoginUser;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.exception.ServiceException;
import com.xiaopeng.common.core.utils.DateUtils;
import com.xiaopeng.common.core.utils.SensitiveDataCryptoUtil;
import com.xiaopeng.common.core.utils.WebUtils;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.common.log.annotation.AdminOperationLog;
@@ -36,6 +40,7 @@
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shardingsphere.transaction.annotation.ShardingSphereTransactionType;
import org.apache.shardingsphere.transaction.core.TransactionType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.transaction.annotation.Transactional;
@@ -82,6 +87,8 @@
    private SysGroupMenuClient groupMenuClient;
    @Resource
    private TokenService tokenService;
    @Autowired
    private UserResourcesClient userResourcesClient;
    private static final Pattern CHINESE_PATTERN = Pattern.compile("\\p{IsHan}");
    private static final long INVITATION_CODE_LIMIT = 500L;
@@ -304,11 +311,14 @@
                String res = replace.replace("/", "-");
                locationExcel.setBindTime(res);
            }
            xpInvitationCode.setBindTime(DateUtils.stringToLocalDateTime(locationExcel.getBindTime()));
            xpInvitationCode.setStatus(2);
            UcUserInfo userByMobile = userResourcesClient.getUserByMobile(locationExcel.getBindAccount());
            if(null == userByMobile || StringUtils.isEmpty(userByMobile.getUid())){
                throw new ServiceException("手机号"+locationExcel.getBindAccount()+"查询用户失败");
            }
            XpWhitelist xpWhitelist = new XpWhitelist();
            xpWhitelist.setAccount(locationExcel.getBindAccount());
            xpWhitelist.setAccount(SensitiveDataCryptoUtil.encrypt(locationExcel.getBindAccount()));
            xpWhitelist.setNickName(userByMobile.getNickName());
            xpWhitelist.setAppUserId(userByMobile.getUid());
            xpWhitelist.setStatus(true);
            xpWhitelist.setIsPriorityDispatch(false);
            xpWhitelist.setWhitelistSource(2);
@@ -396,6 +406,15 @@
    public R deleteByIds(String ids){
        // 再转化为Long类型
        List<Long> longs = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
        List<XpInvitationCode> xpInvitationCodes = xpInvitationCodeService.listByIds(longs);
        for (XpInvitationCode xpInvitationCode : xpInvitationCodes) {
            XpWhitelist one = xpWhitelistService.getOne(new QueryWrapper<XpWhitelist>().eq("whitelist_source", 2)
                    .eq("status", 1).eq("is_deleted", 0)
                    .eq("account", SensitiveDataCryptoUtil.encrypt(xpInvitationCode.getBindAccount())).last(" limit 1"));
            if(null != one){
                xpWhitelistService.removeById(one);
            }
        }
        xpInvitationCodeService.removeBatchByIds(longs);
        return R.ok();
    }
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpWhitelistController.java
@@ -31,6 +31,8 @@
import com.xiaopeng.operation.query.WhitelistPageListQuery;
import com.xiaopeng.operation.service.IXpWhitelistOperlogService;
import com.xiaopeng.operation.service.IXpWhitelistService;
import com.xiaopeng.operation.vo.XpAgreementVo;
import com.xiaopeng.unifiedverification.interceptor.XpClientCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -46,6 +48,7 @@
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
@@ -533,4 +536,17 @@
        XpWhitelist one = xpWhitelistService.getOne(new QueryWrapper<XpWhitelist>().eq("app_user_id", uid).eq("is_deleted", 0));
        return R.ok(one);
    }
    @ApiOperation(value = "获取白名单权限", tags = {"小程序-首页"})
    @GetMapping("/api/v1/mini-program/whitelist/getUserWhitelist")
    @XpClientCheck(checkToken = false, checkOtpToken = true)
    public R<Boolean> getUserWhitelist(HttpServletRequest request){
        String uid = request.getHeader("XP-Uid");
        long count = xpWhitelistService.count(new QueryWrapper<XpWhitelist>()
                .eq("app_user_id", uid).eq("status", 1).eq("is_deleted", 0)
                .last(" and (DATE(expire_time) > DATE(NOW()) or expire_time is null)"));
        return R.ok(count > 0);
    }
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/mapper/XpTargetedServiceMapper.java
@@ -35,6 +35,6 @@
     * @param time 时间
     * @return
     */
    List<XpTargetedServiceVehicleVo> findListInfoVehicle(@Param("appUserId") Long appUserId, @Param("cityCode") String cityCode, @Param("time")LocalDateTime time);
    List<XpTargetedServiceVehicleVo> findListInfoVehicle(@Param("appUserId") Long appUserId, @Param("cityCode") String cityCode);
}
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/XpTargetedServiceService.java
@@ -9,7 +9,6 @@
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.web.page.PageInfo;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Set;
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpInvitationCodeServiceImpl.java
@@ -1,9 +1,13 @@
package com.xiaopeng.operation.service.impl;
import com.xiaopeng.api.dto.account.UcUserInfo;
import com.xiaopeng.api.feignClient.account.UserResourcesClient;
import com.xiaopeng.api.model.operation.XpInvitationCode;
import com.xiaopeng.api.model.operation.XpPoint;
import com.xiaopeng.api.model.operation.XpWhitelist;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.core.exception.ServiceException;
import com.xiaopeng.common.core.utils.SensitiveDataCryptoUtil;
import com.xiaopeng.common.core.web.page.PageInfo;
import com.xiaopeng.operation.constant.I18nKeyConstant;
import com.xiaopeng.operation.mapper.XpInvitationCodeMapper;
@@ -15,6 +19,7 @@
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@@ -32,6 +37,8 @@
    @Autowired
    private XpWhitelistMapper xpWhitelistMapper;
    @Autowired
    private UserResourcesClient userResourcesClient;
    private static final long INVITATION_CODE_LIMIT = 500L;
    @Override
    public PageInfo<XpInvitationCode> pageList(InvitationPageListQuery query) {
@@ -80,13 +87,18 @@
                xpInvitationCode.setBindTime(LocalDateTime.now());
                xpInvitationCode.setStatus(2);
                addInvitationCodeList.add(xpInvitationCode);
                UcUserInfo userByMobile = userResourcesClient.getUserByMobile(phone);
                if(null == userByMobile || StringUtils.isEmpty(userByMobile.getUid())){
                    throw new ServiceException("手机号"+phone+"查询用户失败");
                }
                XpWhitelist xpWhitelist = new XpWhitelist();
                xpWhitelist.setAccount(phone);
                xpWhitelist.setAccount(SensitiveDataCryptoUtil.encrypt(phone));
                xpWhitelist.setNickName(userByMobile.getNickName());
                xpWhitelist.setAppUserId(userByMobile.getUid());
                xpWhitelist.setStatus(true);
                xpWhitelist.setIsPriorityDispatch(false);
                xpWhitelist.setWhitelistSource(2);
                xpWhitelistMapper.insert(xpWhitelist);
            }
            this.saveBatch(addInvitationCodeList);
            return R.ok();
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpPointServiceImpl.java
@@ -28,16 +28,14 @@
import com.xiaopeng.operation.mapper.XpPointMapper;
import com.xiaopeng.operation.mapper.XpSystemSettingMapper;
import com.xiaopeng.operation.query.PointByNameQuery;
import com.xiaopeng.operation.service.IXpElectronicFenceAreaService;
import com.xiaopeng.operation.service.IXpElectronicFenceService;
import com.xiaopeng.operation.service.IXpTradingStrategyService;
import com.xiaopeng.operation.service.XpPointService;
import com.xiaopeng.operation.service.*;
import com.xiaopeng.operation.utils.TimeRangeChecker;
import com.xiaopeng.operation.utils.holiday.HolidayUtil;
import com.xiaopeng.operation.utils.map.FastDistanceCalculator;
import com.xiaopeng.api.vo.operation.NearestNextVo;
import com.xiaopeng.operation.vo.NearestVo;
import com.xiaopeng.operation.vo.OrderDistanceVo;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
@@ -88,6 +86,10 @@
    @Resource
    private IXpTradingStrategyService xpTradingStrategyService;
    @Resource
    @Lazy
    private XpStationService xpStationService;
    /**
     * 如果站点是挂在场站下的  需要返回一个场站id   stationId
@@ -389,7 +391,12 @@
                }
            }
            Integer parkingTimeLimit = xpPoint.getParkingTimeLimit();
            //如果点位位于场站内,则使用场站的限停时间
            if(null != xpPoint.getStationId()){
                XpStation xpStation = xpStationService.getById(xpPoint.getStationId());
                parkingTimeLimit = xpStation.getParkingTimeLimit();
            }
            XpHistoryStartPointsVo xpHistoryStartPointsVo = new XpHistoryStartPointsVo();
            xpHistoryStartPointsVo.setOperationStatus(1);
            xpHistoryStartPointsVo.setName(xpPoint.getPointName());
@@ -399,7 +406,7 @@
            xpHistoryStartPointsVo.setId(xpPoint.getId());
            double distanced = FastDistanceCalculator.distanceFast(historyStartPointsDto.getLat(), historyStartPointsDto.getLon(), xpPoint.getPointLat(), xpPoint.getPointLon());
            xpHistoryStartPointsVo.setDistance(distanced);
            xpHistoryStartPointsVo.setTime(xpPoint.getParkingTimeLimit());
            xpHistoryStartPointsVo.setTime(parkingTimeLimit);
            xpHistoryStartPointsVo.setElectronicAreaId(xpPoint.getElectronicAreaId());
            // 判断是否收藏
            if(pointIdsByUserId!=null && !pointIdsByUserId.getData().isEmpty()){
@@ -475,6 +482,12 @@
                    continue;
                }
            }
            Integer parkingTimeLimit = xpPoint.getParkingTimeLimit();
            //如果点位位于场站内,则使用场站的限停时间
            if(null != xpPoint.getStationId()){
                XpStation xpStation = xpStationService.getById(xpPoint.getStationId());
                parkingTimeLimit = xpStation.getParkingTimeLimit();
            }
            XpHistoryEndPointsVo xpHistoryEndPointsVo = new XpHistoryEndPointsVo();
            xpHistoryEndPointsVo.setOperationStatus(1);
            xpHistoryEndPointsVo.setName(xpPoint.getPointName());
@@ -484,7 +497,7 @@
            xpHistoryEndPointsVo.setId(xpPoint.getId());
            double distanced = FastDistanceCalculator.distanceFast(historyEndPointsDto.getLat(), historyEndPointsDto.getLon(), xpPoint.getPointLat(), xpPoint.getPointLon());
            xpHistoryEndPointsVo.setDistance(distanced);
            xpHistoryEndPointsVo.setTime(xpPoint.getParkingTimeLimit());
            xpHistoryEndPointsVo.setTime(parkingTimeLimit);
            xpHistoryEndPointsVo.setElectronicAreaId(xpPoint.getElectronicAreaId());
            // 判断是否收藏
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpRoutePlanServiceImpl.java
@@ -1,5 +1,6 @@
package com.xiaopeng.operation.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiaopeng.api.model.operation.XpOpenCity;
import com.xiaopeng.api.model.operation.XpRoutePlan;
import com.xiaopeng.common.core.exception.ServiceException;
@@ -49,6 +50,16 @@
        if (openCity == null) {
            throw new ServiceException("开通城市不存在");
        }
        long count = this.count(new QueryWrapper<XpRoutePlan>().eq("open_city_id", openCity.getId())
                .eq("is_deleted", 0));
        if(count >= 3){
            throw new ServiceException("同一个城市只能添加三个路线规划");
        }
        count = this.count(new QueryWrapper<XpRoutePlan>().eq("open_city_id", openCity.getId())
                .eq("plan_name", dto.getPlanName()).eq("is_deleted", 0));
        if(count > 0){
            throw new ServiceException("路线规划名称不能重复");
        }
        // 2. 创建路线规划配置对象
        XpRoutePlan routePlan = new XpRoutePlan();
@@ -82,6 +93,11 @@
        if (openCity == null) {
            throw new ServiceException("开通城市不存在");
        }
        long count = this.count(new QueryWrapper<XpRoutePlan>().eq("open_city_id", openCity.getId())
                .eq("plan_name", dto.getPlanName()).eq("is_deleted", 0).ne("id", dto.getId()));
        if(count > 0){
            throw new ServiceException("路线规划名称不能重复");
        }
        // 3. 更新字段
        routePlan.setOpenCityId(dto.getOpenCityId());
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpSystemSettingServiceImpl.java
@@ -106,6 +106,7 @@
                    .set(XpSystemSetting::getXczSyTime, xpSystemSetting.getXczSyTime())
                    .set(XpSystemSetting::getXczHmSpeedPerHour, xpSystemSetting.getXczHmSpeedPerHour())
                    .set(XpSystemSetting::getXczHmDuration, xpSystemSetting.getXczHmDuration())
                    .set(XpSystemSetting::getOperateFree, xpSystemSetting.getOperateFree())
                    .update();
        }else {
            save(xpSystemSetting);
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/service/impl/XpTargetedServiceServiceImpl.java
@@ -216,7 +216,7 @@
    @Override
    public List<XpTargetedServiceVehicleVo> findListByUserIdAndCityCode(Long appUserId, String cityCode) {
        List<XpTargetedServiceVehicleVo> listInfoVehicle = baseMapper.findListInfoVehicle(appUserId, cityCode, LocalDateTime.now());
        List<XpTargetedServiceVehicleVo> listInfoVehicle = baseMapper.findListInfoVehicle(appUserId, cityCode);
        if(!listInfoVehicle.isEmpty()){
            // 提取车辆ID列表
xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/utils/TaskOrderUtil.java
@@ -1228,6 +1228,13 @@
                continue;
            }
            log.info("连环派单查询车辆结果 {} {}", orderNo, JSON.toJSONString(servingVehicles.getData()));
            if(!isTargetedService){
                servingVehicles.getData().removeAll(vehicleVinByTargetedService);
                log.info("剔除定向服务车辆后的结果 {} 单号 {}", JSON.toJSONString(servingVehicles), orderNo);
            }else{
                servingVehicles.setData(vehicleVinByTargetedService);
                log.info("查找定向服务车辆后的结果 {} 单号 {}", JSON.toJSONString(servingVehicles), orderNo);
            }
            XpTradingStrategyDetailVO strategyDetailVO = tradingStrategyClient.queryById().getData();
            log.info("连环排查推单逻辑 {} {}", orderNo, JSON.toJSONString(strategyDetailVO));
@@ -1247,7 +1254,8 @@
                XpOrder xpOrder1 = xpOrderClient.queryOrderById(vehiclePosition.getOrderId()).getData();
                Object cacheObject = redisService.getCacheObject(CacheConstants.navigationEnd(xpOrder1.getAppUserId().toString()));
                RouteVo routeRemain = JSON.parseObject(cacheObject.toString(), RouteVo.class);
                if (routeRemain.getDuration() / 60 > timeRegardAsEnding && routeRemain.getDistance() / 1000 > distanceRegardAsEnding) {
                //距离和时间只要有一个满足条件就达到候选对象
                if (routeRemain.getDuration() > timeRegardAsEnding * 60 && routeRemain.getDistance() > distanceRegardAsEnding * 1000) {
                    log.info("连环派单 {} 车辆订单结束时间不满足条件 {} 秒 {} 米 {}", vin, routeRemain.getDuration(), routeRemain.getDistance(), orderNo);
                    continue;
                }
@@ -1260,21 +1268,22 @@
                RouteVo route = xpMapClient.getDistanceAndDuration(next).getData();
                Object new_cacheObject = redisService.getCacheObject(CacheConstants.navigationEnd(xpOrder.getAppUserId().toString()));
                RouteVo new_routeRemain = JSON.parseObject(new_cacheObject.toString(), RouteVo.class);
                long xh = (new_routeRemain.getDistance() + route.getDistance()) / 1000 + backupPower;
                if(vehiclePosition.getMileageRange() < xh){
                    log.info("连环派单 {} 车辆剩余续航不满足派车条件 {} KM {}", vin, xh, orderNo);
                //总续航里程 米
                long xh = new_routeRemain.getDistance() + route.getDistance() + backupPower * 1000;
                if(vehiclePosition.getMileageRange() * 1000 < xh){
                    log.info("连环派单 {} 车辆剩余续航不满足派车条件 {} 米 {}", vin, xh, orderNo);
                    continue;
                }
                //下一单的起点距离本单终点小于X公里,或者下一单的用车时间与本单的预计结束时间偏差小于X分钟
                next = new RouteAndFareDto();
                next.setOrigin(new LonLatDto(xpOrder1.getEndLon(),xpOrder1.getEndLat()));
                next.setDestination(new LonLatDto(xpOrder.getStartLon(),xpOrder.getStartLat()));
                route = xpMapClient.getDistanceAndDuration(next).getData();
                //相差秒时间
                long time = routeRemain.getDuration() - xpOrder.getCreateTime().toEpochSecond(ZoneOffset.of("+8"));
                if(route.getDistance() / 1000 <= destToPassenger || time / 60 <= endingTimeToUseTime){
                    log.info("连环派单 {} 找到满足条件的车辆 {}", vin, orderNo);
                //上一单的预估结束时间
                LocalDateTime localDateTime = LocalDateTime.now().plusSeconds(routeRemain.getDuration());
                //上一单预估结束时间与本单用车时间差 秒
                long time = localDateTime.toEpochSecond(ZoneOffset.of("+8")) - xpOrder1.getCreateTime().toEpochSecond(ZoneOffset.of("+8"));
                if(route.getDistance() <= destToPassenger * 1000 || time <= endingTimeToUseTime * 60){
                    log.info("连环派单 {} 找到满足条件的车辆 {} 距离 {} 时间 {}", orderNo, vin, route.getDistance(), time);
                    log.info("上一单终点与当前订单起点距离 {} 米 {}", route.getDistance(), orderNo);
                    log.info("当前订单用车时间与上一单预估结束时间偏差 {} 秒 {}", time, orderNo);
                    // 设置接驾导航数据
                    //将上一单的剩余导航添加到接驾导航中
                    route.getPolyline().addAll(0, routeRemain.getPolyline());
@@ -1286,6 +1295,7 @@
                    xpOrder.setAcceptanceTime(LocalDateTime.now());
                    xpOrder.setStatus(2);
                    xpOrderClient.updateOrder(xpOrder);
                    log.info("连环派单 {} 修改订单状态为接单成功 {}", orderNo, xpOrder.getId());
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("orderId", xpOrder.getId());
@@ -1294,7 +1304,7 @@
                    redisService.setCacheObject(CacheConstants.nextOrder(xpOrder1.getId().toString()), jsonObject.toJSONString());
                    redisService.setCacheObject(CacheConstants.navigationStart(xpOrder.getAppUserId().toString()), JSON.toJSONString(route));
                    redisService.removeByPattern(quoteName,xpOrder.getOrderNumber());
                    log.info("将订单 {} 从队列 {} 弹出去", orderNo, quoteName);
                    log.info("连环派单 {} 设置下一单接驾导航数据 {}", orderNo, JSON.toJSONString(route));
                    //构建推送消息
                    Map<String, Object> params = new HashMap<>();
xp-robotaxi-operation-boot/src/main/resources/mapper/operation/XpTargetedServiceMapper.xml
@@ -39,11 +39,11 @@
        FROM xp_targeted_service  a
         INNER JOIN xp_targeted_service_whitelist c on c.targeted_service_id = a.id
         INNER JOIN xp_whitelist w on w.id = c.whitelist_id and w.`status` = 1 and w.is_priority_dispatch = 1
            and (  w.expire_time > #{time} or w.end_time is null )
            and (w.expire_time >= DATE(now()) or w.expire_time is null )
         left JOIN xp_targeted_service_vehicle b on b.targeted_service_id = a.id
        WHERE a.is_deleted = 0 and a.`status` =1
          and a.city_code = #{cityCode}
          and  ( a.is_long_valid =1 or #{time} between a.start_time and a.end_time >  )
          and  ( a.is_long_valid =1 or now() between a.start_time and a.end_time)
          and w.app_user_id = #{appUserId}
    </select>
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/config/MiniprogramConfigurer.java
@@ -10,7 +10,7 @@
import javax.annotation.Resource;
@Slf4j
//@Configuration
@Configuration
public class MiniprogramConfigurer extends WebMvcConfigurerAdapter {
    @Resource
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/ActiveOrderController.java
@@ -2,9 +2,11 @@
import com.alibaba.fastjson2.JSON;
import com.xiaopeng.api.dto.QueryOrderRouteDTO;
import com.xiaopeng.api.feignClient.map.XpStationClient;
import com.xiaopeng.api.feignClient.operation.XpPointClient;
import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient;
import com.xiaopeng.api.model.operation.XpPoint;
import com.xiaopeng.api.model.operation.XpStation;
import com.xiaopeng.api.model.order.XpOrder;
import com.xiaopeng.api.model.vehicleConvoy.XpVehicle;
import com.xiaopeng.api.vo.automaticPilot.VehiclePosition;
@@ -55,6 +57,8 @@
    private final XpVehicleClient xpVehicleClient;
    @Resource
    private RedisService redisService;
    @Resource
    private XpStationClient xpStationClient;
    private R<XpOrder> getOrderTripEnd(String orderId) {
@@ -153,13 +157,25 @@
        R<XpPoint> xpPointR = xpPointClient.queryById(xpOrder.getStartPointId());
        if (xpPointR.getCode() == R.SUCCESS) {
            XpPoint startPoint = xpPointR.getData();
            xpOrderDetailVO.setStartParkingTimeLimit(startPoint.getParkingTimeLimit());
            Integer parkingTimeLimit = startPoint.getParkingTimeLimit();
            //如果点位位于场站内,则使用场站的限停时间
            if(null != startPoint.getStationId()){
                XpStation xpStation = xpStationClient.getXpStationById(startPoint.getStationId()).getData();
                parkingTimeLimit = xpStation.getParkingTimeLimit();
            }
            xpOrderDetailVO.setStartParkingTimeLimit(parkingTimeLimit);
        }
        R<XpPoint> xpPointR1 = xpPointClient.queryById(xpOrder.getEndPointId());
        if (xpPointR1.getCode() == R.SUCCESS) {
            XpPoint endPoint = xpPointR1.getData();
            xpOrderDetailVO.setEndParkingTimeLimit(endPoint.getParkingTimeLimit());
            Integer parkingTimeLimit = endPoint.getParkingTimeLimit();
            //如果点位位于场站内,则使用场站的限停时间
            if(null != endPoint.getStationId()){
                XpStation xpStation = xpStationClient.getXpStationById(endPoint.getStationId()).getData();
                parkingTimeLimit = xpStation.getParkingTimeLimit();
            }
            xpOrderDetailVO.setEndParkingTimeLimit(parkingTimeLimit);
        }
        if (xpOrder.getVehicleId() != null) {
            R<XpVehicle> xpVehicleR = xpVehicleClient.queryById(xpOrder.getVehicleId());
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/controller/XpOrderController.java
@@ -999,4 +999,14 @@
    }
    /**
     * 查询是否有未支付订单
     */
    @PostMapping("/logan/inner/order/has-unpay-order")
    public R<Long> hasUnPayOrder(@RequestParam String uid){
        long count = xpOrderService.count(new QueryWrapper<XpOrder>().eq("app_user_id", Long.valueOf(uid))
                .eq("status", 8).eq("is_deleted", 0));
        return R.ok(count);
    }
}
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/job/jobs/OrderCancelJob.java
@@ -31,7 +31,7 @@
        JobDataMap maps = context.getMergedJobDataMap();
        Long orderId = maps.getLong("id");
        try {
            log.info("开始执行订单取消任务");
            log.info("开始执行订单取消任务 {}", orderId);
            XpOrder xpOrder = xpOrderService.getById(orderId);
            if(Objects.nonNull(xpOrder) && (xpOrder.getStatus()==4 || xpOrder.getStatus()==5)){
                Integer status = xpOrder.getStatus();
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -36,6 +36,7 @@
import com.xiaopeng.api.feignClient.automaticPilot.VehicleBuriedPointClient;
import com.xiaopeng.api.feignClient.maintenance.XpTaskRuleClient;
import com.xiaopeng.api.feignClient.map.XpMapClient;
import com.xiaopeng.api.feignClient.map.XpStationClient;
import com.xiaopeng.api.feignClient.operation.*;
import com.xiaopeng.api.feignClient.order.XpCruiseOrderClient;
import com.xiaopeng.api.feignClient.payFront.XpPayFrontClient;
@@ -215,6 +216,8 @@
    @Resource
    private XpPayFrontClient xpPayFrontClient;
    @Resource
    private XpStationClient xpStationClient;
    @Value("${robotaxi.appId:xp_robotaxi_api}")
    private String appid;
@@ -1001,6 +1004,12 @@
        if(order.getOfficialPartnerId() == null){
            //创建定时任务执行延迟驶离终点和下发巡游单
            XpPoint point = xpPointClient.queryById(order.getEndPointId()).getData();
            Integer parkingTimeLimit = point.getParkingTimeLimit();
            //如果点位位于场站内,则使用场站的限停时间
            if(null != point.getStationId()){
                XpStation xpStation = xpStationClient.getXpStationById(point.getStationId()).getData();
                parkingTimeLimit = xpStation.getParkingTimeLimit();
            }
            Map<String, ? extends Object> jobMaps =
                    new ImmutableMap.Builder<String, String>()
                            .put("id", order.getId().toString())
@@ -1010,7 +1019,7 @@
                    AddCruiseMissionJob.class,
                    (AddCruiseMissionJob.name + order.getId()).toUpperCase(),
                    TimeJobType.ADD_CRUISE_MISSION,
                    DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(point.getParkingTimeLimit())),
                    DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(parkingTimeLimit)),
                    jobMaps
            );
        }else{
@@ -1443,6 +1452,12 @@
                .orElse(new ArrayList<>());
        for (Long pointId : endPointId) {
            XpPoint endPoint = getPointById(pointId);
            Integer parkingTimeLimit = endPoint.getParkingTimeLimit();
            //如果点位位于场站内,则使用场站的限停时间
            if(null != endPoint.getStationId()){
                XpStation xpStation = xpStationClient.getXpStationById(endPoint.getStationId()).getData();
                parkingTimeLimit = xpStation.getParkingTimeLimit();
            }
            // 计算直线距离,如果endPoint到startPoint的距离大于minOrderDistance,则返回该点
            GlobalCoordinates endCoordinates = new GlobalCoordinates(endPoint.getPointLon(), endPoint.getPointLat());
            double distanceMeter = GeodesyUtil.getDistanceMeter(startCoordinates, endCoordinates, Ellipsoid.WGS84);
@@ -1454,7 +1469,7 @@
                ret.setLongitude(endPoint.getPointLon());
                ret.setDistance(new BigDecimal(distanceMeter).setScale(2, RoundingMode.HALF_UP).doubleValue());
                ret.setAddress(endPoint.getPointAddress());
                ret.setTime(endPoint.getParkingTimeLimit());
                ret.setTime(parkingTimeLimit);
                ret.setElectronicAreaId(endPoint.getElectronicAreaId());
                // 判断是否收藏
                if (pointIdsByUserId.contains(endPoint.getId())) {
@@ -1786,20 +1801,32 @@
            for (XpOrderHistoryListVO xpOrderHistoryListVO : value) {
                XpPoint xpPoint = pointList.stream().filter(e -> e.getId().equals(xpOrderHistoryListVO.getStartPointId())).findFirst().orElse(null);
                if (xpPoint != null) {
                    Integer parkingTimeLimit = xpPoint.getParkingTimeLimit();
                    //如果点位位于场站内,则使用场站的限停时间
                    if(null != xpPoint.getStationId()){
                        XpStation xpStation = xpStationClient.getXpStationById(xpPoint.getStationId()).getData();
                        parkingTimeLimit = xpStation.getParkingTimeLimit();
                    }
                    xpOrderHistoryListVO.setStartPointName(xpPoint.getPointName());
                    xpOrderHistoryListVO.setStartLat(xpPoint.getPointLat());
                    xpOrderHistoryListVO.setStartLon(xpPoint.getPointLon());
                    xpOrderHistoryListVO.setXpElectronicFenceAreaId(xpPoint.getElectronicAreaId());
                    xpOrderHistoryListVO.setStartParkingTimeLimit(xpPoint.getParkingTimeLimit());
                    xpOrderHistoryListVO.setStartParkingTimeLimit(parkingTimeLimit);
                }
                xpPoint = pointList.stream().filter(e -> e.getId().equals(xpOrderHistoryListVO.getEndPointId())).findFirst().orElse(null);
                if (xpPoint != null) {
                    Integer parkingTimeLimit = xpPoint.getParkingTimeLimit();
                    //如果点位位于场站内,则使用场站的限停时间
                    if(null != xpPoint.getStationId()){
                        XpStation xpStation = xpStationClient.getXpStationById(xpPoint.getStationId()).getData();
                        parkingTimeLimit = xpStation.getParkingTimeLimit();
                    }
                    xpOrderHistoryListVO.setEndPointName(xpPoint.getPointName());
                    xpOrderHistoryListVO.setEndLat(xpPoint.getPointLat());
                    xpOrderHistoryListVO.setEndLon(xpPoint.getPointLon());
                    xpOrderHistoryListVO.setXpElectronicFenceAreaId(xpPoint.getElectronicAreaId());
                    xpOrderHistoryListVO.setEndParkingTimeLimit(xpPoint.getParkingTimeLimit());
                    xpOrderHistoryListVO.setEndParkingTimeLimit(parkingTimeLimit);
                }
            }
@@ -2092,6 +2119,12 @@
                // 查询起点点位
                Long startPointId = xpOrder.getStartPointId();
                XpPoint xpPoint = xpPointClient.queryById(startPointId).getData();
                Integer parkingTimeLimit = xpPoint.getParkingTimeLimit();
                //如果点位位于场站内,则使用场站的限停时间
                if(null != xpPoint.getStationId()){
                    XpStation xpStation = xpStationClient.getXpStationById(xpPoint.getStationId()).getData();
                    parkingTimeLimit = xpStation.getParkingTimeLimit();
                }
                // 添加取消订单定时任务job  时间为点位限停时长
                Map<String, ? extends Object> cancelJobMaps =
                        new ImmutableMap.Builder<String, Long>().
@@ -2101,7 +2134,7 @@
                        OrderCancelJob.class,
                        (OrderCancelJob.name + xpOrder.getId()).toUpperCase(),
                        TimeJobType.ORDER_CANCEL,
                        DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(xpPoint.getParkingTimeLimit())),
                        DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(parkingTimeLimit)),
                        cancelJobMaps
                );
                // 车辆到达上车点时间
@@ -2227,6 +2260,12 @@
                // 添加车辆到达终点后限停时间到后驶离的定时任务
                //时间到后将车辆状态回滚到空闲、添加巡游订单,解绑用户和车辆关系,车辆驶离点位
                XpPoint point = xpPointClient.queryById(xpOrder.getEndPointId()).getData();
                Integer parkingTimeLimit2 = point.getParkingTimeLimit();
                //如果点位位于场站内,则使用场站的限停时间
                if(null != point.getStationId()){
                    XpStation xpStation = xpStationClient.getXpStationById(point.getStationId()).getData();
                    parkingTimeLimit2 = xpStation.getParkingTimeLimit();
                }
                Map<String, ? extends Object> jobMaps =
                        new ImmutableMap.Builder<String, String>()
                                .put("id", xpOrder.getId().toString())
@@ -2253,7 +2292,7 @@
                                PushChainReactionOrderJob.class,
                                (PushChainReactionOrderJob.name + id).toUpperCase(),
                                TimeJobType.ADD_CHAIN_REACTION_ORDER_MISSION,
                                DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(point.getParkingTimeLimit())),
                                DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(parkingTimeLimit2)),
                                jobMaps
                        );
                    }
@@ -2263,7 +2302,7 @@
                                AddCruiseMissionJob.class,
                                (AddCruiseMissionJob.name + xpOrder.getId()).toUpperCase(),
                                TimeJobType.ADD_CRUISE_MISSION,
                                DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(point.getParkingTimeLimit())),
                                DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(parkingTimeLimit2)),
                                jobMaps
                        );
                    }
@@ -2272,7 +2311,7 @@
                            AddCruiseMissionJob.class,
                            (AddCruiseMissionJob.name + xpOrder.getId()).toUpperCase(),
                            TimeJobType.ADD_CRUISE_MISSION,
                            DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(point.getParkingTimeLimit())),
                            DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(parkingTimeLimit2)),
                            jobMaps
                    );
                }
@@ -2986,6 +3025,17 @@
        R<XpCruisePlanVehicle> xpCruisePlanR = xpCruisePlanClient.getCruisePlan(vehicle.getId());
        if (xpCruisePlanR == null || xpCruisePlanR.getData() == null) {
            log.info("未找到匹配的巡游计划,无法执行巡游订单 {}", vehicle.getPlateNumber());
            log.info("给车端发送取消行程报文 {}", vehicle.getPlateNumber());
            PushOrderDto cancelDto = new PushOrderDto();
            cancelDto.setStartTaskId(order.getXpuStartTaskId());
            cancelDto.setEndTaskId(order.getXpuEndTaskId());
            cancelDto.setOrderId(order.getId().toString());
            String vin1 = SensitiveDataCryptoUtil.decryptIfPossible(vehicle.getVehicleVin());
            cancelDto.setVin(vin1);
            cancelDto.setOperation_type(OrderOperationType.CLOUD_CANCEL_ORDER);
            cancelDto.setCancelScene(CancelOrderSceneEnum.REASSIGN_OLD_VEHICLE.getCode());
            orderMissionClient.cancelOrder(cancelDto);
            return;
        }
        String vin = SensitiveDataCryptoUtil.decryptIfPossible(vehicle.getVehicleVin());
@@ -3361,109 +3411,109 @@
    public R payment(XpOrderPayDto dto, String uid) {
        XpOrder order = this.getById(dto.getOrderId());
        HashMap<String, Object> resultMap = new HashMap<>();
        // 1.0 免密  //查询是否开通免密
        // 1先查用户是否申请  申请了拿到通过的businessOrderId
        boolean signed = false;
        CreditPaySignQueryDto creditPaySignQueryDto = new CreditPaySignQueryDto();
        creditPaySignQueryDto.setUid(Long.valueOf(uid));
        creditPaySignQueryDto.setBusinessId("xp-robotaxi");
        creditPaySignQueryDto.setCategory("009001");
        creditPaySignQueryDto.setBusinessOrderId(OrderCodeUtil.getOrderCode("MMZF"));
        R<CreditPaySignQueryVo> creditPaySignQueryVoR = xpPayFrontClient.queryCreditPaySign(creditPaySignQueryDto);
        if (creditPaySignQueryVoR.getCode()==200) {
            CreditPaySignQueryVo data = creditPaySignQueryVoR.getData();
            // 查看是否有签约的
            long count = data.getSignList().stream().filter(e -> e.getStatus().equals("VALID")).count();
            if (count > 0){
                signed = true;
            }
        }
        if(signed){
            // y已签约 1.信用下单
            CreditOrderCreateDto creditOrderCreateDto = new CreditOrderCreateDto();
            creditOrderCreateDto.setUid(Long.valueOf(uid));
            creditOrderCreateDto.setBusinessId("xp-robotaxi");
            creditOrderCreateDto.setCategory("009001");
            creditOrderCreateDto.setBusinessOrderId("");
            creditOrderCreateDto.setSubject("小鹏集团|robotaxi");
            creditOrderCreateDto.setPayType("13");
            // 信用下单
            ArrayList<CreditOrderCreateDto.PostPayment> postPayments = new ArrayList<>(1);
            CreditOrderCreateDto.PostPayment postPayment = new CreditOrderCreateDto.PostPayment();
            postPayment.setName("收费标准");
            postPayment.setDescription("行程价格动态浮动,具体详情可在费用详情或计价规则查看");
            postPayments.add(postPayment);
            creditOrderCreateDto.setPostPayments(postPayments);
            R<CreditOrderCreateVo> creditOrderCreateVoR = xpPayFrontClient.createCreditOrder(creditOrderCreateDto);
            if(creditOrderCreateVoR.getCode()==200){
                CreditOrderCreateVo data = creditOrderCreateVoR.getData();
                resultMap.put("status", 1);
                resultMap.put("value", data);
                order.setPayType(3);
                order.setAuthOrderId(data.getAuthOrderId());
                return R.ok(resultMap);
            }
        }else {
            // 未签约
            // 调用预下单接口
            CreditPrecreateDto creditPrecreateDto = new CreditPrecreateDto();
            creditPrecreateDto.setUid(uid);
            creditPrecreateDto.setBizId("xp-robotaxi");
            creditPrecreateDto.setBizOrderId("");
            creditPrecreateDto.setPayScene(99);
            creditPrecreateDto.setAmount(order.getOrderMoney().multiply(new BigDecimal(100)).intValue());
            creditPrecreateDto.setCategory("009001");
            creditPrecreateDto.setTitle("信用下单");
            creditPrecreateDto.setDetail("信用下单");
            HashMap<String, String> businessExtend = new HashMap<>();
            businessExtend.put("returnUrl", "");
            businessExtend.put("notifyUrl", "");
            creditPrecreateDto.setBusinessExtend(businessExtend);
            R<CreditPrecreateVo> creditPrecreateVoR = xpPayFrontClient.precreate(creditPrecreateDto);
            if (creditPrecreateVoR.getCode()==200) {
                CreditPrecreateVo data = creditPrecreateVoR.getData();
                resultMap.put("status", 2);
                resultMap.put("value", data);
                return R.ok(resultMap);
            }
        }
//        XpOrder order = this.getById(dto.getOrderId());
//
//        HashMap<String, Object> resultMap = new HashMap<>();
//
//        // 1.0 免密  //查询是否开通免密
//        // 1先查用户是否申请  申请了拿到通过的businessOrderId
//        boolean signed = false;
//        CreditPaySignQueryDto creditPaySignQueryDto = new CreditPaySignQueryDto();
//        creditPaySignQueryDto.setUid(Long.valueOf(uid));
//        creditPaySignQueryDto.setBusinessId("xp-robotaxi");
//        creditPaySignQueryDto.setCategory("009001");
//        creditPaySignQueryDto.setBusinessOrderId(OrderCodeUtil.getOrderCode("MMZF"));
//        R<CreditPaySignQueryVo> creditPaySignQueryVoR = xpPayFrontClient.queryCreditPaySign(creditPaySignQueryDto);
//        if (creditPaySignQueryVoR.getCode()==200) {
//            CreditPaySignQueryVo data = creditPaySignQueryVoR.getData();
//            // 查看是否有签约的
//            long count = data.getSignList().stream().filter(e -> e.getStatus().equals("VALID")).count();
//            if (count > 0){
//                signed = true;
//            }
//        }
//
//
//        if(signed){
//            // y已签约 1.信用下单
//            CreditOrderCreateDto creditOrderCreateDto = new CreditOrderCreateDto();
//            creditOrderCreateDto.setUid(Long.valueOf(uid));
//            creditOrderCreateDto.setBusinessId("xp-robotaxi");
//            creditOrderCreateDto.setCategory("009001");
//            creditOrderCreateDto.setBusinessOrderId("");
//            creditOrderCreateDto.setSubject("小鹏集团|robotaxi");
//            creditOrderCreateDto.setPayType("13");
//
//
//            // 信用下单
//            ArrayList<CreditOrderCreateDto.PostPayment> postPayments = new ArrayList<>(1);
//            CreditOrderCreateDto.PostPayment postPayment = new CreditOrderCreateDto.PostPayment();
//            postPayment.setName("收费标准");
//            postPayment.setDescription("行程价格动态浮动,具体详情可在费用详情或计价规则查看");
//            postPayments.add(postPayment);
//            creditOrderCreateDto.setPostPayments(postPayments);
//            R<CreditOrderCreateVo> creditOrderCreateVoR = xpPayFrontClient.createCreditOrder(creditOrderCreateDto);
//            if(creditOrderCreateVoR.getCode()==200){
//                CreditOrderCreateVo data = creditOrderCreateVoR.getData();
//                resultMap.put("status", 1);
//                resultMap.put("value", data);
//
//                order.setPayType(3);
//                order.setAuthOrderId(data.getAuthOrderId());
//
//                return R.ok(resultMap);
//            }
//
//        }else {
//
//            // 未签约
//            // 调用预下单接口
//            CreditPrecreateDto creditPrecreateDto = new CreditPrecreateDto();
//            creditPrecreateDto.setUid(uid);
//            creditPrecreateDto.setBizId("xp-robotaxi");
//            creditPrecreateDto.setBizOrderId("");
//            creditPrecreateDto.setPayScene(99);
//            creditPrecreateDto.setAmount(order.getOrderMoney().multiply(new BigDecimal(100)).intValue());
//            creditPrecreateDto.setCategory("009001");
//            creditPrecreateDto.setTitle("信用下单");
//            creditPrecreateDto.setDetail("信用下单");
//
//            HashMap<String, String> businessExtend = new HashMap<>();
//            businessExtend.put("returnUrl", "");
//            businessExtend.put("notifyUrl", "");
//            creditPrecreateDto.setBusinessExtend(businessExtend);
//
//            R<CreditPrecreateVo> creditPrecreateVoR = xpPayFrontClient.precreate(creditPrecreateDto);
//            if (creditPrecreateVoR.getCode()==200) {
//                CreditPrecreateVo data = creditPrecreateVoR.getData();
//                resultMap.put("status", 2);
//                resultMap.put("value", data);
//                return R.ok(resultMap);
//            }
//        }
        // mvp版本不做支付 使用优惠券抵扣为0元订单处理 处理订单状态即可
//        XpOrder order = this.getById(dto.getOrderId());
//        order.setStatus(9);
//        order.setAppUserId(null);
//        if (order.getCouponId() != null) {
//            UseUserCouponDto useUserCouponDto = new UseUserCouponDto();
//            useUserCouponDto.setUserCouponId(order.getCouponId());
//            R<BigDecimal> decimalR = xpAppUserCouponClient.useUserCoupon(useUserCouponDto);
//            if (decimalR.getCode() == 200) {
//                order.setCouponMoney(decimalR.getData());
//                if (order.getCouponMoney().compareTo(order.getOrderMoney()) > 0) {
//                    order.setPayMoney(BigDecimal.ZERO);
//                    order.setCouponMoney(order.getOrderMoney());
//                } else {
//                    order.setPayMoney(order.getOrderMoney().subtract(decimalR.getData()));
//                }
//            }
//        }
//        baseMapper.updateById(order);
//        bootCommonService.setCache_orderStatus(order.getId(), order, null);
        XpOrder order = this.getById(dto.getOrderId());
        order.setStatus(9);
        order.setAppUserId(null);
        if (order.getCouponId() != null) {
            UseUserCouponDto useUserCouponDto = new UseUserCouponDto();
            useUserCouponDto.setUserCouponId(order.getCouponId());
            R<BigDecimal> decimalR = xpAppUserCouponClient.useUserCoupon(useUserCouponDto);
            if (decimalR.getCode() == 200) {
                order.setCouponMoney(decimalR.getData());
                if (order.getCouponMoney().compareTo(order.getOrderMoney()) > 0) {
                    order.setPayMoney(BigDecimal.ZERO);
                    order.setCouponMoney(order.getOrderMoney());
                } else {
                    order.setPayMoney(order.getOrderMoney().subtract(decimalR.getData()));
                }
            }
        }
        baseMapper.updateById(order);
        bootCommonService.setCache_orderStatus(order.getId(), order, null);
        return R.fail();
    }
@@ -3848,9 +3898,22 @@
                Object cacheObject = redisService.getCacheObject("ORDER_NAVIGATION_END_DATA:" + appUserId);
                RouteVo routeVo1 = JSON.parseObject(cacheObject.toString(), RouteVo.class);
                XpPoint endPoint = xpPointClient.queryById(order.getEndPointId()).getData();
                LocalDateTime localDateTime = order.getAcceptanceTime().plusMinutes(routeVo.getDuration()).plusMinutes(startPoint.getParkingTimeLimit())
                        .plusMinutes(routeVo1.getDuration()).plusMinutes(endPoint.getParkingTimeLimit()).plusMinutes(30);
                long expirationTime = localDateTime.toEpochSecond(ZoneOffset.of("+8"));
                Integer parkingTimeLimit = startPoint.getParkingTimeLimit();
                //如果点位位于场站内,则使用场站的限停时间
                if(null != startPoint.getStationId()){
                    XpStation xpStation = xpStationClient.getXpStationById(startPoint.getStationId()).getData();
                    parkingTimeLimit = xpStation.getParkingTimeLimit();
                }
                Integer parkingTimeLimit1 = endPoint.getParkingTimeLimit();
                //如果点位位于场站内,则使用场站的限停时间
                if(null != endPoint.getStationId()){
                    XpStation xpStation = xpStationClient.getXpStationById(endPoint.getStationId()).getData();
                    parkingTimeLimit1 = xpStation.getParkingTimeLimit();
                }
                LocalDateTime localDateTime = order.getAcceptanceTime().plusSeconds(routeVo.getDuration()).plusMinutes(parkingTimeLimit)
                        .plusSeconds(routeVo1.getDuration()).plusMinutes(parkingTimeLimit1).plusMinutes(30);
                long expirationTime = localDateTime.toEpochSecond(ZoneOffset.of("+8")) * 1000;
                //生成token
                String token = bluetoothUnlockTokenUtil.generateBluetoothUnlockToken(order.getAppUserId(),
                        order.getId(), order.getVehicleId(), expirationTime);
@@ -3873,10 +3936,11 @@
                vo.setVin(vin);
                vo.setPassengerUid(order.getAppUserId());
                BaseVehicleUserDto deliver = bluetoothUnlockClient.deliver(vo);
                log.info("下发蓝牙token结果:{}", JSON.toJSONString(deliver));
                if(null == deliver){
                    throw new ServiceException("下发蓝牙token失败");
                }
                if(deliver.getCode() != 0){
                if(200 != deliver.getCode()){
                    log.error("下发蓝牙token失败:{} {}", deliver.getMsg(), order.getOrderNumber());
                    throw new ServiceException(deliver.getMsg());
                }
@@ -4036,13 +4100,25 @@
        R<XpPoint> xpPointR = xpPointClient.queryById(xpOrder.getStartPointId());
        if (xpPointR.getCode() == R.SUCCESS) {
            XpPoint startPoint = xpPointR.getData();
            xpOrderDetailVO.setStartParkingTimeLimit(startPoint.getParkingTimeLimit());
            Integer parkingTimeLimit = startPoint.getParkingTimeLimit();
            //如果点位位于场站内,则使用场站的限停时间
            if(null != startPoint.getStationId()){
                XpStation xpStation = xpStationClient.getXpStationById(startPoint.getStationId()).getData();
                parkingTimeLimit = xpStation.getParkingTimeLimit();
            }
            xpOrderDetailVO.setStartParkingTimeLimit(parkingTimeLimit);
        }
        R<XpPoint> xpPointR1 = xpPointClient.queryById(xpOrder.getEndPointId());
        if (xpPointR1.getCode() == R.SUCCESS) {
            XpPoint endPoint = xpPointR1.getData();
            xpOrderDetailVO.setEndParkingTimeLimit(endPoint.getParkingTimeLimit());
            Integer parkingTimeLimit = endPoint.getParkingTimeLimit();
            //如果点位位于场站内,则使用场站的限停时间
            if(null != endPoint.getStationId()){
                XpStation xpStation = xpStationClient.getXpStationById(endPoint.getStationId()).getData();
                parkingTimeLimit = xpStation.getParkingTimeLimit();
            }
            xpOrderDetailVO.setEndParkingTimeLimit(parkingTimeLimit);
        }
//        // 算时间
//        if (xpOrder.getStatus() == 1) {
@@ -4477,6 +4553,12 @@
                // 查询起点点位
                Long startPointId = xpOrder.getStartPointId();
                XpPoint xpPoint = xpPointClient.queryById(startPointId).getData();
                Integer parkingTimeLimit = xpPoint.getParkingTimeLimit();
                //如果点位位于场站内,则使用场站的限停时间
                if(null != xpPoint.getStationId()){
                    XpStation xpStation = xpStationClient.getXpStationById(xpPoint.getStationId()).getData();
                    parkingTimeLimit = xpStation.getParkingTimeLimit();
                }
                // 添加取消订单定时任务job  时间为点位限停时长
                Map<String, ? extends Object> cancelJobMaps =
                        new ImmutableMap.Builder<String, Long>().
@@ -4486,7 +4568,7 @@
                        OrderCancelJob.class,
                        (OrderCancelJob.name + xpOrder.getId()).toUpperCase(),
                        TimeJobType.ORDER_CANCEL,
                        DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(xpPoint.getParkingTimeLimit())),
                        DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(parkingTimeLimit)),
                        cancelJobMaps
                );
@@ -4637,6 +4719,12 @@
                // 添加车辆到达终点后限停时间到后驶离的定时任务
                //时间到后将车辆状态回滚到空闲、添加巡游订单,解绑用户和车辆关系,车辆驶离点位
                XpPoint point = xpPointClient.queryById(xpOrder.getEndPointId()).getData();
                Integer parkingTimeLimit1 = point.getParkingTimeLimit();
                //如果点位位于场站内,则使用场站的限停时间
                if(null != point.getStationId()){
                    XpStation xpStation = xpStationClient.getXpStationById(point.getStationId()).getData();
                    parkingTimeLimit1 = xpStation.getParkingTimeLimit();
                }
                Map<String, ? extends Object> jobMaps =
                        new ImmutableMap.Builder<String, String>()
                                .put("id", xpOrder.getId().toString())
@@ -4660,7 +4748,7 @@
                            PushChainReactionOrderJob.class,
                            (PushChainReactionOrderJob.name + id).toUpperCase(),
                            TimeJobType.ADD_CHAIN_REACTION_ORDER_MISSION,
                            DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(point.getParkingTimeLimit())),
                            DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(parkingTimeLimit1)),
                            jobMaps
                    );
                } else {
@@ -4668,7 +4756,7 @@
                            AddCruiseMissionJob.class,
                            (AddCruiseMissionJob.name + xpOrder.getId()).toUpperCase(),
                            TimeJobType.ADD_CRUISE_MISSION,
                            DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(point.getParkingTimeLimit())),
                            DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(parkingTimeLimit1)),
                            jobMaps
                    );
                }
xp-robotaxi-vehicle-convoy-boot/src/main/java/com/xiaopeng/vehicleConvoy/config/MiniprogramConfigurer.java
@@ -10,7 +10,7 @@
import javax.annotation.Resource;
@Slf4j
//@Configuration
@Configuration
public class MiniprogramConfigurer extends WebMvcConfigurerAdapter {
    @Resource
xp-robotaxi-vehicle-convoy-boot/src/main/resources/mapper/vehicleConvoy/XpVehicleMapper.xml
@@ -122,7 +122,7 @@
                </foreach>
            </if>
            <if test="query.electronicId != null and query.electronicId != ''">
                    AND a.electronic_id #{query.electronicId}
                    AND a.electronic_id = #{query.electronicId}
                </if>
            <if test="query.electronicIdList != null and query.electronicIdList.size()>0">
                AND a.electronic_id in