luodangjia
2024-11-04 e0fc8f7e2230b51e3bbe8dea43790cf11b7170e9
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -197,6 +197,7 @@
                payOrderInfoDto.setPayTime(byId.getCreateTime());
                payOrderInfoDto.setRefundAmount(byId.getRefundAmount());
                payOrderInfoDto.setRechargeAmount(byId.getRechargeAmount());
                payOrderInfoDto.setFinalAmount(byId.getRechargeAmount().subtract(byId.getRefundAmount()));
                return R.ok(payOrderInfoDto);
            case 2:
                TShoppingOrder byId1 = shoppingOrderService.getById(orderId);
@@ -209,6 +210,7 @@
                payOrderInfoDto1.setPayTime(byId1.getCreateTime());
                payOrderInfoDto1.setRefundAmount(byId1.getRefundAmount());
                payOrderInfoDto1.setRechargeAmount(byId1.getPaymentAmount());
                payOrderInfoDto1.setFinalAmount(byId1.getPaymentAmount().subtract(byId1.getRefundAmount()));
                return R.ok(payOrderInfoDto1);
            case 3:
                TVipOrder byId2 = vipOrderService.getById(orderId);
@@ -221,6 +223,7 @@
                payOrderInfoDto2.setPayTime(byId2.getCreateTime());
                payOrderInfoDto2.setRefundAmount(byId2.getRefundAmount());
                payOrderInfoDto2.setRechargeAmount(byId2.getPaymentAmount());
                payOrderInfoDto2.setFinalAmount(byId2.getPaymentAmount().subtract(byId2.getRefundAmount()));
                return R.ok(payOrderInfoDto2);
            //todo luo 停车场订单
//                case 4:
@@ -365,17 +368,17 @@
            }
        }
        // 时段总服务费
        BigDecimal bigDecimal = new BigDecimal("0");
        List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, strategyId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        for (TChargingOrderAccountingStrategy tChargingOrderAccountingStrategy : list) {
            String format = tChargingOrderAccountingStrategy.getCreateTime().format(formatter);
            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);
            }
            bigDecimal = bigDecimal.add(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice());
            if (byId.getCouponDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){
                BigDecimal multiply = byId.getCouponDiscountAmount().divide(byId.getServiceCharge(), 2)
                        .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice());
@@ -1278,11 +1281,13 @@
            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);
        if (carBrandMap.size()>=5) {
            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();
@@ -1849,8 +1854,8 @@
        EndOfChargePageInfo endOfChargePageInfo = chargingOrderService.getEndOfChargePageInfo(id);
        return AjaxResult.success(endOfChargePageInfo);
    }
    /**
     * 获取订单数据
     * @param order