Pu Zhibing
2026-01-19 cf381adf7831c80feedd25cf9392e0f3dfbe46f6
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -357,17 +357,12 @@
        payOrderChargingInfo.setChargingName(data1.getName());
        TChargingGun data2 = chargingGunClient.getChargingGunById(byId.getChargingGunId()).getData();
        payOrderChargingInfo.setGunName(data2.getName());
        if (byId.getAppUserCarId()!=null) {
            List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData();
            payOrderChargingInfo.setCarNum(data3.get(0).getLicensePlate());
        }else{
            payOrderChargingInfo.setCarNum(byId.getPlateNum());
        }
        payOrderChargingInfo.setCarNum(byId.getPlateNum());
        payOrderChargingInfo.setTChargingOrder(byId);
        Long count = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, orderId).count();
        payOrderChargingInfo.setPeriodCount(count);
        if (byId.getAppUserCarId()!=null) {
        if (byId.getAppUserCarId()!=null && 0 != byId.getAppUserCarId()) {
            List<Long> carid = new ArrayList<>();
            carid.add(byId.getAppUserCarId());
            R<List<TAppUserCar>> carByIds = appUserCarClient.getCarByIds(carid);
@@ -565,15 +560,18 @@
            }
            tChargingOrderAccountingStrategy.setStartTime(format+" "+tChargingOrderAccountingStrategy.getStartTime());
            tChargingOrderAccountingStrategy.setEndTime(format+" "+tChargingOrderAccountingStrategy.getEndTime());
            if (byId.getVipDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){
                BigDecimal multiply = byId.getVipDiscountAmount().divide(byId.getServiceCharge(), 2)
                        .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice());
                tChargingOrderAccountingStrategy.setVipDiscount(multiply);
            }
            if (byId.getCouponDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){
                BigDecimal multiply = byId.getCouponDiscountAmount().divide(byId.getServiceCharge(), 2)
                        .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice());
                tChargingOrderAccountingStrategy.setCouponDiscount(multiply);
//            if (byId.getVipDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){
//                BigDecimal multiply = byId.getVipDiscountAmount().divide(byId.getServiceCharge(), 2)
//                        .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice());
//                tChargingOrderAccountingStrategy.setVipDiscount(multiply);
//            }
//            if (byId.getCouponDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){
//                BigDecimal multiply = byId.getCouponDiscountAmount().divide(byId.getServiceCharge(), 2)
//                        .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice());
//                tChargingOrderAccountingStrategy.setCouponDiscount(multiply);
//            }
            if(null == tChargingOrderAccountingStrategy.getCouponDiscount()){
                tChargingOrderAccountingStrategy.setCouponDiscount(BigDecimal.ZERO);
            }
        }
        //从新排序