diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index d5fbdd663..f04a8e6f8 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -513,12 +513,7 @@ namespace IRaCIS.Core.API.Controllers [Authorize(Policy = IRaCISPolicy.PM_APM)] public async Task UploadVisitCheckExcel(Guid trialId ) { - if (_repository.Where(t => t.TrialId == trialId && t.IsEnable).Count() <2) - { - return ResponseOutput.NotOk("能参与读片的医生数量必须大于2"); - } - - + var (serverFilePath, relativePath, fileName) = (string.Empty, string.Empty, string.Empty); await FileUploadAsync(async (realFileName) => { diff --git a/IRaCIS.Core.Application/Triggers/SubjectVisitCheckPassedTrigger.cs b/IRaCIS.Core.Application/Triggers/SubjectVisitCheckPassedTrigger.cs index 3d7163ed0..4e9813dac 100644 --- a/IRaCIS.Core.Application/Triggers/SubjectVisitCheckPassedTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/SubjectVisitCheckPassedTrigger.cs @@ -49,6 +49,11 @@ namespace IRaCIS.Core.Application.Triggers if (context.UnmodifiedEntity?.CheckState != subjectVisit.CheckState && subjectVisit.CheckState == CheckStateEnum.CVPassed) { + if (_taskAllocationRuleRepository.Where(t => t.TrialId == subjectVisit.TrialId && t.IsEnable).Count() < 2) + { + throw new BusinessValidationFailedException("能参与读片的医生数量必须大于2"); + } + var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == subjectVisit.TrialId).Select(t => t.Code).DefaultIfEmpty().Max(); var cacheMaxCodeInt = _provider.Get($"{subjectVisit.TrialId }_{ StaticData.CacheKey.TaskMaxCode}").Value;