qc问题 限制
This commit is contained in:
@@ -18,6 +18,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
}
|
||||
|
||||
|
||||
#region 处理方式多选过滤条件
|
||||
|
||||
private Expression<Func<SubjectVisit, bool>> GetSubjectVisitFilter(string[]? VisitPlanArray)
|
||||
{
|
||||
Expression<Func<SubjectVisit, bool>> svExpression = x => true;
|
||||
@@ -71,6 +73,9 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
return svExpression;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region CRC上传、质疑页面
|
||||
/// <summary>
|
||||
/// CRC 访视上传列表
|
||||
|
||||
@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Http;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
|
||||
namespace IRaCIS.Core.Application
|
||||
{
|
||||
@@ -108,7 +109,7 @@ namespace IRaCIS.Core.Application
|
||||
|
||||
if (!await _trialRepository.AnyAsync(t => t.Id == signConfirmDTO.TrialId && (t.TrialStatusStr == StaticData.TrialInitializing|| t.TrialStatusStr == StaticData.TrialOngoing)))
|
||||
{
|
||||
return ResponseOutput.NotOk("项目不在Initializing/Ongoing,不允许确认配置");
|
||||
throw new BusinessValidationFailedException("项目不在Initializing/Ongoing,不允许确认配置");
|
||||
}
|
||||
|
||||
if (signConfirmDTO.SignCode == ((int)SignEnum.TrialLogicConfim).ToString())
|
||||
@@ -126,17 +127,35 @@ namespace IRaCIS.Core.Application
|
||||
|
||||
else if (signConfirmDTO.SignCode == ((int)SignEnum.TrialQCQuestionConfirm).ToString())
|
||||
{
|
||||
|
||||
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())
|
||||
{
|
||||
return ResponseOutput.NotOk("QC问题显示序号不允许重复");
|
||||
throw new BusinessValidationFailedException("QC问题显示序号不允许重复");
|
||||
}
|
||||
|
||||
if (showOrderList.Where(t=>t.ParentShowOrder != null).Any(t => t.ParentShowOrder > t.ShowOrder))
|
||||
{
|
||||
return ResponseOutput.NotOk("父问题的序号要比子问题序号小,请确认");
|
||||
throw new BusinessValidationFailedException("父问题的序号要比子问题序号小,请确认");
|
||||
}
|
||||
|
||||
await _trialRepository.BatchUpdateAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = DateTime.Now, QCQuestionConfirmedUserId = _userInfo.Id, IsQCQuestionConfirmed = true });
|
||||
|
||||
Reference in New Issue
Block a user