fix(wallet): 优化流水memo避免正常认种来源信息重复

正常认种的 reward-service memo 已含"来自用户Dxxx的认种",
增加 hasSourceInfo 检查,包含"来自"时不再重复拼接来源账户。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-28 20:10:09 -08:00
parent 299c82fc4f
commit 90fad63fed
1 changed files with 11 additions and 3 deletions

View File

@ -1049,15 +1049,23 @@ export class WalletApplicationService {
/**
*
* : [] {memo} | : {sourceAccountSequence} ({orderId})
* metadata memo 使使 allocationType
*
* 使 metadata.memoreward-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) {