fix: 修复报备导入映射与审核跳转
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
hasValue,
|
||||
normalizeImageExtension,
|
||||
imageContentType,
|
||||
duplicateCoreMappingKind,
|
||||
} from './report-materials.helpers';
|
||||
import { ReportImportParserService } from './import-parser.service';
|
||||
import { compatibleImages, loadCompatibleWorkbook } from './workbook-compatibility';
|
||||
@@ -36,6 +37,17 @@ export class ReportImportReviewService {
|
||||
if (!batch) throw new NotFoundException('导入批次不存在');
|
||||
if (batch.status !== 'analyzed') throw new ConflictException('该导入批次已提交审核,不能重复导入');
|
||||
if (!data.mappings?.length) throw new BadRequestException('请至少配置一个导入字段映射');
|
||||
const duplicateCoreKind = duplicateCoreMappingKind(data.mappings);
|
||||
if (duplicateCoreKind) {
|
||||
const label = {
|
||||
signatureName: '短信签名',
|
||||
purpose: '签名用途/依据',
|
||||
siteName: '站点名称',
|
||||
url: '引流 URL 或号码',
|
||||
remark: '备注',
|
||||
}[duplicateCoreKind];
|
||||
throw new BadRequestException(`目标字段“${label}”只能映射一个源列`);
|
||||
}
|
||||
if (data.profile)
|
||||
await this.importParser.saveImportProfile({
|
||||
...data.profile,
|
||||
|
||||
Reference in New Issue
Block a user