fix(wallet-service): 修正固定账户类型映射顺序

修复 getAllSystemAccounts 中 fixedAccountTypes 映射错误:
- S0000000001 应为 COST_ACCOUNT (运营1),而非 HQ_COMMUNITY
- S0000000002 应为 OPERATION_ACCOUNT (运营2),而非 COST_ACCOUNT
- S0000000003 应为 HQ_COMMUNITY (总部储蓄),而非 OPERATION_ACCOUNT

此修复确保固定账户的余额、收入和分类账明细正确对应。
同时移除前端调试日志。

🤖 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-06 23:20:41 -08:00
parent 7766a9caba
commit d28723f141
2 changed files with 3 additions and 4 deletions

View File

@ -3314,7 +3314,9 @@ export class WalletApplicationService {
const transferredStats = await this.prisma.ledgerEntry.groupBy({ by: ['accountSequence'], where: { accountSequence: { in: accountSeqs }, amount: { lt: 0 } }, _sum: { amount: true } });
const receivedMap2 = new Map(receivedStats2.map(s => [s.accountSequence, s._sum.amount]));
const transferredMap = new Map(transferredStats.map(s => [s.accountSequence, s._sum.amount]));
const fixedAccountTypes: Record<string, string> = { 'S0000000001': 'HQ_COMMUNITY', 'S0000000002': 'COST_ACCOUNT', 'S0000000003': 'OPERATION_ACCOUNT', 'S0000000004': 'RWAD_POOL_PENDING', 'S0000000005': 'SHARE_RIGHT_POOL', 'S0000000006': 'FEE_COLLECTION' };
// [2026-01-07] 修复:修正账户类型映射,与前端 SYSTEM_ACCOUNT_NAMES 保持一致
// S0000000001=运营1(COST), S0000000002=运营2(OPERATION), S0000000003=总部储蓄(HQ)
const fixedAccountTypes: Record<string, string> = { 'S0000000001': 'COST_ACCOUNT', 'S0000000002': 'OPERATION_ACCOUNT', 'S0000000003': 'HQ_COMMUNITY', 'S0000000004': 'RWAD_POOL_PENDING', 'S0000000005': 'SHARE_RIGHT_POOL', 'S0000000006': 'FEE_COLLECTION' };
const fixedAccounts: Array<{ accountSequence: string; accountType: string; usdtBalance: string; totalReceived: string; totalTransferred: string; status: string; createdAt: string }> = [];
const provinceAccounts: Array<{ accountSequence: string; regionCode: string; regionName: string; usdtBalance: string; totalReceived: string; status: string }> = [];
const cityAccounts: Array<{ accountSequence: string; regionCode: string; regionName: string; usdtBalance: string; totalReceived: string; status: string }> = [];

View File

@ -350,9 +350,6 @@ function FixedAccountsSection({ data }: { data: SystemAccountReportResponse['fix
const accountLedger = allLedgerData.fixedAccountsLedger.find(
(item) => item.accountSequence === accountSequence
);
// [2026-01-07] 调试:验证数据匹配是否正确
console.log('[getAccountLedger] 查找:', accountSequence, '→ 找到:', accountLedger?.accountSequence, '条数:', accountLedger?.ledger?.length);
console.log('[getAccountLedger] 后端返回的账户列表:', allLedgerData.fixedAccountsLedger.map(l => ({ seq: l.accountSequence, type: l.accountType, count: l.ledger?.length })));
return accountLedger?.ledger || [];
};