Uat_Study
parent
e262e7cebb
commit
349839913c
|
@ -345,6 +345,50 @@ namespace IRaCIS.Core.Application
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 验证签名确认
|
||||
/// </summary>
|
||||
/// <param name="signConfirmDTO"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> VerifyTrialConfigSignatureConfirm(SignConfirmDTO signConfirmDTO)
|
||||
{
|
||||
var trialConfig = (await _trialRepository
|
||||
.Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification })
|
||||
.FirstOrDefaultAsync(t => t.TrialId == signConfirmDTO.TrialId))
|
||||
.IfNullThrowException();
|
||||
|
||||
|
||||
var showOrderList = await _repository.Where<TrialQCQuestion>(t => t.TrialId == signConfirmDTO.TrialId).Select(t =>
|
||||
new { t.ShowOrder, ParentShowOrder = (int?)t.ParentQCQuestion.ShowOrder }).ToListAsync();
|
||||
|
||||
if (trialConfig.QCProcessEnum ==
|
||||
TrialQCProcess.DoubleAudit || trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
|
||||
{
|
||||
if (showOrderList.Count == 0)
|
||||
{
|
||||
throw new BusinessValidationFailedException("当前未添加影像质控审核问题。请先添加影像质控审核问题,再进行确认。");
|
||||
}
|
||||
}
|
||||
|
||||
if (showOrderList.Count() != showOrderList.Select(t => t.ShowOrder).Distinct().Count())
|
||||
{
|
||||
throw new BusinessValidationFailedException("影像质控审核问题显示序号不能重复。");
|
||||
}
|
||||
|
||||
if (showOrderList.Where(t => t.ParentShowOrder != null).Any(t => t.ParentShowOrder > t.ShowOrder))
|
||||
{
|
||||
throw new BusinessValidationFailedException("父问题的显示序号要比子问题的显示序号小,请确认。");
|
||||
}
|
||||
|
||||
if (await _trialRepository.AnyAsync(t => t.Id == signConfirmDTO.TrialId && t.QCQuestionConfirmedUserId != null && t.QCQuestionConfirmedUserId != _userInfo.Id))
|
||||
{
|
||||
throw new BusinessValidationFailedException("影像质控审核问题已被其他人员确认,不允许再次确认。");
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue