任务提交

Uat_Study
hang 2022-06-08 17:45:38 +08:00
parent 543c8c4ccb
commit 596bb9fa99
2 changed files with 15 additions and 11 deletions

View File

@ -44,7 +44,7 @@ namespace IRaCIS.Core.Application.ViewModel
public Guid DoctorUserId { get; set; }
public List<int> ArmList { get; set; }
public List<int> ArmList { get; set; } = new List<int>();
//public double? TargetCount => TotalTaskCount * PlanReadingRatio * 0.01;

View File

@ -122,27 +122,31 @@ namespace IRaCIS.Core.Application.Triggers
{
//排除已经入选其他Arm的阅片人
//是否有做过Arm1的医生
if (allocateStat.Any(t => t.ArmList.Any(t => t == 1)))
//是否有做过Arm1的医生 有新的医生未分配 按照最优法找
if (allocateStat.Any(t => t.ArmList.Any(t => t == 1)) && !allocateStat.Any(t=>t.ArmList.Count==0))
{
//找到最优的需要分配任务的医生
task1.DoctorUserId = allocateStat.Where(t => t.ArmList.Any(t => t == 1)).OrderByDescending(t=>t.PlanReadingRatio).ThenBy(t => t.TotalTaskCount * t.PlanReadingRatio * 0.01 - t.TotalTaskCount).FirstOrDefault().DoctorUserId;
task1.DoctorUserId = allocateStat.Where(t => t.ArmList.Any(t => t == 1)).OrderByDescending(t => t.TotalTaskCount * t.PlanReadingRatio * 0.01 - t.SelfTaskCount).ThenByDescending(t => t.PlanReadingRatio).FirstOrDefault().DoctorUserId;
}
else
{
task1.DoctorUserId = allocateStat.OrderByDescending(t => t.PlanReadingRatio).ThenBy(t => t.TotalTaskCount * t.PlanReadingRatio * 0.01 - t.TotalTaskCount).FirstOrDefault().DoctorUserId;
//找到最优的需要分配任务的医生
task1.DoctorUserId = allocateStat.OrderByDescending(t => t.TotalTaskCount * t.PlanReadingRatio * 0.01 - t.SelfTaskCount).ThenByDescending(t => t.PlanReadingRatio).FirstOrDefault().DoctorUserId;
allocateStat.FirstOrDefault(t => t.DoctorUserId == task1.DoctorUserId).ArmList.Add(1);
}
//是否有做过Arm2的医生
if (allocateStat.Any(t => t.ArmList.Any(t => t == 2)))
//是否有做过Arm2的医生 有新的医生未分配 按照最优法找
if (allocateStat.Any(t => t.ArmList.Any(t => t == 2)) && !allocateStat.Any(t => t.ArmList.Count == 0))
{
//找到最优的需要分配任务的医生
task2.DoctorUserId = allocateStat.Where(t => t.ArmList.Any(t => t == 2)).OrderByDescending(t => t.PlanReadingRatio).ThenBy(t => t.TotalTaskCount * t.PlanReadingRatio * 0.01 - t.TotalTaskCount).FirstOrDefault().DoctorUserId;
task2.DoctorUserId = allocateStat.Where(t => t.ArmList.Any(t => t == 2)).OrderByDescending(t => t.TotalTaskCount * t.PlanReadingRatio * 0.01 - t.SelfTaskCount).ThenByDescending(t => t.PlanReadingRatio).FirstOrDefault().DoctorUserId;
}
else
{
task2.DoctorUserId = allocateStat.OrderByDescending(t => t.PlanReadingRatio).ThenBy(t => t.TotalTaskCount * t.PlanReadingRatio * 0.01 - t.TotalTaskCount).Skip(1).FirstOrDefault().DoctorUserId;
//找到最优的需要分配任务的医生
task2.DoctorUserId = allocateStat.OrderByDescending(t => t.TotalTaskCount * t.PlanReadingRatio * 0.01 - t.SelfTaskCount).ThenByDescending(t => t.PlanReadingRatio).Skip(1).FirstOrDefault().DoctorUserId;
}
}