From 2d9d6ceed7c6dfa639b5bf5e05b796c5d11f9204 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 6 Jan 2026 21:29:14 -0800 Subject: [PATCH] =?UTF-8?q?feat(admin-web):=20=E7=B3=BB=E7=BB=9F=E8=B4=A6?= =?UTF-8?q?=E6=88=B7=E6=98=BE=E7=A4=BA=E6=AD=A3=E5=BC=8F=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=B9=B6=E4=BF=9D=E7=95=99=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 SYSTEM_ACCOUNT_NAMES 映射:S0000000001-S0000000006 映射到正式名称 - 添加 PROVINCE_CODE_NAMES 映射:中国省份行政区划代码映射 - 添加 getAccountDisplayName 函数:统一显示格式 "名称 (编码)" - FixedAccountsSection: 固定账户显示为 "总部账户 (S0000000001)" 格式 - RegionAccountsSection: 区域账户合并显示名称和编码 - LedgerAccountCard: 分类账卡片显示完整账户信息 - FeeAccountSection: 手续费归集账户显示正式名称 - RewardTypeSummarySection: 收益明细显示账户正式名称 - OfflineSettlementSection: 面对面结算明细显示账户正式名称 回滚方式:恢复 imports,删除映射常量和 getAccountDisplayName 函数 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../SystemAccountsTab.tsx | 50 ++++---- .../src/types/system-account.types.ts | 119 ++++++++++++++++++ 2 files changed, 146 insertions(+), 23 deletions(-) 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 f966600d..ecb027bf 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 @@ -26,7 +26,7 @@ import type { OfflineSettlementEntriesResponse, OfflineSettlementEntryDTO, } from '@/types'; -import { ENTRY_TYPE_LABELS, ACCOUNT_TYPE_LABELS, FEE_TYPE_LABELS, REWARD_RIGHT_TYPE_LABELS, REWARD_STATUS_LABELS, FEE_COLLECTION_TYPE_LABELS } from '@/types'; +import { ENTRY_TYPE_LABELS, ACCOUNT_TYPE_LABELS, FEE_TYPE_LABELS, REWARD_RIGHT_TYPE_LABELS, REWARD_STATUS_LABELS, FEE_COLLECTION_TYPE_LABELS, getAccountDisplayName, SYSTEM_ACCOUNT_NAMES, PROVINCE_CODE_NAMES } from '@/types'; import styles from './SystemAccountsTab.module.scss'; /** @@ -296,23 +296,23 @@ export default function SystemAccountsTab() { * [2026-01-05] 更新:根据业务需求调整显示名称,USDT改为绿积分 */ function FixedAccountsSection({ data }: { data: SystemAccountReportResponse['fixedAccounts'] }) { + // [2026-01-07] 更新:使用 SYSTEM_ACCOUNT_NAMES 映射获取正式名称 const accounts = [ - { key: 'costAccount', label: '总部储备', sequence: 'S0000000001', data: data.costAccount }, - { key: 'operationAccount', label: '运营账户1', sequence: 'S0000000002', data: data.operationAccount }, - { key: 'hqCommunity', label: '运营账户2', sequence: 'S0000000003', data: data.hqCommunity }, - { key: 'rwadPoolPending', label: '积分股池', sequence: 'S0000000004', data: data.rwadPoolPending }, - { key: 'platformFee', label: '平台手续费', sequence: 'S0000000005', data: data.platformFee }, + { key: 'costAccount', sequence: 'S0000000001', data: data.costAccount }, + { key: 'operationAccount', sequence: 'S0000000002', data: data.operationAccount }, + { key: 'hqCommunity', sequence: 'S0000000003', data: data.hqCommunity }, + { key: 'rwadPoolPending', sequence: 'S0000000004', data: data.rwadPoolPending }, + { key: 'platformFee', sequence: 'S0000000005', data: data.platformFee }, ]; return (

固定系统账户

- {accounts.map(({ key, label, sequence, data: accountData }) => ( + {accounts.map(({ key, sequence, data: accountData }) => (
- {label} - {sequence} + {getAccountDisplayName(sequence)}
@@ -374,8 +374,7 @@ function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; ty - - + @@ -384,8 +383,8 @@ function RegionAccountsSection({ data, type }: { data: RegionAccountsSummary; ty {data.accounts.map((account) => ( - - + {/* [2026-01-07] 更新:合并显示区域名称和编码 */} + {entriesData.entries.map((entry) => ( - + {/* [2026-01-07] 更新:使用 getAccountDisplayName 显示账户名称和编码 */} + @@ -704,14 +704,15 @@ function LedgerSection({ {/* 固定系统账户分类账 */} + {/* [2026-01-07] 更新:使用 getAccountDisplayName 显示账户名称和编码 */} {data.fixedAccountsLedger && data.fixedAccountsLedger.length > 0 && (

固定系统账户

{data.fixedAccountsLedger.map((account) => ( ( (
{title} - {subtitle} + {/* [2026-01-07] 更新:subtitle 为空时不显示 */} + {subtitle && {subtitle}}
{total} 条记录 @@ -957,9 +959,10 @@ function FeeAccountSection({
{/* 账户信息 */} + {/* [2026-01-07] 更新:使用 getAccountDisplayName 显示账户名称和编码 */}
手续费归集账户: - {data.accountSequence} + {getAccountDisplayName(data.accountSequence)}
{/* 汇总卡片 */} @@ -1323,7 +1326,8 @@ function RewardTypeSummarySection({ {detailsData.entries.map((entry) => (
- + {/* [2026-01-07] 更新:使用 getAccountDisplayName 显示账户名称和编码 */} +
区域代码区域名称区域 余额 (绿积分) 累计收入 (绿积分) 状态
{account.regionCode || '-'}{account.regionName || '-'}{account.regionName ? `${account.regionName} (${account.regionCode})` : account.regionCode || '-'} {formatAmount(account.usdtBalance)} {formatAmount(account.totalReceived)} @@ -519,7 +518,8 @@ function OfflineSettlementSection({ data }: { data: SystemAccountReportResponse[
{entry.accountSequence}{getAccountDisplayName(entry.accountSequence)} {formatAmount(entry.amount)} {entry.memo || '-'} {new Date(entry.createdAt).toLocaleString('zh-CN')}
{new Date(entry.createdAt).toLocaleString('zh-CN')}{entry.accountSequence}{getAccountDisplayName(entry.accountSequence)} {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 2d8de42b..f1ead3a1 100644 --- a/frontend/admin-web/src/types/system-account.types.ts +++ b/frontend/admin-web/src/types/system-account.types.ts @@ -380,3 +380,122 @@ export const FEE_COLLECTION_TYPE_LABELS: Record = { FIAT_WITHDRAWAL_FEE: '法币提现手续费', UNKNOWN: '未知类型', }; + +// [2026-01-07] 新增:系统账户名称映射 +/** + * 系统账户序列号到正式名称的映射 + */ +export const SYSTEM_ACCOUNT_NAMES: Record = { + 'S0000000001': '总部账户', + 'S0000000002': '成本账户', + 'S0000000003': '运营账户', + 'S0000000004': 'RWAD底池', + 'S0000000005': '分享权益池', + 'S0000000006': '手续费归集', +}; + +// [2026-01-07] 新增:省份行政区划代码映射 +/** + * 省份区域代码到名称的映射 + */ +export const PROVINCE_CODE_NAMES: Record = { + '11': '北京市', + '12': '天津市', + '13': '河北省', + '14': '山西省', + '15': '内蒙古自治区', + '21': '辽宁省', + '22': '吉林省', + '23': '黑龙江省', + '31': '上海市', + '32': '江苏省', + '33': '浙江省', + '34': '安徽省', + '35': '福建省', + '36': '江西省', + '37': '山东省', + '41': '河南省', + '42': '湖北省', + '43': '湖南省', + '44': '广东省', + '45': '广西壮族自治区', + '46': '海南省', + '50': '重庆市', + '51': '四川省', + '52': '贵州省', + '53': '云南省', + '54': '西藏自治区', + '61': '陕西省', + '62': '甘肃省', + '63': '青海省', + '64': '宁夏回族自治区', + '65': '新疆维吾尔自治区', + '71': '台湾省', + '81': '香港特别行政区', + '82': '澳门特别行政区', + // 带0000后缀的格式(某些系统可能使用) + '110000': '北京市', + '120000': '天津市', + '130000': '河北省', + '140000': '山西省', + '150000': '内蒙古自治区', + '210000': '辽宁省', + '220000': '吉林省', + '230000': '黑龙江省', + '310000': '上海市', + '320000': '江苏省', + '330000': '浙江省', + '340000': '安徽省', + '350000': '福建省', + '360000': '江西省', + '370000': '山东省', + '410000': '河南省', + '420000': '湖北省', + '430000': '湖南省', + '440000': '广东省', + '450000': '广西壮族自治区', + '460000': '海南省', + '500000': '重庆市', + '510000': '四川省', + '520000': '贵州省', + '530000': '云南省', + '540000': '西藏自治区', + '610000': '陕西省', + '620000': '甘肃省', + '630000': '青海省', + '640000': '宁夏回族自治区', + '650000': '新疆维吾尔自治区', + '710000': '台湾省', + '810000': '香港特别行政区', + '820000': '澳门特别行政区', +}; + +/** + * 获取账户显示名称(同时保留编码) + * 格式:名称 (编码) + */ +export function getAccountDisplayName(accountSequence: string): string { + // 检查是否是系统账户 + if (SYSTEM_ACCOUNT_NAMES[accountSequence]) { + return `${SYSTEM_ACCOUNT_NAMES[accountSequence]} (${accountSequence})`; + } + // 检查是否是7位数字的区域账户 + if (/^\d{7}$/.test(accountSequence)) { + const provinceCode = accountSequence.substring(0, 2); + const cityPart = accountSequence.substring(2, 4); + const provinceName = PROVINCE_CODE_NAMES[provinceCode]; + + if (provinceName) { + // 判断是省级还是市级账户 + if (cityPart === '00') { + // 省级账户 + return `${provinceName}(省级)(${accountSequence})`; + } else { + // 市级账户 - 显示省份简称 + 市级代码 + const shortProvinceName = provinceName.replace(/省|市|自治区|特别行政区|壮族|回族|维吾尔/g, ''); + return `${shortProvinceName}${cityPart}市 (${accountSequence})`; + } + } + } + return accountSequence; +}