From 3b533f35c37e990d8ef6de1c8ee7c0cd7ffc6dbf Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期四, 24 十月 2024 15:50:45 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ChargingBillController.java |   36 ++++++++++++++++--------------------
 1 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ChargingBillController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ChargingBillController.java
index 84f0aba..da2f83b 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ChargingBillController.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ChargingBillController.java
@@ -15,6 +15,7 @@
 import com.ruoyi.common.core.web.page.PageInfo;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
+import com.ruoyi.order.api.model.ExportUidDto;
 import com.ruoyi.order.api.model.TChargingBill;
 import com.ruoyi.order.api.model.TChargingOrder;
 import com.ruoyi.order.api.query.TOrderInvoiceQuery;
@@ -72,15 +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()).subtract(res1.getCommissionAmount()).subtract(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);
     }
@@ -100,7 +99,7 @@
         return R.ok(null);
     }
     @ApiOperation(value = "导出", tags = {"管理后台-充电算账单"})
-    @PostMapping("/export")
+    @PutMapping("/export")
     public void export(@RequestBody ChargingListQuery dto)
     {
         ChargingBillVO res = chargingBillService.chargingBillList(dto);
@@ -163,7 +162,7 @@
         }
     }
     @ApiOperation(value = "导出", tags = {"管理后台-账户结算账单"})
-    @PostMapping("/exportAccount")
+    @PutMapping("/exportAccount")
     public void exportAccount(@RequestBody ChargingListQuery dto)
     {
         ChargingBillVO res = chargingBillService.chargingBillList1(dto);
@@ -172,7 +171,7 @@
         for (ChargingBillListVO orderInvoiceVO : list) {
             TChargingBillExport tChargingBillExport = new TChargingBillExport();
             tChargingBillExport.setCode(orderInvoiceVO.getCode());
-            switch (orderInvoiceVO.getTimeType()){
+            switch (orderInvoiceVO.getOrderState()){
                 case 1:
                     tChargingBillExport.setBillType("日账单");
                     break;
@@ -232,18 +231,18 @@
             }
         }
     }
+
     @ApiOperation(value = "下载-未出账", tags = {"管理后台-充电算账单"})
-    @GetMapping("/download")
-    public void download(String uid)
+    @PutMapping("/download")
+    public void download(@RequestBody ExportUidDto uid)
     {
         List<ChargingBillExport> chargingBillExports = new ArrayList<>();
         List<ChargingBillRefundExport> chargingBillRefundExports = new ArrayList<>();
         List<ChargingBillPayExport> chargingBillPayExports = new ArrayList<>();
-        TChargingBill byId = chargingBillService.getById(uid);
+        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();
@@ -275,7 +274,6 @@
         }
         BigDecimal paymentAmount = new BigDecimal("0");
         BigDecimal refundAmount = new BigDecimal("0");
-        BigDecimal income = new BigDecimal("0");
 
         List<TChargingOrder> tChargingOrders = chargingOrderService.list(eq);
         // 累加支付金额
@@ -333,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:

--
Gitblit v1.7.1