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 6949a303..3f200b87 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 @@ -2498,7 +2498,7 @@ export class WalletApplicationService { */ async getUnprocessedSettlements(accountSequence: string): Promise<{ entries: Array<{ - id: bigint; + id: string; // BigInt 转换为 string 以支持 JSON 序列化 amount: number; createdAt: Date; memo: string | null; @@ -2538,7 +2538,7 @@ export class WalletApplicationService { const payloadJson = entry.payloadJson as Record | null; const allocationType = payloadJson?.allocationType as string | null; return { - id: entry.id, + id: entry.id.toString(), // BigInt 需要转为 string 才能 JSON 序列化 amount, createdAt: entry.createdAt, memo: entry.memo, @@ -2708,7 +2708,7 @@ export class WalletApplicationService { data: { accountSequence: command.accountSequence, userId: walletRecord.userId, - originalLedgerEntryId: entry.id, + originalLedgerEntryId: BigInt(entry.id), // 转回 BigInt 用于数据库存储 originalAmount: entry.amount, deductedAmount: actualDeduct, deductionLedgerEntryId: ledgerEntry.id,