From 06e4db5a576c63c10ab4673dba017ffe1a3e7e66 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期五, 17 一月 2025 19:07:27 +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 |   32 +++++++++++++++++++++-----------
 1 files changed, 21 insertions(+), 11 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 91b9420..6c2f211 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
@@ -16,6 +16,8 @@
 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.common.security.annotation.Logical;
+import com.ruoyi.common.security.annotation.RequiresPermissions;
 import com.ruoyi.order.api.model.*;
 import com.ruoyi.order.api.query.TOrderInvoiceQuery;
 import com.ruoyi.order.api.vo.AccountListVO;
@@ -139,6 +141,9 @@
 //        chargingBillService.save(tChargingBill14);
         return R.ok();
     }
+    
+    
+    @RequiresPermissions(value = {"/accountSettlementStatement"}, logical = Logical.OR)
     @PostMapping(value = "/accountBillList")
     @ApiOperation(value = "列表查询", tags = {"管理后台-账户结算账单"})
     public R<AccountListVO> accountBillList(@RequestBody ChargingListQuery dto) {
@@ -155,6 +160,8 @@
         accountListVO.setOrderList(res.getExportList());
         return R.ok(accountListVO);
     }
+    
+    @RequiresPermissions(value = {"/chargeBill"}, logical = Logical.OR)
     @PostMapping(value = "/chargingBillList")
     @ApiOperation(value = "充电算帐单列表查询", tags = {"管理后台-充电算账单"})
     public AjaxResult<ChargingBillVO> chargingBillList(@RequestBody ChargingListQuery dto) {
@@ -170,6 +177,9 @@
     public R<ChargingBillVO> chargingBillListExport(String uid) {
         return R.ok(null);
     }
+    
+    
+    @RequiresPermissions(value = {"/chargeBill/export"}, logical = Logical.OR)
     @ApiOperation(value = "导出", tags = {"管理后台-充电算账单"})
     @PutMapping("/export")
     public void export(@RequestBody ChargingListQuery dto)
@@ -234,6 +244,9 @@
             }
         }
     }
+    
+    
+    @RequiresPermissions(value = {"/accountSettlementStatement/export"}, logical = Logical.OR)
     @ApiOperation(value = "导出", tags = {"管理后台-账户结算账单"})
     @PutMapping("/exportAccount")
     public void exportAccount(@RequestBody ChargingListQuery dto)
@@ -304,7 +317,9 @@
             }
         }
     }
-
+    
+    
+    
     @ApiOperation(value = "下载-未出账", tags = {"管理后台-充电算账单"})
     @PutMapping("/download")
     public void download(@RequestBody ExportUidDto uid)
@@ -328,23 +343,18 @@
             chargingBillExport.setSiteName(data.get(0).getName());
         }
 //        // 根据账单的出账时间 查询上个月的充电订单
-//        LocalDateTime localDate = byId.getBillTime().minusMonths(1);
+        LocalDateTime localDate = byId.getBillTime().minusMonths(1);
 //        // 账单周期
 //        // 获取 LocalDate 对象
 //        LocalDate date = localDate.toLocalDate();
 //        // 获取该月份的第一天
 //        LocalDate firstDayOfMonth = date.withDayOfMonth(1);
-         LocalDateTime localDate = byId.getBillTime().minusDays(1);
-        // todo 临时修改为前一天
         // 获取 LocalDate 对象
         LocalDate date = localDate.toLocalDate();
-//            // 获取该月份的第一天
-//            LocalDate firstDayOfMonth = date.withDayOfMonth(1);
-//            // 获取该月份的最后一天
-//            LocalDate lastDayOfMonth = date.with(TemporalAdjusters.lastDayOfMonth());
-        // todo 临时修改为查询昨天凌晨00:00:00 到 23:59:59
-        LocalDateTime firstDayOfMonth = LocalDateTime.of(date, LocalTime.MIN);
-        LocalDateTime lastDayOfMonth = LocalDateTime.of(date, LocalTime.MAX);
+            // 获取该月份的第一天
+            LocalDate firstDayOfMonth = date.withDayOfMonth(1);
+            // 获取该月份的最后一天
+            LocalDate lastDayOfMonth = date.with(TemporalAdjusters.lastDayOfMonth());
         // 获取该月份的最后一天
 //        LocalDate lastDayOfMonth = date.with(TemporalAdjusters.lastDayOfMonth());
         QueryWrapper<TChargingOrder> eq = new QueryWrapper<TChargingOrder>()

--
Gitblit v1.7.1