feat(adminfinance): 新增预计收入指标并优化明细查询性能

- 财务看板增加预计收入与待结算订单数统计
- 明细列表 COUNT 改为仅扫描 rental_orders 主表,避免 5-JOIN 子查询
- 统一前后端结算差异判定阈值为常量 5 分
- 修复日期选择器使用 UTC 日期导致东八区凌晨偏移前一天的问题
This commit is contained in:
yml2213
2026-07-02 17:33:05 +08:00
parent 1b818b8e4b
commit 512291f089
9 changed files with 147 additions and 45 deletions
@@ -34,10 +34,12 @@ type FinanceSummaryDTO struct {
OwnerShouldIncomeAmountCent int64 `json:"owner_should_income_amount_cent"`
OwnerWalletIncomeAmountCent int64 `json:"owner_wallet_income_amount_cent"`
SettlementDiffAmountCent int64 `json:"settlement_diff_amount_cent"`
EstimatedIncomeAmountCent int64 `json:"estimated_income_amount_cent"`
SuccessfulPayCount int64 `json:"successful_pay_count"`
SuccessfulRefundCount int64 `json:"successful_refund_count"`
PendingRefundCount int64 `json:"pending_refund_count"`
SettledOrderCount int64 `json:"settled_order_count"`
PendingSettleOrderCount int64 `json:"pending_settle_order_count"`
FinancialExceptionCount int64 `json:"financial_exception_count"`
}
@@ -51,6 +53,7 @@ type FinanceDailyDTO struct {
OwnerShouldIncomeAmountCent int64 `json:"owner_should_income_amount_cent"`
OwnerWalletIncomeAmountCent int64 `json:"owner_wallet_income_amount_cent"`
SettlementDiffAmountCent int64 `json:"settlement_diff_amount_cent"`
EstimatedIncomeAmountCent int64 `json:"estimated_income_amount_cent"`
SuccessfulPayCount int64 `json:"successful_pay_count"`
SuccessfulRefundCount int64 `json:"successful_refund_count"`
PendingRefundCount int64 `json:"pending_refund_count"`