修改
This commit is contained in:
+18
-25
@@ -792,40 +792,33 @@ namespace IRaCIS.Core.Application.Service
|
||||
var list = await GetIRMedicalFeedbackList(new GetIRMedicalFeedbackListInDto()
|
||||
{
|
||||
TrialId=inDto.TrialId,
|
||||
AuditState= MedicalReviewAuditState.Auditing,
|
||||
TrialReadingCriterionId=inDto.TrialReadingCriterionId,
|
||||
SubjectId=inDto.SubjectId,
|
||||
PageIndex=1,
|
||||
PageSize=1,
|
||||
PageSize=99999,
|
||||
});
|
||||
|
||||
var index = list.CurrentPageData.ToList().FindIndex(x => x.Id == inDto.TaskMedicalReviewId);
|
||||
|
||||
if (list.CurrentPageData.Count() == 0)
|
||||
var result = new GetIRMedicalFeedbackListOutDto() { };
|
||||
|
||||
if (index + 1 == list.CurrentPageData.Count()) // 最后一个
|
||||
{
|
||||
list = await GetIRMedicalFeedbackList(new GetIRMedicalFeedbackListInDto()
|
||||
{
|
||||
TrialId = inDto.TrialId,
|
||||
AuditState = MedicalReviewAuditState.Auditing,
|
||||
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
|
||||
PageIndex = 1,
|
||||
PageSize = 1,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (list.CurrentPageData.Count() > 0)
|
||||
{
|
||||
return list.CurrentPageData[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["MedicalReview_IRFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
else if (index == -1 || list.CurrentPageData.Count == 1) // 第一个或者只有一个
|
||||
{
|
||||
if (list.CurrentPageData[0].Id == inDto.TaskMedicalReviewId)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["MedicalReview_IRFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||
}
|
||||
result = list.CurrentPageData[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = list.CurrentPageData.Skip(index + 1).Take(1).First();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user