From e84671038195240890cb816885055e29c8c40c73 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Sat, 7 May 2022 11:38:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/QCOperationService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index ade0e2710..250332b8c 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -974,10 +974,7 @@ namespace IRaCIS.Core.Application.Image.QA public async Task ObtainOrCancelQCTask(Guid trialId, Guid subjectVisitId, bool obtaionOrCancel) { - if (await _subjectVisitRepository.AnyAsync(t => t.CurrentActionUserId != null && t.IsTake && t.Id == subjectVisitId)) - { - throw new BusinessValidationFailedException("当前访视已被领取,不允许领取"); - } + var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException(); @@ -989,6 +986,10 @@ namespace IRaCIS.Core.Application.Image.QA if (obtaionOrCancel) { + if (await _subjectVisitRepository.AnyAsync(t => t.CurrentActionUserId != null && t.IsTake && t.Id == subjectVisitId)) + { + throw new BusinessValidationFailedException("当前访视已被领取,不允许领取"); + } if (await _subjectVisitRepository.AnyAsync(t => t.Trial.QCQuestionConfirmedUserId == null && t.Id == subjectVisitId)) {