裁判任务

This commit is contained in:
2022-06-21 13:46:03 +08:00
parent 6607b916bb
commit 689fb4d8e0
4 changed files with 13 additions and 8 deletions
@@ -40,7 +40,7 @@ namespace IRaCIS.Core.Application.Service
.ProjectTo<DoctorVisitTaskStatView>(_mapper.ConfigurationProvider);
var trialTaskConfig= _trialRepository.Where(t=>t.Id==queryTaskAllocationRule.TrialId).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider).FirstOrDefault();
var trialTaskConfig= _trialRepository.Where(t=>t.Id==queryTaskAllocationRule.TrialId).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider, new { isJudgeDoctor = queryTaskAllocationRule.IsJudgeDoctor }).FirstOrDefault();
return (await taskAllocationRuleQueryable.ToListAsync(), trialTaskConfig);
}
@@ -65,7 +65,7 @@ namespace IRaCIS.Core.Application.Service
{
var verifyExp1 = new EntityVerifyExp<TaskAllocationRule>()
{
VerifyExp = t => t.DoctorUserId == addOrEditTaskAllocationRule.DoctorUserId && t.TrialId== addOrEditTaskAllocationRule.TrialId,
VerifyExp = t => t.DoctorUserId == addOrEditTaskAllocationRule.DoctorUserId && t.TrialId== addOrEditTaskAllocationRule.TrialId && t.IsJudgeDoctor,
VerifyMsg = "已有该医生配置,不允许继续增加"
};
@@ -79,7 +79,7 @@ namespace IRaCIS.Core.Application.Service
[HttpDelete("{taskAllocationRuleId:guid}/{isJudgeDoctor:bool}")]
public async Task<IResponseOutput> DeleteTaskAllocationRule(Guid taskAllocationRuleId, bool isJudgeDoctor )
{
if(await _taskAllocationRuleRepository.Where(t => t.Id == taskAllocationRuleId && t.IsJudgeDoctor== isJudgeDoctor).AnyAsync(t => t.DoctorVisitTaskList.Count() > 0))
if(await _taskAllocationRuleRepository.Where(t => t.Id == taskAllocationRuleId ).AnyAsync(t => t.DoctorVisitTaskList.Where(t=>isJudgeDoctor?t.ArmEnum==Domain.Share.Arm.JudgeArm: t.ArmEnum != Domain.Share.Arm.JudgeArm).Count() > 0))
{
return ResponseOutput.NotOk("已分配任务给该医生,不允许删除");
}