Pu Zhibing
2025-03-06 1b81b84edaeea9b200c622e4a34c49b4b1aaac92
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TChargingOrderController.java
@@ -468,6 +468,10 @@
        return refundList1;
    }
    public static List<TChargingOrderRefund> testing4(long total, long current, long size, List<TChargingOrderRefund> str){
        List<TChargingOrderRefund> result = new ArrayList<>();
        //获取初始化分页结构
@@ -516,8 +520,14 @@
        TCharingOrderVO res = chargingOrderService.chargingOrder(dto);
        return AjaxResult.success(res);
    }
    public static void main(String[] args) {
        ;
        System.err.println(Integer.parseInt("01"));
        System.err.println(Integer.valueOf("01"));
        ;
    }
    @RequiresPermissions(value = {"/chargingPileOrder/monitoring_record"}, logical = Logical.OR)
    @ResponseBody
    @GetMapping(value = "/chargingOrderInfo")
@@ -544,9 +554,27 @@
        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);
            String format = "";
            String format1 = "";
//            String temp1=list.get(0).getStartTime().split(":")[0];
            System.err.println("订单详情时间第一条"+list.get(0).getStartTime());
            System.err.println("订单详情时间开始"+tChargingOrderAccountingStrategy.getStartTime());
            System.err.println("订单详情时间结束"+tChargingOrderAccountingStrategy.getEndTime());
            String temp1=list.get(0).getStartTime().split(" ")[1].split(":")[0];
            String[] split = tChargingOrderAccountingStrategy.getStartTime().split(" ")[1].split(":");
            if (Integer.parseInt(split[0])>=Integer.parseInt(temp1)){
                format = byId.getCreateTime().format(formatter);
            }else {
                format = byId.getEndTime().format(formatter);
            }
            String[] split1 = tChargingOrderAccountingStrategy.getEndTime().split(" ")[1].split(":");
            if (Integer.parseInt(split1[0])<Integer.parseInt(temp1)){
                format1 = byId.getCreateTime().format(formatter);
            }else {
                format1 = byId.getEndTime().format(formatter);
            }
            tChargingOrderAccountingStrategy.setStartTime(format+" "+tChargingOrderAccountingStrategy.getStartTime());
            tChargingOrderAccountingStrategy.setEndTime(format+" "+tChargingOrderAccountingStrategy.getEndTime());
            tChargingOrderAccountingStrategy.setEndTime(format1+" "+tChargingOrderAccountingStrategy.getEndTime());
            if (byId.getVipDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){
                BigDecimal multiply = byId.getVipDiscountAmount().divide(byId.getServiceCharge(), 2)
                        .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice());
@@ -562,6 +590,9 @@
        return AjaxResult.success(chargingOrderInfoVO);
    }
    @ResponseBody
    @PostMapping(value = "/addEvaluate")
    @ApiOperation(value = "添加评价", tags = {"小程序-扫一扫"})
@@ -570,6 +601,9 @@
        orderEvaluateService.addOrderEvaluate(dto);
        return AjaxResult.success();
    }
    /**
     * 查询用户最近一次充电记录使用的车辆
     *
@@ -589,6 +623,9 @@
            return R.ok(-1L);
        }
    }
    /**
     * 查询会员在本月有多少次享受了充电折扣
@@ -1022,9 +1059,21 @@
        map.put("shopAmount",data1);
        BigDecimal data2 =   vipOrderService.getSumAmout(sixBefore);
        map.put("vipAmount",data2);
        List<TChargingOrder> list = chargingOrderService.lambdaQuery().between(TChargingOrder::getCreateTime, sixBefore, LocalDate.now()).list();
        BigDecimal serviceCharge = new BigDecimal("0");
        BigDecimal commissionAmount = new BigDecimal("0");
        for (TChargingOrder chargingOrder : list) {
            if (chargingOrder.getOrderSource().equals(2)){
                serviceCharge = serviceCharge.add(chargingOrder.getServiceCharge()!=null?chargingOrder.getServiceCharge().multiply(new BigDecimal("0.2")).setScale(2,BigDecimal.ROUND_DOWN):new BigDecimal("0"));
                commissionAmount = commissionAmount.add(chargingOrder.getServiceCharge()!=null?chargingOrder.getServiceCharge().multiply(new BigDecimal("0.2")).setScale(2,BigDecimal.ROUND_DOWN):new BigDecimal("0"));
            }else{
                serviceCharge = serviceCharge.add(chargingOrder.getServiceCharge());
            }
        }
        map.put("service_charge",serviceCharge);
        map.put("commission_amount",commissionAmount);
        return R.ok(map);
    }
@@ -1091,7 +1140,11 @@
                    if (chargingOrderVO != null) {
                        BeanUtils.copyProperties(chargingOrderVO, dataDto);
                    }
                    BeanUtils.copyProperties(uploadRealTimeMonitoringData, dataDto);
                    if (chargingOrderVO != null && chargingOrderVO.getOrderSource()==2){
                        dataDto.setPeriod_service_price(uploadRealTimeMonitoringData.getPeriod_service_price().multiply(new BigDecimal("0.2").setScale(2,BigDecimal.ROUND_DOWN)));
                    }
                    dataDto.setStartTime(uploadRealTimeMonitoringData.getStartTime());
                    dataDto.setEndTime(uploadRealTimeMonitoringData.getEndTime() == null ? null : uploadRealTimeMonitoringData.getEndTime());
                    dataDto.setStatus(uploadRealTimeMonitoringData.getStatus());
@@ -2213,4 +2266,6 @@
        return chargingOrderService.getNotPaymentChargingOrder();
    }
    
}