修复bug
parent
0bd363d99c
commit
1c3462470b
|
@ -152,7 +152,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
#region 验证历史任务
|
||||
|
||||
if (_taskAllocationRuleRepository.Where(t => t.TrialId == trialId && t.IsEnable && t.IsJudgeDoctor == false).Count() < 2)
|
||||
if (_taskAllocationRuleRepository.Where(t => t.TrialId == trialId && t.IsEnable).Count() < 2)
|
||||
{
|
||||
throw new BusinessValidationFailedException("能参与读片的医生数量必须>=2,自动分配任务中止");
|
||||
|
||||
|
@ -160,7 +160,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
|
||||
if (!(assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) || ! assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2)))
|
||||
if (!(assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2)))
|
||||
{
|
||||
throw new BusinessValidationFailedException("该受试者阅片医生未配置完成");
|
||||
|
||||
|
|
|
@ -639,29 +639,7 @@ namespace IRaCIS.Core.Application
|
|||
return ResponseOutput.Ok(await _trialRepository.SaveChangesAsync());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 配置项目 裁判任务 分配规则
|
||||
/// </summary>
|
||||
/// <param name="trialConfig"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
public async Task<IResponseOutput> ConfigJudgeTaskAllocateRule(TrialJudgeTaskConfig trialConfig)
|
||||
{
|
||||
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();
|
||||
|
||||
_mapper.Map(trialConfig, trialInfo);
|
||||
|
||||
if (_taskAllocationRuleRepository.Where(t => t.TrialId == trialConfig.TrialId && t.IsEnable && t.IsJudgeDoctor ).Sum(t => t.PlanReadingRatio) != 100)
|
||||
{
|
||||
return ResponseOutput.NotOk("已启用医生比率不为百分之100");
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(await _trialRepository.SaveChangesAsync());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue