puzhibing
2026-04-30 274422a2d5cbb8f4518c29cc1748a805f8d9a00b
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/service/impl/XpOrderServiceImpl.java
@@ -2136,18 +2136,6 @@
                                .put("orderType", OrderType.USER_ORDER)
                                .build();
                //如果是异常订单,需要定时创建客服工单
                if(orderException){
                    XpSystemSetting xpSystemSetting = xpSystemSettingClient.getSystemSettingOne().getData();
                    QuartzManager.addJob(
                            OrderExceptionJob.class,
                            (OrderExceptionJob.name + xpOrder.getId()).toUpperCase(),
                            TimeJobType.ADD_CRUISE_MISSION,
                            DateUtils.localDateTimeToDate(LocalDateTime.now().plusMinutes(xpSystemSetting.getOrderExceptionalTimeout())),
                            jobMaps
                    );
                }
                //判断是否有连环单
                String json = redisService.getCacheObject(CacheConstants.nextOrder(xpOrder.getId().toString()));
                if (StringUtils.isNotEmpty(json)){
@@ -2284,19 +2272,19 @@
        order.setAppUserId(appUserId);
        bootCommonService.setCache_orderStatus(order.getId(),order,null);
        //删除蓝牙秘钥
        String token = redisService.getCacheObject("rt:bluetooth:unlock:order:" + orderId);
        if(StringUtils.isNotBlank(token)){
            redisService.deleteObject("rt:bluetooth:unlock:" + token);
            redisService.deleteObject("rt:bluetooth:unlock:order:" + orderId);
            XpVehicle xpVehicle = xpVehicleClient.queryById(order.getVehicleId()).getData();
            BluetoothDeliverVo vo = new BluetoothDeliverVo();
            vo.setVim(xpVehicle.getVehicleVin());
            vo.setPassengerUid(order.getAppUserId());
            BaseVehicleUserDto delete = bluetoothUnlockClient.delete(vo);
            if(null == delete || delete.getCode() != 0){
                log.error("删除蓝牙解锁失败:{} {}", delete.getMsg(), order.getOrderNumber());
            }
        }
//        String token = redisService.getCacheObject("rt:bluetooth:unlock:order:" + orderId);
//        if(StringUtils.isNotBlank(token)){
//            redisService.deleteObject("rt:bluetooth:unlock:" + token);
//            redisService.deleteObject("rt:bluetooth:unlock:order:" + orderId);
//            XpVehicle xpVehicle = xpVehicleClient.queryById(order.getVehicleId()).getData();
//            BluetoothDeliverVo vo = new BluetoothDeliverVo();
//            vo.setVim(xpVehicle.getVehicleVin());
//            vo.setPassengerUid(order.getAppUserId());
//            BaseVehicleUserDto delete = bluetoothUnlockClient.delete(vo);
//            if(null == delete || delete.getCode() != 0){
//                log.error("删除蓝牙解锁失败:{} {}", delete.getMsg(), order.getOrderNumber());
//            }
//        }
        // 根据订单所属开通城市id 查询定价
        XpPricing pricing = bootCommonService.getXpPricing(order.getCityId(),order.getVehicleId());
@@ -2353,12 +2341,15 @@
            xpOrderDetail.setType(1);
            xpOrderDetail.setMoney(new BigDecimal(xpPricingCardVo.getDistancePrice()).setScale(2,RoundingMode.HALF_UP));
            xpOrderDetails.add(xpOrderDetail);
            xpOrderDetail = new XpOrderDetail();
            xpOrderDetail.setDetailType(3);
            xpOrderDetail.setOrderId(orderId);
            xpOrderDetail.setType(1);
            xpOrderDetail.setMoney(new BigDecimal(xpPricingCardVo.getDurationPrice()).setScale(2, RoundingMode.HALF_UP));
            xpOrderDetails.add(xpOrderDetail);
            //时长费不是必填项
            if(null != xpPricingCardVo.getDurationPrice() && xpPricingCardVo.getDurationPrice() > 0){
                xpOrderDetail = new XpOrderDetail();
                xpOrderDetail.setDetailType(3);
                xpOrderDetail.setOrderId(orderId);
                xpOrderDetail.setType(1);
                xpOrderDetail.setMoney(new BigDecimal(xpPricingCardVo.getDurationPrice()).setScale(2, RoundingMode.HALF_UP));
                xpOrderDetails.add(xpOrderDetail);
            }
            BigDecimal totalPrice =BigDecimal.ZERO;
            for (XpOrderDetail xpOrderDetail1 : xpOrderDetails) {
@@ -2372,7 +2363,6 @@
        else {
            //动态计费
            if (pricing.getPricingType() == 1) {
                for (int i = 0; i < startingFareJsonArray.size(); i++) {
                    com.alibaba.fastjson2.JSONObject jsonObject = startingFareJsonArray.getJSONObject(i);
                    String num1 = jsonObject.getString("num1");
@@ -2465,6 +2455,8 @@
                            redisService.setCacheObject("USER_DYNAMIC_PRICE_" + order.getCityId() + "_" + uid, priceRate, time.longValue(), TimeUnit.MINUTES);
                        }
                        //天气预报动态调价
                    }
                }