diff --git a/backend/services/reporting-service/src/infrastructure/external/wallet-service/wallet-service.client.ts b/backend/services/reporting-service/src/infrastructure/external/wallet-service/wallet-service.client.ts index d6e84d5e..e6d39fcc 100644 --- a/backend/services/reporting-service/src/infrastructure/external/wallet-service/wallet-service.client.ts +++ b/backend/services/reporting-service/src/infrastructure/external/wallet-service/wallet-service.client.ts @@ -320,6 +320,7 @@ export class WalletServiceClient { } // [2026-01-06] 新增:获取手续费归集账户汇总统计 + // [2026-01-07] 修复:wallet-service 返回 { success, data, timestamp } 包装格式,需要解包 /** * 获取手续费归集账户汇总统计 * 统计 S0000000006 账户收到的所有提现手续费 @@ -330,10 +331,11 @@ export class WalletServiceClient { this.logger.debug(`[getFeeCollectionSummary] 请求: ${url}`); const response = await firstValueFrom( - this.httpService.get(url), + this.httpService.get<{ success: boolean; data: FeeCollectionSummaryResponse; timestamp: string }>(url), ); - return response.data; + // wallet-service 返回 { success, data, timestamp } 包装格式 + return response.data.data; } catch (error) { this.logger.error(`[getFeeCollectionSummary] 失败: ${error.message}`); return { @@ -347,6 +349,7 @@ export class WalletServiceClient { } } + // [2026-01-07] 修复:wallet-service 返回 { success, data, timestamp } 包装格式,需要解包 /** * 获取手续费归集账户流水明细 */ @@ -369,10 +372,11 @@ export class WalletServiceClient { this.logger.debug(`[getFeeCollectionEntries] 请求: ${url}`); const response = await firstValueFrom( - this.httpService.get(url), + this.httpService.get<{ success: boolean; data: FeeCollectionEntriesResponse; timestamp: string }>(url), ); - return response.data; + // wallet-service 返回 { success, data, timestamp } 包装格式 + return response.data.data; } catch (error) { this.logger.error(`[getFeeCollectionEntries] 失败: ${error.message}`); return { 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 6851cb51..c35cecf5 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 @@ -3398,7 +3398,7 @@ export class WalletApplicationService { COALESCE(payload_json->>'feeType', 'UNKNOWN') as "feeType", SUM(amount) as amount, COUNT(*) as count - FROM ledger_entries + FROM wallet_ledger_entries WHERE account_sequence = ${feeAccountSequence} AND entry_type = 'FEE_COLLECTION' GROUP BY COALESCE(payload_json->>'feeType', 'UNKNOWN') @@ -3415,7 +3415,7 @@ export class WalletApplicationService { TO_CHAR(created_at, 'YYYY-MM') as month, SUM(amount) as amount, COUNT(*) as count - FROM ledger_entries + FROM wallet_ledger_entries WHERE account_sequence = ${feeAccountSequence} AND entry_type = 'FEE_COLLECTION' GROUP BY TO_CHAR(created_at, 'YYYY-MM')