重新发布任务分配算法
parent
aa5846a784
commit
a340b0f217
|
@ -751,8 +751,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//仅仅分配未应用的
|
//仅仅分配未应用的 而且 没有没有分配医生的
|
||||||
foreach (var subject in subjectList.Where(t => t.IsApplyed == false))
|
foreach (var subject in subjectList.Where(t => t.IsApplyed == false && !t.DoctorUserList.Any()))
|
||||||
{
|
{
|
||||||
//该Subject 已经分配的医生数量
|
//该Subject 已经分配的医生数量
|
||||||
var hasAssignDoctorCount = subject.DoctorUserList.Count();
|
var hasAssignDoctorCount = subject.DoctorUserList.Count();
|
||||||
|
@ -818,23 +818,29 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = allocateDoctorList[0].DoctorUserId, ArmEnum = doctor1Arm, AssignTime = DateTime.Now });
|
//if(!waitAllocationDoctorList.Where(t=>t.DoctorUserId== allocateDoctorList[0].DoctorUserId).SelectMany(u => u.SubjectArmList).Any(t => t.SubjectId == subject.SubjectId))
|
||||||
|
//{
|
||||||
|
await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = allocateDoctorList[0].DoctorUserId, ArmEnum = doctor1Arm, AssignTime = DateTime.Now });
|
||||||
|
|
||||||
|
waitAllocationDoctorList.FirstOrDefault(t => t.DoctorUserId == allocateDoctorList[0].DoctorUserId).SubjectArmList.Add(new SubjectArm()
|
||||||
|
{
|
||||||
|
SubjectId = subject.SubjectId,
|
||||||
|
ArmEnum = doctor1Arm
|
||||||
|
});
|
||||||
|
//}
|
||||||
|
|
||||||
await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = allocateDoctorList[1].DoctorUserId, ArmEnum = doctor2Arm, AssignTime = DateTime.Now });
|
//if (!waitAllocationDoctorList.Where(t => t.DoctorUserId == allocateDoctorList[1].DoctorUserId).SelectMany(u => u.SubjectArmList).Any(t => t.SubjectId == subject.SubjectId))
|
||||||
|
//{
|
||||||
|
await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = allocateDoctorList[1].DoctorUserId, ArmEnum = doctor2Arm, AssignTime = DateTime.Now });
|
||||||
|
|
||||||
|
waitAllocationDoctorList.FirstOrDefault(t => t.DoctorUserId == allocateDoctorList[1].DoctorUserId).SubjectArmList.Add(new SubjectArm()
|
||||||
|
{
|
||||||
|
SubjectId = subject.SubjectId,
|
||||||
|
ArmEnum = doctor2Arm
|
||||||
|
});
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
waitAllocationDoctorList.FirstOrDefault(t => t.DoctorUserId == allocateDoctorList[0].DoctorUserId).SubjectArmList.Add(new SubjectArm()
|
|
||||||
{
|
|
||||||
SubjectId = subject.SubjectId,
|
|
||||||
ArmEnum = doctor1Arm
|
|
||||||
});
|
|
||||||
|
|
||||||
waitAllocationDoctorList.FirstOrDefault(t => t.DoctorUserId == allocateDoctorList[1].DoctorUserId).SubjectArmList.Add(new SubjectArm()
|
|
||||||
{
|
|
||||||
SubjectId = subject.SubjectId,
|
|
||||||
ArmEnum = doctor2Arm
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue