无关风月
2024-10-24 a71ab9d5449892b20902942fd35c39c1e272567e
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ChargingBillController.java
@@ -73,18 +73,13 @@
    public R<AccountListVO> accountBillList(@RequestBody ChargingListQuery dto) {
        AccountListVO accountListVO = new AccountListVO();
        ChargingBillVO res = chargingBillService.chargingBillList1(dto);
        ChargingBillVO res1 = chargingBillService.chargingBillList1(dto);
        List<ChargingBillListVO> records = res1.getList().getRecords();
        List<ChargingBillListVO> records = res.getList().getRecords();
        accountListVO.setBillCount(records.size());
        accountListVO.setTotalAmount(
                res1.getPaymentAmount().subtract(res1.getRefundAmount()==null?BigDecimal.ZERO:res1.getRefundAmount())
                        .subtract(res1.getCommissionAmount()==null?BigDecimal.ZERO:res1.getCommissionAmount())
                        .subtract(res1.getSharingAmount()==null?BigDecimal.ZERO:res1.getSharingAmount()));
        accountListVO.setPaymentAmount(res1.getPaymentAmount());
        accountListVO.setRefundAmount(res1.getRefundAmount());
        accountListVO.setCommissionAmount(res1.getCommissionAmount());
        accountListVO.setSharingAmount(res1.getSharingAmount());
        accountListVO.setTotalAmount(res.getOrderAmount());
        accountListVO.setPaymentAmount(res.getPaymentAmount());
        accountListVO.setRefundAmount(res.getRefundAmount());
        accountListVO.setCommissionAmount(res.getCommissionAmount());
        accountListVO.setSharingAmount(res.getSharingAmount());
        accountListVO.setList(res.getList());
        return R.ok(accountListVO);
    }
@@ -167,7 +162,7 @@
        }
    }
    @ApiOperation(value = "导出", tags = {"管理后台-账户结算账单"})
    @PostMapping("/exportAccount")
    @PutMapping("/exportAccount")
    public void exportAccount(@RequestBody ChargingListQuery dto)
    {
        ChargingBillVO res = chargingBillService.chargingBillList1(dto);
@@ -236,6 +231,7 @@
            }
        }
    }
    @ApiOperation(value = "下载-未出账", tags = {"管理后台-充电算账单"})
    @PutMapping("/download")
    public void download(@RequestBody ExportUidDto uid)
@@ -246,8 +242,7 @@
        TChargingBill byId = chargingBillService.getById(uid.getUid());
        ChargingBillExport chargingBillExport = new ChargingBillExport();
        chargingBillExport.setCode(byId.getCode());
        // todo 确认商户类型
        chargingBillExport.setAccountType("商户类型");
        chargingBillExport.setAccountType("微信商户");
        chargingBillExport.setType(byId.getType().toString());
        chargingBillExport.setBillType("月结");
        LocalDateTime billTime = byId.getBillTime();
@@ -279,7 +274,6 @@
        }
        BigDecimal paymentAmount = new BigDecimal("0");
        BigDecimal refundAmount = new BigDecimal("0");
        BigDecimal income = new BigDecimal("0");
        List<TChargingOrder> tChargingOrders = chargingOrderService.list(eq);
        // 累加支付金额
@@ -337,9 +331,7 @@
        // 导出
        List<Map<String, Object>> sheetsList = new ArrayList<>();
        AtomicInteger atomicInteger = new AtomicInteger();
        for (int i1 = 0; i1 < 3; i1++) {
        for (int i1 = 1; i1 <= 3; i1++) {
            String sheetName="";
            switch (i1){
                case 1: