修改生效接口
parent
ac4fce8648
commit
764feb00d5
|
@ -265,7 +265,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public List<Guid> SubjectIdList { get; set; }
|
||||
|
||||
public List<DoctorArm> DoctorUserIdArmList { get; set; }
|
||||
public List<DoctorArm> DoctorUserIdArmList { get; set; } = new List<DoctorArm>();
|
||||
}
|
||||
|
||||
public class DoctorArm
|
||||
|
@ -294,7 +294,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
{
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
public List<Guid> DoctorUserIdList { get; set; } = new List<Guid>();
|
||||
public List<DoctorArm> DoctorUserIdArmList { get; set; } = new List<DoctorArm>();
|
||||
}
|
||||
|
||||
public class AutoSubjectAssignCommand
|
||||
|
|
|
@ -425,49 +425,37 @@ namespace IRaCIS.Core.Application.Service
|
|||
var subjectId = subjectTaskGroup.Key;
|
||||
|
||||
//如果数据为空 那么就是确认所有已分配的
|
||||
List<Guid> subjectDoctorIdList = new List<Guid>();
|
||||
List<DoctorArm> subjectDoctorIdArmList = new List<DoctorArm>();
|
||||
|
||||
if (assignConfirmCommand.SubjectDoctorUserList.Count == 0)
|
||||
{
|
||||
|
||||
subjectDoctorIdList = _subjectUserRepository.Where(t => t.SubjectId == subjectId).Select(t => t.DoctorUserId).ToList();
|
||||
subjectDoctorIdArmList = _subjectUserRepository.Where(t => t.SubjectId == subjectId).Select(t => new DoctorArm() { DoctorUserId=t.DoctorUserId, ArmEnum=t.ArmEnum } ).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
subjectDoctorIdList = assignConfirmCommand.SubjectDoctorUserList.Where(t => t.SubjectId == subjectId).First().DoctorUserIdList;
|
||||
subjectDoctorIdArmList = assignConfirmCommand.SubjectDoctorUserList.Where(t => t.SubjectId == subjectId).First().DoctorUserIdArmList;
|
||||
|
||||
}
|
||||
|
||||
|
||||
foreach (var task in subjectTaskGroup.OrderBy(t => t.ArmEnum).ToList())
|
||||
{
|
||||
//单重阅片
|
||||
if (task.ArmEnum == 0)
|
||||
{
|
||||
if (subjectDoctorIdList.Count() == 0)
|
||||
{
|
||||
throw new BusinessValidationFailedException("当前提交的数据,有Subject 未绑定医生");
|
||||
}
|
||||
|
||||
task.DoctorUserId = subjectDoctorIdList.FirstOrDefault();
|
||||
}
|
||||
//双重阅片 任务1
|
||||
else if (task.ArmEnum == 1)
|
||||
{
|
||||
if (subjectDoctorIdList.Count() != 2)
|
||||
{
|
||||
throw new BusinessValidationFailedException("当前提交的数据,有Subject绑定的医生数量不是2个");
|
||||
}
|
||||
var subjectDoctorArm = subjectDoctorIdArmList.Where(t => t.ArmEnum == task.ArmEnum).FirstOrDefault();
|
||||
|
||||
task.DoctorUserId = subjectDoctorIdList.FirstOrDefault();
|
||||
}
|
||||
else if (task.ArmEnum == 2)
|
||||
if(subjectDoctorArm != null)
|
||||
{
|
||||
task.DoctorUserId = subjectDoctorIdList.Skip(1).FirstOrDefault();
|
||||
task.DoctorUserId = subjectDoctorArm.DoctorUserId;
|
||||
task.AllocateTime = DateTime.Now;
|
||||
task.TaskState = TaskState.Allocated;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BusinessValidationFailedException("当前提交 Subject 以及医生所在Arm 与任务的Arm不一致,无法绑定,请核对数据");
|
||||
}
|
||||
|
||||
task.AllocateTime = DateTime.Now;
|
||||
task.TaskState = TaskState.Allocated;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue