From d1d7df6417a76d481e654c96b2db34e4fbab88ea Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 31 十月 2024 15:53:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java index fbc1d7f..e3ab58d 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java @@ -369,14 +369,14 @@ List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, strategyId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); for (TChargingOrderAccountingStrategy tChargingOrderAccountingStrategy : list) { - if (byId.getVipDiscountAmount()!=null){ + if (byId.getVipDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){ BigDecimal multiply = byId.getVipDiscountAmount().divide(byId.getServiceCharge(), 2) .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); tChargingOrderAccountingStrategy.setVipDiscount(multiply); } bigDecimal = bigDecimal.add(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); - if (byId.getCouponDiscountAmount()!=null){ + if (byId.getCouponDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){ BigDecimal multiply = byId.getCouponDiscountAmount().divide(byId.getServiceCharge(), 2) .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); tChargingOrderAccountingStrategy.setCouponDiscount(multiply); @@ -1262,8 +1262,19 @@ //车辆用途 List<Map<String, Object>> carMap = chargingOrderService.carUserMethod(); + //车辆品牌 List<Map<String, Object>> carBrandMap = chargingOrderService.carUserBrand(); + List<String> brands = new ArrayList<>(); + for (Map<String, Object> objectMap : carBrandMap) { + brands.add(objectMap.get("vehicle_brand").toString()); + } + + Long count = chargingOrderService.countCar(brands); + Map<String, Object> others = new HashMap<>(); + others.put("vehicle_brand","其他"); + others.put("counts",count); + carBrandMap.add(others); //本地车数量 Map<String,Object> localCarMap = chargingOrderService.countLocalCar(); -- Gitblit v1.7.1