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) {