From d29454fc7472a99253f33d97c86181bffcfba679 Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 5 Feb 2026 17:35:22 -0800 Subject: [PATCH] =?UTF-8?q?feat(admin-web):=20=E7=9C=81=E5=9B=A2=E9=98=9F?= =?UTF-8?q?=E6=94=B6=E7=9B=8A=E6=B1=87=E6=80=BB=E6=98=8E=E7=BB=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9D=A5=E6=BA=90=E7=94=A8=E6=88=B7=E5=88=97=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B4=A6=E6=88=B7=E5=90=8D=E7=A7=B0=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题描述: 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 --- .../external/reward-service/reward-service.client.ts | 2 ++ .../application/services/reward-application.service.ts | 3 +++ .../system-account-report/SystemAccountsTab.tsx | 4 ++++ frontend/admin-web/src/types/system-account.types.ts | 10 +++++++--- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/backend/services/reporting-service/src/infrastructure/external/reward-service/reward-service.client.ts b/backend/services/reporting-service/src/infrastructure/external/reward-service/reward-service.client.ts index 73565245..151e5a67 100644 --- a/backend/services/reporting-service/src/infrastructure/external/reward-service/reward-service.client.ts +++ b/backend/services/reporting-service/src/infrastructure/external/reward-service/reward-service.client.ts @@ -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; diff --git a/backend/services/reward-service/src/application/services/reward-application.service.ts b/backend/services/reward-service/src/application/services/reward-application.service.ts index af7bb5b9..2bb0a8db 100644 --- a/backend/services/reward-service/src/application/services/reward-application.service.ts +++ b/backend/services/reward-service/src/application/services/reward-application.service.ts @@ -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, diff --git a/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx b/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx index ccc25696..16f26ca0 100644 --- a/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx +++ b/frontend/admin-web/src/components/features/system-account-report/SystemAccountsTab.tsx @@ -1600,6 +1600,8 @@ function RewardTypeSummarySection({ 时间 账户 + {/* [2026-02-05] 新增:来源用户列,显示收益来自哪个用户的认种 */} + 来源用户 订单号 金额 (绿积分) 状态 @@ -1611,6 +1613,8 @@ function RewardTypeSummarySection({ {new Date(entry.createdAt).toLocaleString('zh-CN')} {/* [2026-01-07] 更新:使用 getAccountDisplayName 显示账户名称和编码 */} {getAccountDisplayName(entry.accountSequence)} + {/* [2026-02-05] 新增:显示来源用户账户序列号 */} + {entry.sourceAccountSequence ?? '-'} {entry.sourceOrderId} {formatAmount(entry.usdtAmount)} diff --git a/frontend/admin-web/src/types/system-account.types.ts b/frontend/admin-web/src/types/system-account.types.ts index 704fd84a..4b4caf79 100644 --- a/frontend/admin-web/src/types/system-account.types.ts +++ b/frontend/admin-web/src/types/system-account.types.ts @@ -316,6 +316,7 @@ export const FEE_TYPE_LABELS: Record = { 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') {