feat(admin-web): 省团队收益汇总明细增加来源用户列并修复账户名称显示

问题描述:
1. 省团队收益汇总的详细明细中缺少收益来源用户信息
2. 账户类型显示为数字(如7440000)而不是省名称

修改内容:

1. 后端 reward-service (reward-application.service.ts)
   - getRewardEntriesByType 方法返回值新增 sourceAccountSequence 字段
   - 该字段表示触发此收益的用户账户序列号(来自认种用户)

2. 后端 reporting-service (reward-service.client.ts)
   - RewardEntryDTO 接口新增 sourceAccountSequence 字段

3. 前端 admin-web
   - system-account.types.ts: RewardEntryDTO 新增 sourceAccountSequence 字段
   - system-account.types.ts: getAccountDisplayName 函数支持7开头的省团队账户
     示例:7440000 → "广东省团队 (7440000)"
   - SystemAccountsTab.tsx: 详细明细表格新增"来源用户"列

效果:
- 省团队收益明细现在显示:时间、账户(省名称)、来源用户、订单号、金额、状态
- 账户列显示格式:"{省名}省团队 ({账户序列号})"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-05 17:35:22 -08:00
parent 04d3b2470a
commit d29454fc74
4 changed files with 16 additions and 3 deletions

View File

@ -70,9 +70,11 @@ export interface AllRewardTypeSummaries {
}
// [2026-01-06] 新增:收益记录条目
// [2026-02-05] 更新:添加 sourceAccountSequence 字段
export interface RewardEntryDTO {
id: string;
accountSequence: string;
sourceAccountSequence: string | null; // 来源用户账户序列号
sourceOrderId: string;
rightType: string;
rewardStatus: string;

View File

@ -1333,6 +1333,7 @@ export class RewardApplicationService {
entries: Array<{
id: string;
accountSequence: string;
sourceAccountSequence: string | null; // [2026-02-05] 新增:来源用户账户序列号
sourceOrderId: string;
rightType: string;
rewardStatus: string;
@ -1376,6 +1377,8 @@ export class RewardApplicationService {
entries: entries.map(entry => ({
id: entry.id.toString(),
accountSequence: entry.accountSequence,
// [2026-02-05] 新增:返回来源用户的账户序列号
sourceAccountSequence: entry.sourceAccountSequence ?? null,
sourceOrderId: entry.sourceOrderNo,
rightType: entry.rightType,
rewardStatus: entry.rewardStatus,

View File

@ -1600,6 +1600,8 @@ function RewardTypeSummarySection({
<tr>
<th></th>
<th></th>
{/* [2026-02-05] 新增:来源用户列,显示收益来自哪个用户的认种 */}
<th></th>
<th></th>
<th> (绿)</th>
<th></th>
@ -1611,6 +1613,8 @@ function RewardTypeSummarySection({
<td>{new Date(entry.createdAt).toLocaleString('zh-CN')}</td>
{/* [2026-01-07] 更新:使用 getAccountDisplayName 显示账户名称和编码 */}
<td>{getAccountDisplayName(entry.accountSequence)}</td>
{/* [2026-02-05] 新增:显示来源用户账户序列号 */}
<td>{entry.sourceAccountSequence ?? '-'}</td>
<td className={styles.orderId}>{entry.sourceOrderId}</td>
<td>{formatAmount(entry.usdtAmount)}</td>
<td>

View File

@ -316,6 +316,7 @@ export const FEE_TYPE_LABELS: Record<string, string> = {
export interface RewardEntryDTO {
id: string;
accountSequence: string;
sourceAccountSequence: string | null; // [2026-02-05] 新增:来源用户账户序列号
sourceOrderId: string;
rightType: string;
rewardStatus: string;
@ -659,9 +660,9 @@ export function getAccountDisplayName(accountSequence: string): string {
}
}
}
// 检查是否是7位数字的区域账户序列号8330100 或 9330000
// 检查是否是7位数字的区域账户序列号7440000省团队、8330100市区域、9330000省区域
if (/^\d{7}$/.test(accountSequence)) {
// 8开头是市区域账户9开头是省区域账户
// 7开头是省团队账户8开头是市区域账户9开头是省区域账户
const prefix = accountSequence.charAt(0);
const regionCode = accountSequence.substring(1); // 后6位是区域代码
const provinceCode = regionCode.substring(0, 2);
@ -677,7 +678,10 @@ export function getAccountDisplayName(accountSequence: string): string {
if (provinceName) {
const shortProvinceName = provinceName.replace(/省|市|自治区|特别行政区|壮族|回族|维吾尔/g, '');
if (prefix === '9') {
if (prefix === '7') {
// [2026-02-05] 新增省团队账户7开头
return `${shortProvinceName}省团队 (${accountSequence})`;
} else if (prefix === '9') {
// 省区域账户
return `${shortProvinceName}省级 (${accountSequence})`;
} else if (prefix === '8') {