1. 优化管理员租赁订单页面proxyRent/rentOrder/index.vue,添加统计信息 2. 新增供应商和租赁用户租赁订单页面,要求只能查询到所属自己的订单,放在proxyRent/rentOrder/user/下面。
This commit is contained in:
1 parent
90e74603bb
commit
acf461cec4
2 files changed
+21
No files matched your search
@@ -21,6 +21,21 @@ public class RentalDashboard {
|
|||||||
this.store = store;
|
this.store = store;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 管理员订单页的全局摘要;只读聚合,不把统计交给前端分页数据推算。 */
|
||||||
|
@Transactional(readOnly = true)
|
||||||
|
public Map<String, Object> manageOrderSummary() {
|
||||||
|
Map<String, Object> 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。 */
|
/** 同一事务快照保证本次余额、图表、监控口径一致;所有时间为UTC。 */
|
||||||
@Transactional(readOnly = true, isolation = Isolation.REPEATABLE_READ)
|
@Transactional(readOnly = true, isolation = Isolation.REPEATABLE_READ)
|
||||||
public Map<String, Object> overview(long user, String persona, String selectedNetwork, int days) {
|
public Map<String, Object> overview(long user, String persona, String selectedNetwork, int days) {
|
||||||
|
|||||||
@@ -25,4 +25,10 @@ public class RentalDashboardController {
|
|||||||
require(user != null, "请先登录");
|
require(user != null, "请先登录");
|
||||||
return AjaxResult.success(dashboard.overview(user, persona, network, days));
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user