fix(wallet-service): 完善系统账户转出分类账memo信息

- memo 格式更新为包含完整信息:
  - 接收方账户ID
  - 接收方姓名
  - 接收方钱包地址(缩略显示)
  - 操作员姓名/ID
  - 备注(如有)
- payloadJson 新增 toAddress 字段存储完整地址

示例: "转账至 D25010100001 (张三) | 地址: 0x1234...5678 | 操作员: 管理员A | 备注: 奖励发放"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-07 04:52:00 -08:00
parent 6350b36e1a
commit d16ad81d62
1 changed files with 11 additions and 1 deletions

View File

@ -179,6 +179,15 @@ export class SystemWithdrawalApplicationService {
});
// 6.4 记录系统账户转出流水
// [2026-01-07] 更新memo 包含完整的接收方和操作员信息
const memoDetails = [
`转账至 ${command.toAccountSequence}`,
toUserInfo.realName ? `(${toUserInfo.realName})` : null,
`地址: ${toUserInfo.walletAddress.slice(0, 10)}...${toUserInfo.walletAddress.slice(-8)}`,
`操作员: ${command.operatorName || command.operatorId}`,
command.memo ? `备注: ${command.memo}` : null,
].filter(Boolean).join(' | ');
await tx.ledgerEntry.create({
data: {
accountSequence: command.fromAccountSequence,
@ -188,11 +197,12 @@ export class SystemWithdrawalApplicationService {
assetType: 'USDT',
balanceAfter: newBalance,
refOrderId: orderNo,
memo: `转账至 ${command.toAccountSequence}${toUserInfo.realName ? ` (${toUserInfo.realName})` : ''}${command.memo ? ` - ${command.memo}` : ''}`,
memo: memoDetails,
payloadJson: {
toAccountSequence: command.toAccountSequence,
toUserId: toUserInfo.userId,
toUserName: toUserInfo.realName,
toAddress: toUserInfo.walletAddress,
operatorId: command.operatorId,
operatorName: command.operatorName,
},