diff --git a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs index cbf2ea718..c6c7aa576 100644 --- a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs @@ -103,6 +103,12 @@ namespace IRaCIS.Core.Application.Contracts public async Task AddOrUpdateQCQuestionConfigure(QCQuestionAddOrEdit addOrEditQCQuestionConfigure) { + if (await _qcQuestionRepository.AnyAsync(x => x.Id != addOrEditQCQuestionConfigure.Id && x.ShowOrder == addOrEditQCQuestionConfigure.ShowOrder)) + { + throw new BusinessValidationFailedException("序号重复,操作失败"); + + } + var entity = await _qcQuestionRepository.InsertOrUpdateAsync(addOrEditQCQuestionConfigure, true); return ResponseOutput.Ok(entity.Id.ToString()); }