diff --git a/backend/services/wallet-service/src/application/services/wallet-application.service.ts b/backend/services/wallet-service/src/application/services/wallet-application.service.ts index 85204ec3..35f3878a 100644 --- a/backend/services/wallet-service/src/application/services/wallet-application.service.ts +++ b/backend/services/wallet-service/src/application/services/wallet-application.service.ts @@ -64,6 +64,10 @@ export interface LedgerEntryDTO { refTxHash: string | null; memo: string | null; allocationType: string | null; + /** 来源用户账户序列号(从 payloadJson.metadata 提取) */ + sourceAccountSequence: string | null; + /** 来源中文备注(从 payloadJson.metadata.memo 提取) */ + sourceMemo: string | null; createdAt: string; } @@ -75,6 +79,21 @@ export interface PaginatedLedgerDTO { totalPages: number; } +/** 从 payloadJson 中提取 metadata 信息用于 LedgerEntryDTO */ +function extractPayloadInfo(payloadJson: unknown): { + allocationType: string | null; + sourceAccountSequence: string | null; + sourceMemo: string | null; +} { + const payload = payloadJson as Record | null; + const metadata = payload?.metadata as Record | null; + return { + allocationType: (payload?.allocationType as string) ?? null, + sourceAccountSequence: (metadata?.sourceAccountSequence as string) ?? null, + sourceMemo: (metadata?.memo as string) ?? null, + }; +} + @Injectable() export class WalletApplicationService { private readonly logger = new Logger(WalletApplicationService.name); @@ -1991,7 +2010,7 @@ export class WalletApplicationService { refOrderId: entry.refOrderId, refTxHash: entry.refTxHash, memo: entry.memo, - allocationType: (entry.payloadJson as Record)?.allocationType as string ?? null, + ...extractPayloadInfo(entry.payloadJson), createdAt: entry.createdAt.toISOString(), })), total: result.total, @@ -2036,7 +2055,7 @@ export class WalletApplicationService { refOrderId: entry.refOrderId, refTxHash: entry.refTxHash, memo: entry.memo, - allocationType: (entry.payloadJson as Record)?.allocationType as string ?? null, + ...extractPayloadInfo(entry.payloadJson), createdAt: entry.createdAt.toISOString(), })), total: result.total, @@ -2103,7 +2122,7 @@ export class WalletApplicationService { refOrderId: entry.refOrderId, refTxHash: entry.refTxHash, memo: entry.memo, - allocationType: (entry.payloadJson as Record)?.allocationType as string ?? null, + ...extractPayloadInfo(entry.payloadJson), createdAt: entry.createdAt.toISOString(), })), total: ledgerResult.total, @@ -2131,7 +2150,7 @@ export class WalletApplicationService { refOrderId: entry.refOrderId, refTxHash: entry.refTxHash, memo: entry.memo, - allocationType: (entry.payloadJson as Record)?.allocationType as string ?? null, + ...extractPayloadInfo(entry.payloadJson), createdAt: entry.createdAt.toISOString(), })), total: ledgerResult.total, @@ -2159,7 +2178,7 @@ export class WalletApplicationService { refOrderId: entry.refOrderId, refTxHash: entry.refTxHash, memo: entry.memo, - allocationType: (entry.payloadJson as Record)?.allocationType as string ?? null, + ...extractPayloadInfo(entry.payloadJson), createdAt: entry.createdAt.toISOString(), })), total: ledgerResult.total, diff --git a/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.module.scss b/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.module.scss index c9b2d04f..c5f032f0 100644 --- a/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.module.scss +++ b/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.module.scss @@ -512,6 +512,12 @@ word-break: break-word; } +.sourceAccount { + font-size: 13px; + font-family: monospace; + color: #374151; +} + /* [2026-01-06] 新增:详细明细列表样式 */ .detailsSection { margin-top: 24px; diff --git a/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx b/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx index 16f26ca0..c8067fdf 100644 --- a/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx +++ b/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx @@ -443,6 +443,8 @@ function FixedAccountsSection({ data }: { data: SystemAccountReportResponse['fix 类型 金额 余额 + 来源账户 + 来源备注 备注 @@ -459,6 +461,8 @@ function FixedAccountsSection({ data }: { data: SystemAccountReportResponse['fix {entry.amount >= 0 ? '+' : ''}{formatAmount(entry.amount)} {getAssetTypeLabel(entry.assetType)} {entry.balanceAfter !== null ? formatAmount(entry.balanceAfter) : '-'} + {entry.sourceAccountSequence || '-'} + {entry.sourceMemo || '-'} {entry.memo || entry.allocationType || '-'} ))} @@ -1110,6 +1114,8 @@ function LedgerAccountCard({ 类型 金额 余额 + 来源账户 + 来源备注 备注 @@ -1126,6 +1132,8 @@ function LedgerAccountCard({ {entry.amount >= 0 ? '+' : ''}{formatAmount(entry.amount)} {getAssetTypeLabel(entry.assetType)} {entry.balanceAfter !== null ? formatAmount(entry.balanceAfter) : '-'} + {entry.sourceAccountSequence || '-'} + {entry.sourceMemo || '-'} {entry.memo || entry.allocationType || '-'} ))} diff --git a/frontend/admin-web/src/types/system-account.types.ts b/frontend/admin-web/src/types/system-account.types.ts index 4b4caf79..2c775425 100644 --- a/frontend/admin-web/src/types/system-account.types.ts +++ b/frontend/admin-web/src/types/system-account.types.ts @@ -195,6 +195,10 @@ export interface LedgerEntryDTO { refTxHash: string | null; memo: string | null; allocationType: string | null; + /** 来源用户账户序列号 */ + sourceAccountSequence: string | null; + /** 来源中文备注 */ + sourceMemo: string | null; createdAt: string; }