This commit is contained in:
he
2023-04-06 14:02:54 +08:00
parent 0930b9116b
commit 3ae1d6d726
4 changed files with 15 additions and 3 deletions
@@ -569,6 +569,8 @@ namespace IRaCIS.Application.Services
/// <exception cref="BusinessValidationFailedException"></exception>
private async Task VerifyTaskIsSign(Guid visitTaskid)
{
var taskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskid).FirstNotNullAsync();
if (await _visitTaskRepository.AnyAsync(x => x.Id == visitTaskid && x.ReadingTaskState == ReadingTaskState.HaveSigned))
{
throw new BusinessValidationFailedException(_localizer["ReadingImage_BeSigned"]);
@@ -579,6 +581,17 @@ namespace IRaCIS.Application.Services
{
throw new BusinessValidationFailedException(_localizer["ReadingImage_Beinvalid"]);
}
if (await _visitTaskRepository.AnyAsync(x => x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
&&x.IsAnalysisCreate&&taskInfo.IsAnalysisCreate
&&x.SubjectId== taskInfo.SubjectId&&x.TaskState==TaskState.Effect&&
((x.ReReadingApplyState==ReReadingApplyState.DocotorHaveApplyed && x.DoctorUserId == taskInfo.DoctorUserId)|| x.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
))
{
throw new BusinessValidationFailedException(_localizer["ReadingImage_PresenceReview"]);
}
}