From 90fad63fedab91aabdf5584840e9ecb8d0c0ce72 Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 28 Feb 2026 20:10:09 -0800 Subject: [PATCH] =?UTF-8?q?fix(wallet):=20=E4=BC=98=E5=8C=96=E6=B5=81?= =?UTF-8?q?=E6=B0=B4memo=E9=81=BF=E5=85=8D=E6=AD=A3=E5=B8=B8=E8=AE=A4?= =?UTF-8?q?=E7=A7=8D=E6=9D=A5=E6=BA=90=E4=BF=A1=E6=81=AF=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 正常认种的 reward-service memo 已含"来自用户Dxxx的认种", 增加 hasSourceInfo 检查,包含"来自"时不再重复拼接来源账户。 Co-Authored-By: Claude Opus 4.6 --- .../services/wallet-application.service.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 39db5706..85204ec3 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 @@ -1049,15 +1049,23 @@ export class WalletApplicationService { /** * 构建包含来源信息的分配备注 - * 格式: [预种] {中文memo} | 来源: {sourceAccountSequence} ({orderId}) - * 如果 metadata 中有中文 memo 则优先使用,否则使用 allocationType 英文标识 + * + * 优先使用 metadata.memo(reward-service / pre-planting 已包含完整中文描述和来源用户) + * 例: "成本费:来自用户D25121400002的认种,1棵树"(正常认种) + * 例: "预种成本费"(预种 — 简短,需补充来源) + * + * 当 metadata.memo 较短(不含"来自"字样)时,追加来源账户信息 + * 前缀 [预种] 通过 prePlantingPrefix() 自动添加 */ private buildAllocationMemo(allocation: FundAllocationItem, orderId: string, suffix?: string): string { const prefix = this.prePlantingPrefix(allocation); const memo = allocation.metadata?.memo || allocation.allocationType; const sourceAccount = allocation.metadata?.sourceAccountSequence; + + // 如果 memo 已包含来源用户信息(正常认种的 reward-service 格式),不再重复拼接 + const hasSourceInfo = memo.includes('来自'); const parts = [prefix + memo]; - if (sourceAccount) { + if (sourceAccount && !hasSourceInfo) { parts.push(`来源: ${sourceAccount} (${orderId})`); } if (suffix) {