xuhy
2026-03-15 d4ec5b4db43cf4a9bf6f70ddf04fe3badb6cf6c0
计费修改
3个文件已修改
127 ■■■■■ 已修改文件
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpTaskServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/utils/TaxiPricingDemoService.java 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/AliPushUtil.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpTaskServiceImpl.java
@@ -176,11 +176,11 @@
        PageInfo<TaskPageListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TaskPageListVO> list = this.baseMapper.pageList(pageInfo, query);
        XpTaskRule xpTaskRule = xpTaskRuleMapper.selectOne(new LambdaQueryWrapper<XpTaskRule>().last("limit 1"));
//        if (Objects.nonNull(xpTaskRule)) {
//            list.stream().filter(item -> item.getTaskCategory().equals(2)).forEach(item -> {
//                item.setCanArriveRange(xpTaskRule.getCanArriveRange());
//            });
//        }
        if (Objects.nonNull(xpTaskRule)) {
            list.stream().filter(item -> item.getTaskCategory().equals(2)).forEach(item -> {
                item.setCanArriveRange(xpTaskRule.getCanArriveRange());
            });
        }
        pageInfo.setRecords(list);
        return pageInfo;
    }
@@ -815,10 +815,10 @@
        res.setTaskCategory(task.getTaskCategory());
        res.setTaskTypeId(task.getTaskTypeId());
        res.setStatus(task.getStatus());
        res.setHandleTime(task.getHandleTime());
        XpVehicleClean vehicleDetection = vehicleCleanMapper.selectOne(new LambdaQueryWrapper<XpVehicleClean>()
                .eq(XpVehicleClean::getTaskId, id).last("limit 1"));
        if (vehicleDetection != null) {
            res.setHandleTime(vehicleDetection.getCreateTime());
            res.setTaskImage(vehicleDetection.getTaskImage());
            res.setOperationUserId(vehicleDetection.getOperationsUserId());
            if (vehicleDetection.getOperationsUserId() != null) {
xp-robotaxi-order-boot/src/main/java/com/xiaopeng/order/utils/TaxiPricingDemoService.java
@@ -20,9 +20,9 @@
        Date orderTime = new Date();
//
        // 模拟总里程 25.0 km,以触发多级远途加价
        double totalMillige = 1.24;
        double totalMillige = 8.946;
        Calendar cal = Calendar.getInstance();
        cal.set(2026, Calendar.APRIL, 11, 15, 48, 50);
        cal.set(2026, Calendar.APRIL, 15, 22, 4, 50);
        orderTime = cal.getTime();
        // 模拟 GPS 轨迹点
        List<GpsPoint> points = createMockGpsPoints(orderTime);
@@ -142,9 +142,9 @@
                }
            }
            // 2. 远途加价计算 (基于区间判定)
            BigDecimal longExtra = calculateLongDistExtra(BigDecimal.valueOf(totalMileageKm), config.longSteps);
            BigDecimal longExtra = calculateLongDistExtra(BigDecimal.valueOf(totalMileageKm).subtract(remainBaseM.divide(new BigDecimal(1000))), config.longSteps);
            // 计算远途里程
            BigDecimal longExtraValue = calculateLongDistExtra(BigDecimal.valueOf(totalMileageKm), config.longSteps);
            BigDecimal longExtraValue = calculateLongDistExtra(BigDecimal.valueOf(totalMileageKm).subtract(remainBaseM.divide(new BigDecimal(1000))), config.longSteps);
            result.put("远途费&"+longExtraValue, longExtra);
            return formatMap(result);
        }
