diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs index 3f38e4f38..92ad7a234 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs @@ -169,6 +169,10 @@ namespace IRaCIS.Core.Application.Service if (index == -1 || data.CurrentPageData.Count == 1) { + if (data.CurrentPageData[0].Id == inDto.MedicalReviewId) + { + throw new BusinessValidationFailedException(_localizer["MedicalReview_Finish"]); + } result = data.CurrentPageData[0]; } else @@ -200,11 +204,14 @@ namespace IRaCIS.Core.Application.Service var taskMedicalReviewQueryable = _taskMedicalReviewRepository.Where(t => t.VisitTask.TrialId == inQuery.TrialId && t.MedicalManagerUserId == _userInfo.Id&&t.VisitTask.TrialReadingCriterionId==inQuery.TrialReadingCriterionId) .WhereIf(inQuery.IsGetNextMedicalReviewTask, - x=>( !x.IsInvalid&&x.AuditState!= MedicalReviewAuditState.HaveSigned & + x=>( + !x.IsInvalid&& x.AuditState== MedicalReviewAuditState.Auditing & ( x.ReadingMedicalReviewDialogList.Count()!=0&& x.ReadingMedicalReviewDialogList.Count()>0&& x.ReadingMedicalReviewDialogList.OrderByDescending(x=>x.CreateTime).FirstOrDefault().UserTypeEnumInt==(int)UserTypeEnum.IndependentReviewer) - ) ||x.Id == inQuery.Id // 这里必须找传入id 因为要找到这条的索引 获取下一条 + ) // 审核中最新回复为IR的 + || (!x.IsInvalid&& x.AuditState==MedicalReviewAuditState.WaitAudit) + ||x.Id == inQuery.Id // 这里必须找传入id 因为要找到这条的索引 获取下一条 ) .WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId) .WhereIf(inQuery.SiteId != null, t => t.VisitTask.Subject.SiteId == inQuery.SiteId)