diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index eb7ab84a6..b65f00a2a 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -519,7 +519,7 @@ namespace IRaCIS.Core.Application.Service if (hasAssignDoctorCount > 2) { - throw new BusinessValidationFailedException("当前有Subject绑定医生数量大于2"); + throw new BusinessValidationFailedException("双重阅片当前有Subject绑定医生数量大于2"); } } @@ -527,7 +527,7 @@ namespace IRaCIS.Core.Application.Service { if (hasAssignDoctorCount > 1) { - throw new BusinessValidationFailedException("当前有Subject绑定医生数量大于1"); + throw new BusinessValidationFailedException("单重阅片当前有Subject绑定医生数量大于1"); } } } @@ -536,6 +536,7 @@ namespace IRaCIS.Core.Application.Service //验证通过 给医生开始分配 + #region 按照医生维度分配Subject if (trialConfig.ReadingType == ReadingMethod.Single) { @@ -654,8 +655,6 @@ namespace IRaCIS.Core.Application.Service } - - //如果计划的数量 大于已经分配的数量 那么该医生 可以分配新的Subject if (planSubjectCount > hasAssignedSubjectCount) { @@ -722,64 +721,70 @@ namespace IRaCIS.Core.Application.Service - #region 完全按照Subject 遍历去分 - - //foreach (var subject in subjectList) - //{ - // //该Subject 已经分配的医生数量 - // var hasAssignDoctorCount = subject.DoctorUserIdList.Count(); - - // //分配两个医生 - // if (trialConfig.ReadingType == ReadingMethod.Double) - // { - // //await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = doctorUserId, AssignTime = DateTime.Now }); - - - // if (hasAssignDoctorCount == 0) - // { - - - - // } - // else if (hasAssignDoctorCount == 1) - // { - - // } - // else if (hasAssignDoctorCount == 2) - // { - - // } - // else - // { - // throw new BusinessValidationFailedException("当前有Subject绑定医生数量大于2"); - // } - - // } - // else if (trialConfig.ReadingType == ReadingMethod.Single) - // { - // if (hasAssignDoctorCount == 0) - // { - - // } - // else if (hasAssignDoctorCount == 1) - // { - - // } - // else - // { - // throw new BusinessValidationFailedException("当前有Subject绑定医生数量大于1"); - // } - // } - - //} - - - #endregion } + + #endregion + + + + #region 完全按照Subject 遍历去分 + + //foreach (var subject in subjectList) + //{ + // //该Subject 已经分配的医生数量 + // var hasAssignDoctorCount = subject.DoctorUserIdList.Count(); + + // //分配两个医生 + // if (trialConfig.ReadingType == ReadingMethod.Double) + // { + // //await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = trialId, SubjectId = subject.SubjectId, DoctorUserId = doctorUserId, AssignTime = DateTime.Now }); + + + // if (hasAssignDoctorCount == 0) + // { + + + + // } + // else if (hasAssignDoctorCount == 1) + // { + + // } + // else if (hasAssignDoctorCount == 2) + // { + + // } + // else + // { + // throw new BusinessValidationFailedException("当前有Subject绑定医生数量大于2"); + // } + + // } + // else if (trialConfig.ReadingType == ReadingMethod.Single) + // { + // if (hasAssignDoctorCount == 0) + // { + + // } + // else if (hasAssignDoctorCount == 1) + // { + + // } + // else + // { + // throw new BusinessValidationFailedException("当前有Subject绑定医生数量大于1"); + // } + // } + + //} + + + #endregion + //验证是否所有Subject 是否分配好 if (assignedSubjectDoctorList.Select(t => t.SubjectId).Distinct().Count() != subjectCount)