feat(reporting, admin-web): 添加省/市区域账户累计转出统计

- 后端 reporting-service: RegionAccountInfo 和汇总接口添加 totalTransferred 字段
- 后端 wallet-service client: 更新 AllSystemAccountsResponse 类型定义
- 前端 admin-web: SystemAccountsTab 组件显示累计转出列
- 前端类型: RegionAccountsSummary 添加 totalTransferred 字段

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-07 04:45:56 -08:00
parent 27e64819b7
commit 6350b36e1a
4 changed files with 23 additions and 3 deletions

View File

@ -31,6 +31,7 @@ export interface RegionAccountInfo {
regionName: string;
usdtBalance: string;
totalReceived: string;
totalTransferred: string; // [2026-01-07] 新增:累计转出
status: string;
}
@ -52,6 +53,7 @@ export interface SystemAccountReportResponse {
summary: {
totalBalance: string;
totalReceived: string;
totalTransferred: string; // [2026-01-07] 新增:累计转出
count: number;
};
};
@ -61,6 +63,7 @@ export interface SystemAccountReportResponse {
summary: {
totalBalance: string;
totalReceived: string;
totalTransferred: string; // [2026-01-07] 新增:累计转出
count: number;
};
};
@ -148,7 +151,7 @@ export class SystemAccountReportApplicationService {
*/
async getProvinceAccountsSummary(): Promise<{
accounts: RegionAccountInfo[];
summary: { totalBalance: string; totalReceived: string; count: number };
summary: { totalBalance: string; totalReceived: string; totalTransferred: string; count: number };
}> {
const allSystemAccounts = await this.walletServiceClient.getAllSystemAccounts();
return this.assembleRegionSummary(allSystemAccounts.provinceAccounts);
@ -159,7 +162,7 @@ export class SystemAccountReportApplicationService {
*/
async getCityAccountsSummary(): Promise<{
accounts: RegionAccountInfo[];
summary: { totalBalance: string; totalReceived: string; count: number };
summary: { totalBalance: string; totalReceived: string; totalTransferred: string; count: number };
}> {
const allSystemAccounts = await this.walletServiceClient.getAllSystemAccounts();
return this.assembleRegionSummary(allSystemAccounts.cityAccounts);
@ -320,19 +323,22 @@ export class SystemAccountReportApplicationService {
/**
*
* [2026-01-07] totalTransferred
*/
private assembleRegionSummary(
accounts: RegionAccountInfo[],
): {
accounts: RegionAccountInfo[];
summary: { totalBalance: string; totalReceived: string; count: number };
summary: { totalBalance: string; totalReceived: string; totalTransferred: string; count: number };
} {
let totalBalance = 0;
let totalReceived = 0;
let totalTransferred = 0;
for (const account of accounts) {
totalBalance += parseFloat(account.usdtBalance) || 0;
totalReceived += parseFloat(account.totalReceived) || 0;
totalTransferred += parseFloat(account.totalTransferred) || 0;
}
return {
@ -340,6 +346,7 @@ export class SystemAccountReportApplicationService {
summary: {
totalBalance: totalBalance.toFixed(8),
totalReceived: totalReceived.toFixed(8),
totalTransferred: totalTransferred.toFixed(8),
count: accounts.length,
},
};

View File

@ -47,6 +47,7 @@ export interface SystemAccountBalance {
}
// [2026-01-05] 新增:所有系统账户响应类型
// [2026-01-07] 更新:省/市区域账户添加 totalTransferred 字段
export interface AllSystemAccountsResponse {
fixedAccounts: Array<{
accountSequence: string;
@ -63,6 +64,7 @@ export interface AllSystemAccountsResponse {
regionName: string;
usdtBalance: string;
totalReceived: string;
totalTransferred: string; // [2026-01-07] 新增:累计转出
status: string;
}>;
cityAccounts: Array<{
@ -71,6 +73,7 @@ export interface AllSystemAccountsResponse {
regionName: string;
usdtBalance: string;
totalReceived: string;
totalTransferred: string; // [2026-01-07] 新增:累计转出
status: string;
}>;
}

View File

@ -470,6 +470,7 @@ function FixedAccountsSection({ data }: { data: SystemAccountReportResponse['fix
/**
*
* [2026-01-05] USDT改为绿积分
* [2026-01-07]
*/
function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; type: 'province' | 'city' }) {
const typeLabel = type === 'province' ? '省' : '市';
@ -492,6 +493,11 @@ function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; ty
<span className={styles.summaryLabel}></span>
<span className={styles.summaryValue}>{formatAmount(data.summary.totalReceived)} 绿</span>
</div>
{/* [2026-01-07] 新增:累计转出 */}
<div className={styles.summaryCard}>
<span className={styles.summaryLabel}></span>
<span className={styles.summaryValue}>{formatAmount(data.summary.totalTransferred || '0')} 绿</span>
</div>
</div>
{/* 账户列表 */}
@ -503,6 +509,7 @@ function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; ty
<th></th>
<th> (绿)</th>
<th> (绿)</th>
<th> (绿)</th>
<th></th>
</tr>
</thead>
@ -513,6 +520,7 @@ function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; ty
<td>{account.regionCode ? getAccountDisplayName(account.regionCode) : '-'}</td>
<td>{formatAmount(account.usdtBalance)}</td>
<td>{formatAmount(account.totalReceived)}</td>
<td>{formatAmount(account.totalTransferred || '0')}</td>
<td>
<span className={`${styles.statusBadge} ${account.status === 'ACTIVE' ? styles.active : ''}`}>
{account.status === 'ACTIVE' ? '正常' : account.status}

View File

@ -33,12 +33,14 @@ export interface SystemAccountWithBalance extends SystemAccountDTO {
/**
*
* [2026-01-07] totalTransferred
*/
export interface RegionAccountsSummary {
accounts: SystemAccountDTO[];
summary: {
totalBalance: string;
totalReceived: string;
totalTransferred: string; // [2026-01-07] 新增:累计转出
count: number;
};
}