feat: aggregate cmpp template mismatch reviews

This commit is contained in:
hectorzhao
2026-07-12 13:25:19 +08:00
parent c8b6d0aa7c
commit 8b6ec92f4f
17 changed files with 523 additions and 38 deletions
+9
View File
@@ -305,6 +305,10 @@ export type SmsBatchTask = {
id: string;
tenantId: string;
taskNo: string;
sourceType?: string;
contentHash?: string | null;
windowStartedAt?: string | null;
windowEndsAt?: string | null;
applicationId?: string | null;
templateId?: string | null;
content: string;
@@ -559,6 +563,10 @@ export type RiskReviewTask = {
applicationId?: string | null;
templateId?: string | null;
taskNo: string;
sourceType?: string;
contentHash?: string | null;
windowStartedAt?: string | null;
windowEndsAt?: string | null;
content: string;
category?: string | null;
phoneTotal: number;
@@ -574,6 +582,7 @@ export type RiskReviewTask = {
createdAt: string;
reviewedAt?: string | null;
riskHits?: Array<{ id: string; ruleName: string; reason: string }>;
_count?: { messageRecords: number };
};
export type TenantAccount = {
+6 -1
View File
@@ -15,6 +15,10 @@ const statusTone: Record<string, 'warning' | 'success' | 'danger'> = {
rejected: 'danger',
};
function sourceLabel(sourceType?: string) {
return sourceType === 'cmpp_template_mismatch' ? 'CMPP模板不匹配聚合' : '风控审核';
}
export function AdminSmsAuditPage() {
const [records, setRecords] = useState<RiskReviewTask[]>([]);
const [keyword, setKeyword] = useState('');
@@ -69,8 +73,9 @@ export function AdminSmsAuditPage() {
const columns: Array<TableColumn<RiskReviewTask>> = [
{ key: 'taskNo', title: '任务编号', width: '180px', render: (record) => <strong>{record.taskNo}</strong> },
{ key: 'sourceType', title: '审核来源', width: '180px', render: (record) => <Tag tone={record.sourceType === 'cmpp_template_mismatch' ? 'warning' : 'info'}>{sourceLabel(record.sourceType)}</Tag> },
{ key: 'content', title: '短信内容', render: (record) => <span className="table-long-text">{record.content}</span> },
{ key: 'phoneTotal', title: '号码数', width: '130px', render: (record) => record.phoneTotal.toLocaleString('zh-CN') },
{ key: 'phoneTotal', title: '聚合号码数', width: '140px', render: (record) => (record._count?.messageRecords ?? record.phoneTotal).toLocaleString('zh-CN') },
{ key: 'createdAt', title: '提交时间', width: '190px', render: (record) => record.createdAt },
{ key: 'reason', title: '审核原因', render: (record) => record.reviewReason ?? record.rejectReason ?? record.riskHits?.map((item) => item.reason).join('') ?? '-' },
{