@@ -158,16 +158,29 @@
            // 当前点所在的公里数
            BigDecimal extraStart = BigDecimal.ZERO;
            BigDecimal extraRate = BigDecimal.ZERO;
            BigDecimal totalExtra = BigDecimal.ZERO;
            BigDecimal remainingDistance = billM;
            // 匹配区间规则
            // 分段累进计费
            for (LongRangeStep step : steps) {
                if (step.isMatch(billM)) {
                    extraRate = step.addPrice;
                    extraStart = step.numStart;
               if (remainingDistance.compareTo(BigDecimal.ZERO) <= 0) {
                    break;
                }
               // 计算当前区间的宽度
               BigDecimal rangeWidth = step.numEnd.subtract(step.numStart);
               // 计算在当前区间应计费的距离
               BigDecimal distanceInThisRange = remainingDistance.min(rangeWidth);
               // 如果还有剩余距离需要计入当前区间
               if (distanceInThisRange.compareTo(BigDecimal.ZERO) > 0) {
                   totalExtra = totalExtra.add(distanceInThisRange.multiply(step.addPrice));
                   remainingDistance = remainingDistance.subtract(distanceInThisRange);
            }
            return billM.subtract(extraStart).multiply(extraRate);
            }
            return totalExtra;
        }
        /**
         * 计算远途费的里程
@@ -293,48 +306,48 @@
        list.add(new GpsPoint(188, startTs + 2 * 50 * 1000));
        list.add(new GpsPoint(150, startTs + 2 * 60 * 1000));
        list.add(new GpsPoint(126, startTs + 2 * 70 * 1000));
//        list.add(new GpsPoint(138, startTs + 2 * 80 * 1000));
//        list.add(new GpsPoint(119, startTs + 2 * 90 * 1000));
//        list.add(new GpsPoint(147, startTs + 2 * 100 * 1000));
//        list.add(new GpsPoint(155, startTs + 2 * 110 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 120 * 1000));
//        list.add(new GpsPoint(172, startTs + 2 * 130 * 1000));
//        list.add(new GpsPoint(202, startTs + 2 * 140 * 1000));
//        list.add(new GpsPoint(162, startTs + 2 * 150 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 160 * 1000));
//        list.add(new GpsPoint(132, startTs + 2 * 170 * 1000));
//        list.add(new GpsPoint(122, startTs + 2 * 180 * 1000));
//        list.add(new GpsPoint(262, startTs + 2 * 190 * 1000));
//        list.add(new GpsPoint(242, startTs + 2 * 200 * 1000));
//        list.add(new GpsPoint(282, startTs + 2 * 210 * 1000));
//        list.add(new GpsPoint(222, startTs + 2 * 220 * 1000));
//        list.add(new GpsPoint(212, startTs + 2 * 230 * 1000));
//        list.add(new GpsPoint(142, startTs + 2 * 240 * 1000));
//        list.add(new GpsPoint(262, startTs + 2 * 250 * 1000));
//        list.add(new GpsPoint(169, startTs + 2 * 260 * 1000));
//        list.add(new GpsPoint(170, startTs + 2 * 270 * 1000));
//        list.add(new GpsPoint(180, startTs + 2 * 280 * 1000));
//        list.add(new GpsPoint(165, startTs + 2 * 290 * 1000));
//        list.add(new GpsPoint(180, startTs + 2 * 300 * 1000));
//        list.add(new GpsPoint(198, startTs + 2 * 310 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 320 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 330 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 340 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 350 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 360 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 370 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 380 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 390 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 400 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 410 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 420 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 430 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 440 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 450 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 460 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 470 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 490 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 500 * 1000));
        list.add(new GpsPoint(138, startTs + 2 * 80 * 1000));
        list.add(new GpsPoint(119, startTs + 2 * 90 * 1000));
        list.add(new GpsPoint(147, startTs + 2 * 100 * 1000));
        list.add(new GpsPoint(155, startTs + 2 * 110 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 120 * 1000));
        list.add(new GpsPoint(172, startTs + 2 * 130 * 1000));
        list.add(new GpsPoint(202, startTs + 2 * 140 * 1000));
        list.add(new GpsPoint(162, startTs + 2 * 150 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 160 * 1000));
        list.add(new GpsPoint(132, startTs + 2 * 170 * 1000));
        list.add(new GpsPoint(122, startTs + 2 * 180 * 1000));
        list.add(new GpsPoint(262, startTs + 2 * 190 * 1000));
        list.add(new GpsPoint(242, startTs + 2 * 200 * 1000));
        list.add(new GpsPoint(282, startTs + 2 * 210 * 1000));
        list.add(new GpsPoint(222, startTs + 2 * 220 * 1000));
        list.add(new GpsPoint(212, startTs + 2 * 230 * 1000));
        list.add(new GpsPoint(142, startTs + 2 * 240 * 1000));
        list.add(new GpsPoint(262, startTs + 2 * 250 * 1000));
        list.add(new GpsPoint(169, startTs + 2 * 260 * 1000));
        list.add(new GpsPoint(170, startTs + 2 * 270 * 1000));
        list.add(new GpsPoint(180, startTs + 2 * 280 * 1000));
        list.add(new GpsPoint(165, startTs + 2 * 290 * 1000));
        list.add(new GpsPoint(180, startTs + 2 * 300 * 1000));
        list.add(new GpsPoint(198, startTs + 2 * 310 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 320 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 330 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 340 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 350 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 360 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 370 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 380 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 390 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 400 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 410 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 420 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 430 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 440 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 450 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 460 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 470 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 490 * 1000));
        list.add(new GpsPoint(182, startTs + 2 * 500 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 510 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 520 * 1000));
//        list.add(new GpsPoint(182, startTs + 2 * 530 * 1000));
xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/AliPushUtil.java
@@ -104,7 +104,7 @@
                        .targetValue(account)
                        .title(title)
                        .body(content)
//                        .androidExtParameters(body)
                        .androidExtParameters(body)
                        .androidNotificationChannel(channelIds)
                        .build();
                if(deviceType == 2){