From 842bc425798999d4e0fa07812851f5e295f46666 Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 7 Jan 2026 06:40:20 -0800 Subject: [PATCH] =?UTF-8?q?fix(reporting-service):=20=E6=80=BB=E9=83=A8?= =?UTF-8?q?=E5=82=A8=E8=93=84=E8=B4=A6=E6=88=B7=E4=BD=99=E9=A2=9D=E4=B9=9F?= =?UTF-8?q?=E9=9C=80=E7=B4=AF=E5=8A=A0=E8=BF=87=E6=9C=9F=E6=94=B6=E7=9B=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 账户余额改为 usdtBalance + expiredRewardsTotal - 与累计收入的计算方式保持一致 - 过期的分享权益会进入 S0000000001,余额和收入都应包含 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../system-account-report-application.service.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/services/reporting-service/src/application/services/system-account-report-application.service.ts b/backend/services/reporting-service/src/application/services/system-account-report-application.service.ts index 3461d7eb..6fdcd971 100644 --- a/backend/services/reporting-service/src/application/services/system-account-report-application.service.ts +++ b/backend/services/reporting-service/src/application/services/system-account-report-application.service.ts @@ -302,7 +302,8 @@ export class SystemAccountReportApplicationService { /** * 组装固定账户数据 - * [2026-01-07] 更新:将过期收益累加到总部储蓄账户 (HQ_COMMUNITY / S0000000001) 的累计收入中 + * [2026-01-07] 更新:将过期收益累加到总部储蓄账户 (HQ_COMMUNITY / S0000000001) 的累计收入和账户余额中 + * 过期的分享权益会进入 S0000000001,所以余额和收入都需要包含过期收益 */ private assembleFixedAccounts( fixedAccounts: AllSystemAccountsResponse['fixedAccounts'], @@ -319,14 +320,20 @@ export class SystemAccountReportApplicationService { for (const account of fixedAccounts) { const fieldName = FIXED_ACCOUNT_TYPES[account.accountType]; if (fieldName && fieldName in result) { - // 如果是总部储蓄账户 (HQ_COMMUNITY),累加过期收益 + // 如果是总部储蓄账户 (HQ_COMMUNITY),累加过期收益到余额和累计收入 if (account.accountType === 'HQ_COMMUNITY' && expiredRewardsTotal > 0) { + const currentBalance = parseFloat(account.usdtBalance) || 0; const currentReceived = parseFloat(account.totalReceived) || 0; + const newBalance = currentBalance + expiredRewardsTotal; const newTotalReceived = currentReceived + expiredRewardsTotal; (result as any)[fieldName] = { ...account, + usdtBalance: newBalance.toFixed(8), totalReceived: newTotalReceived.toFixed(8), }; + this.logger.log( + `[assembleFixedAccounts] HQ_COMMUNITY 余额: ${currentBalance} + 过期收益 ${expiredRewardsTotal} = ${newBalance}`, + ); this.logger.log( `[assembleFixedAccounts] HQ_COMMUNITY 累计收入: ${currentReceived} + 过期收益 ${expiredRewardsTotal} = ${newTotalReceived}`, );