From acf461cec4e474500154124ded41cc18dc975cfd Mon Sep 17 00:00:00 2001 From: luqingjie <544309509@qq.com> Date: Sat, 31 Oct 2026 20:31:23 -0400 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BC=98=E5=8C=96=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E7=A7=9F=E8=B5=81=E8=AE=A2=E5=8D=95=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?proxyRent/rentOrder/index.vue=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BF=A1=E6=81=AF=20=202.=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BE=9B=E5=BA=94=E5=95=86=E5=92=8C=E7=A7=9F=E8=B5=81?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=A7=9F=E8=B5=81=E8=AE=A2=E5=8D=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E8=A6=81=E6=B1=82=E5=8F=AA=E8=83=BD=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=88=B0=E6=89=80=E5=B1=9E=E8=87=AA=E5=B7=B1=E7=9A=84?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=EF=BC=8C=E6=94=BE=E5=9C=A8proxyRent/rentOrde?= =?UTF-8?q?r/user/=E4=B8=8B=E9=9D=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/system/rental/RentalDashboard.java | 15 +++++++++++++++ .../system/rental/RentalDashboardController.java | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/rental/RentalDashboard.java b/ruoyi-system/src/main/java/com/ruoyi/system/rental/RentalDashboard.java index 924440f..42fb74f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/rental/RentalDashboard.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/rental/RentalDashboard.java @@ -21,6 +21,21 @@ public class RentalDashboard { this.store = store; } + /** 管理员订单页的全局摘要;只读聚合,不把统计交给前端分页数据推算。 */ + @Transactional(readOnly = true) + public Map manageOrderSummary() { + Map totals = store.one("SELECT COUNT(*) total," + + " COALESCE(SUM(CASE WHEN status='SUCCESS' THEN 1 ELSE 0 END),0) success," + + " COALESCE(SUM(CASE WHEN status='MANUAL_REVIEW' THEN 1 ELSE 0 END),0) manual," + + " COALESCE(SUM(CASE WHEN status IN ('WAITING','EXECUTING','VERIFYING') THEN 1 ELSE 0 END),0) processing," + + " COALESCE(SUM(CASE WHEN reclaim_status IN ('WAITING','RUNNING','RECOVERING','MANUAL_REVIEW') THEN 1 ELSE 0 END),0) reclaim_pending," + + " COALESCE(SUM(sale_amount),0) amount FROM rent_order"); + return map("totals", totals, "by_status", store.rows( + "SELECT status,COUNT(*) total FROM rent_order GROUP BY status ORDER BY status"), + "by_network", store.rows( + "SELECT network,COUNT(*) total FROM rent_order GROUP BY network ORDER BY network")); + } + /** 同一事务快照保证本次余额、图表、监控口径一致;所有时间为UTC。 */ @Transactional(readOnly = true, isolation = Isolation.REPEATABLE_READ) public Map overview(long user, String persona, String selectedNetwork, int days) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/rental/RentalDashboardController.java b/ruoyi-system/src/main/java/com/ruoyi/system/rental/RentalDashboardController.java index f567327..88c3204 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/rental/RentalDashboardController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/rental/RentalDashboardController.java @@ -25,4 +25,10 @@ public class RentalDashboardController { require(user != null, "请先登录"); return AjaxResult.success(dashboard.overview(user, persona, network, days)); } + + @GetMapping("/manage/orders") + @PreAuthorize("@ss.hasPermi('rent:manage:list')") + public AjaxResult manageOrders() { + return AjaxResult.success(dashboard.manageOrderSummary()); + } }