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:
parent
27e64819b7
commit
6350b36e1a
|
|
@ -31,6 +31,7 @@ export interface RegionAccountInfo {
|
||||||
regionName: string;
|
regionName: string;
|
||||||
usdtBalance: string;
|
usdtBalance: string;
|
||||||
totalReceived: string;
|
totalReceived: string;
|
||||||
|
totalTransferred: string; // [2026-01-07] 新增:累计转出
|
||||||
status: string;
|
status: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,6 +53,7 @@ export interface SystemAccountReportResponse {
|
||||||
summary: {
|
summary: {
|
||||||
totalBalance: string;
|
totalBalance: string;
|
||||||
totalReceived: string;
|
totalReceived: string;
|
||||||
|
totalTransferred: string; // [2026-01-07] 新增:累计转出
|
||||||
count: number;
|
count: number;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -61,6 +63,7 @@ export interface SystemAccountReportResponse {
|
||||||
summary: {
|
summary: {
|
||||||
totalBalance: string;
|
totalBalance: string;
|
||||||
totalReceived: string;
|
totalReceived: string;
|
||||||
|
totalTransferred: string; // [2026-01-07] 新增:累计转出
|
||||||
count: number;
|
count: number;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -148,7 +151,7 @@ export class SystemAccountReportApplicationService {
|
||||||
*/
|
*/
|
||||||
async getProvinceAccountsSummary(): Promise<{
|
async getProvinceAccountsSummary(): Promise<{
|
||||||
accounts: RegionAccountInfo[];
|
accounts: RegionAccountInfo[];
|
||||||
summary: { totalBalance: string; totalReceived: string; count: number };
|
summary: { totalBalance: string; totalReceived: string; totalTransferred: string; count: number };
|
||||||
}> {
|
}> {
|
||||||
const allSystemAccounts = await this.walletServiceClient.getAllSystemAccounts();
|
const allSystemAccounts = await this.walletServiceClient.getAllSystemAccounts();
|
||||||
return this.assembleRegionSummary(allSystemAccounts.provinceAccounts);
|
return this.assembleRegionSummary(allSystemAccounts.provinceAccounts);
|
||||||
|
|
@ -159,7 +162,7 @@ export class SystemAccountReportApplicationService {
|
||||||
*/
|
*/
|
||||||
async getCityAccountsSummary(): Promise<{
|
async getCityAccountsSummary(): Promise<{
|
||||||
accounts: RegionAccountInfo[];
|
accounts: RegionAccountInfo[];
|
||||||
summary: { totalBalance: string; totalReceived: string; count: number };
|
summary: { totalBalance: string; totalReceived: string; totalTransferred: string; count: number };
|
||||||
}> {
|
}> {
|
||||||
const allSystemAccounts = await this.walletServiceClient.getAllSystemAccounts();
|
const allSystemAccounts = await this.walletServiceClient.getAllSystemAccounts();
|
||||||
return this.assembleRegionSummary(allSystemAccounts.cityAccounts);
|
return this.assembleRegionSummary(allSystemAccounts.cityAccounts);
|
||||||
|
|
@ -320,19 +323,22 @@ export class SystemAccountReportApplicationService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组装区域账户汇总
|
* 组装区域账户汇总
|
||||||
|
* [2026-01-07] 更新:添加 totalTransferred 累计转出统计
|
||||||
*/
|
*/
|
||||||
private assembleRegionSummary(
|
private assembleRegionSummary(
|
||||||
accounts: RegionAccountInfo[],
|
accounts: RegionAccountInfo[],
|
||||||
): {
|
): {
|
||||||
accounts: RegionAccountInfo[];
|
accounts: RegionAccountInfo[];
|
||||||
summary: { totalBalance: string; totalReceived: string; count: number };
|
summary: { totalBalance: string; totalReceived: string; totalTransferred: string; count: number };
|
||||||
} {
|
} {
|
||||||
let totalBalance = 0;
|
let totalBalance = 0;
|
||||||
let totalReceived = 0;
|
let totalReceived = 0;
|
||||||
|
let totalTransferred = 0;
|
||||||
|
|
||||||
for (const account of accounts) {
|
for (const account of accounts) {
|
||||||
totalBalance += parseFloat(account.usdtBalance) || 0;
|
totalBalance += parseFloat(account.usdtBalance) || 0;
|
||||||
totalReceived += parseFloat(account.totalReceived) || 0;
|
totalReceived += parseFloat(account.totalReceived) || 0;
|
||||||
|
totalTransferred += parseFloat(account.totalTransferred) || 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
@ -340,6 +346,7 @@ export class SystemAccountReportApplicationService {
|
||||||
summary: {
|
summary: {
|
||||||
totalBalance: totalBalance.toFixed(8),
|
totalBalance: totalBalance.toFixed(8),
|
||||||
totalReceived: totalReceived.toFixed(8),
|
totalReceived: totalReceived.toFixed(8),
|
||||||
|
totalTransferred: totalTransferred.toFixed(8),
|
||||||
count: accounts.length,
|
count: accounts.length,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ export interface SystemAccountBalance {
|
||||||
}
|
}
|
||||||
|
|
||||||
// [2026-01-05] 新增:所有系统账户响应类型
|
// [2026-01-05] 新增:所有系统账户响应类型
|
||||||
|
// [2026-01-07] 更新:省/市区域账户添加 totalTransferred 字段
|
||||||
export interface AllSystemAccountsResponse {
|
export interface AllSystemAccountsResponse {
|
||||||
fixedAccounts: Array<{
|
fixedAccounts: Array<{
|
||||||
accountSequence: string;
|
accountSequence: string;
|
||||||
|
|
@ -63,6 +64,7 @@ export interface AllSystemAccountsResponse {
|
||||||
regionName: string;
|
regionName: string;
|
||||||
usdtBalance: string;
|
usdtBalance: string;
|
||||||
totalReceived: string;
|
totalReceived: string;
|
||||||
|
totalTransferred: string; // [2026-01-07] 新增:累计转出
|
||||||
status: string;
|
status: string;
|
||||||
}>;
|
}>;
|
||||||
cityAccounts: Array<{
|
cityAccounts: Array<{
|
||||||
|
|
@ -71,6 +73,7 @@ export interface AllSystemAccountsResponse {
|
||||||
regionName: string;
|
regionName: string;
|
||||||
usdtBalance: string;
|
usdtBalance: string;
|
||||||
totalReceived: string;
|
totalReceived: string;
|
||||||
|
totalTransferred: string; // [2026-01-07] 新增:累计转出
|
||||||
status: string;
|
status: string;
|
||||||
}>;
|
}>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -470,6 +470,7 @@ function FixedAccountsSection({ data }: { data: SystemAccountReportResponse['fix
|
||||||
/**
|
/**
|
||||||
* 区域账户汇总区域
|
* 区域账户汇总区域
|
||||||
* [2026-01-05] 更新:USDT改为绿积分
|
* [2026-01-05] 更新:USDT改为绿积分
|
||||||
|
* [2026-01-07] 更新:增加累计转出显示
|
||||||
*/
|
*/
|
||||||
function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; type: 'province' | 'city' }) {
|
function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; type: 'province' | 'city' }) {
|
||||||
const typeLabel = type === 'province' ? '省' : '市';
|
const typeLabel = type === 'province' ? '省' : '市';
|
||||||
|
|
@ -492,6 +493,11 @@ function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; ty
|
||||||
<span className={styles.summaryLabel}>累计收入</span>
|
<span className={styles.summaryLabel}>累计收入</span>
|
||||||
<span className={styles.summaryValue}>{formatAmount(data.summary.totalReceived)} 绿积分</span>
|
<span className={styles.summaryValue}>{formatAmount(data.summary.totalReceived)} 绿积分</span>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
{/* 账户列表 */}
|
{/* 账户列表 */}
|
||||||
|
|
@ -503,6 +509,7 @@ function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; ty
|
||||||
<th>区域</th>
|
<th>区域</th>
|
||||||
<th>余额 (绿积分)</th>
|
<th>余额 (绿积分)</th>
|
||||||
<th>累计收入 (绿积分)</th>
|
<th>累计收入 (绿积分)</th>
|
||||||
|
<th>累计转出 (绿积分)</th>
|
||||||
<th>状态</th>
|
<th>状态</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
@ -513,6 +520,7 @@ function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; ty
|
||||||
<td>{account.regionCode ? getAccountDisplayName(account.regionCode) : '-'}</td>
|
<td>{account.regionCode ? getAccountDisplayName(account.regionCode) : '-'}</td>
|
||||||
<td>{formatAmount(account.usdtBalance)}</td>
|
<td>{formatAmount(account.usdtBalance)}</td>
|
||||||
<td>{formatAmount(account.totalReceived)}</td>
|
<td>{formatAmount(account.totalReceived)}</td>
|
||||||
|
<td>{formatAmount(account.totalTransferred || '0')}</td>
|
||||||
<td>
|
<td>
|
||||||
<span className={`${styles.statusBadge} ${account.status === 'ACTIVE' ? styles.active : ''}`}>
|
<span className={`${styles.statusBadge} ${account.status === 'ACTIVE' ? styles.active : ''}`}>
|
||||||
{account.status === 'ACTIVE' ? '正常' : account.status}
|
{account.status === 'ACTIVE' ? '正常' : account.status}
|
||||||
|
|
|
||||||
|
|
@ -33,12 +33,14 @@ export interface SystemAccountWithBalance extends SystemAccountDTO {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 区域账户汇总
|
* 区域账户汇总
|
||||||
|
* [2026-01-07] 更新:增加 totalTransferred 字段
|
||||||
*/
|
*/
|
||||||
export interface RegionAccountsSummary {
|
export interface RegionAccountsSummary {
|
||||||
accounts: SystemAccountDTO[];
|
accounts: SystemAccountDTO[];
|
||||||
summary: {
|
summary: {
|
||||||
totalBalance: string;
|
totalBalance: string;
|
||||||
totalReceived: string;
|
totalReceived: string;
|
||||||
|
totalTransferred: string; // [2026-01-07] 新增:累计转出
|
||||||
count: number;
|
count: number;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue