diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index d56326c42..a4aa159cf 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -10,6 +10,7 @@ using Medallion.Threading; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; +using Org.BouncyCastle.Asn1.Cmp; using System.ComponentModel.DataAnnotations; using System.Data; @@ -268,6 +269,12 @@ namespace IRaCIS.Core.Application.Image.QA throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBack"]); } + if (_qcChallengeRepository.Any(t => t.SubjectVisitId == subjectVisitId && t.IsClosed==false && t.ReuploadEnum==QCChanllengeReuploadEnum.CRCRequestReupload )) + { + throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]); + } + + var sv = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException(); if (sv.RequestBackState == RequestBackStateEnum.CRC_RequestBack) @@ -547,13 +554,13 @@ namespace IRaCIS.Core.Application.Image.QA if (await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).AnyAsync(t => t.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None))) { // 该访视已在其他途径申请影像回退中,不允许申请 - throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBack"]); + throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]); } if (sv.RequestBackState == RequestBackStateEnum.CRC_RequestBack) { // 该访视已在其他途径申请影像回退中,不允许申请 - throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBack"]); + throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]); } @@ -2324,13 +2331,13 @@ namespace IRaCIS.Core.Application.Image.QA if (await _subjectVisitRepository.Where(t => t.Id == sv.Id).AnyAsync(t => t.SubjectVisitImageBackRecordList.Any(t => t.ImageBackState == ImageBackStateEnum.None))) { // 该访视已在其他途径申请影像回退中,不允许申请 - throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBack"]); + throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]); } if (sv.RequestBackState == RequestBackStateEnum.CRC_RequestBack) { // 该访视已在其他途径申请影像回退中,不允许申请 - throw new BusinessValidationFailedException(_localizer["QCOperation_HaveApplyedImageBack"]); + throw new BusinessValidationFailedException(_localizer["QCOperation_SomeOneHaveApplyedImageBack"]); } if (qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.None && qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.CRCReuploaded)