diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs index 51a95fca2..4542c894d 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs @@ -147,8 +147,6 @@ namespace IRaCIS.Core.Application.ViewModel public ReadingMethod ReadingType { get; set; } - [NotDefault] - public Guid EnrollId { get; set; } public Guid? DoctorUserId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs index 702b920a3..6971a86d1 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs @@ -58,7 +58,7 @@ namespace IRaCIS.Core.Application.Service { var verifyExp1 = new EntityVerifyExp() { - VerifyExp = t => t.EnrollId == addOrEditTaskAllocationRule.EnrollId && t.TrialId == addOrEditTaskAllocationRule.TrialId, + VerifyExp = t => t.EnrollId == addOrEditTaskAllocationRule.DoctorUserId && t.TrialId == addOrEditTaskAllocationRule.TrialId, VerifyMsg = "已有该医生配置,不允许继续增加" }; @@ -127,7 +127,6 @@ namespace IRaCIS.Core.Application.Service { TrialId = enroll.TrialId, ReadingType = enroll.Trial.ReadingType, - EnrollId =enroll.Id, DoctorUserId = user.Id, FullName = user.FullName, UserCode = user.UserCode, @@ -142,14 +141,12 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task> GetDoctorSelectList(DoctorSelectQuery selectQuery, [FromServices] IRepository _enrollRepository) { - var query = from enroll in _enrollRepository.Where(t => t.TrialId == selectQuery.TrialId && t.EnrollStatus >= (int)EnrollStatus.ConfirmIntoGroup && t.DoctorUserId !=null) - .WhereIf(selectQuery.ReadingCategory !=null,t=>t.EnrollReadingCategoryList.Any(u=>u.ReadingCategory==selectQuery.ReadingCategory)) - join user in _userRepository.AsQueryable() on enroll.DoctorId equals user.DoctorId + var query = from allocationRule in _taskAllocationRuleRepository.Where(t => t.TrialId == selectQuery.TrialId && t.IsEnable) + join user in _userRepository.AsQueryable() on allocationRule.DoctorUserId equals user.Id select new TrialDoctorUserSelectView() { - TrialId = enroll.TrialId, - ReadingType = enroll.Trial.ReadingType, - EnrollId = enroll.Id, + TrialId = allocationRule.TrialId, + ReadingType = allocationRule.Trial.ReadingType, DoctorUserId = user.Id, FullName = user.FullName, UserCode = user.UserCode, diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index dc0f00b64..5bd45db7d 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -154,18 +154,18 @@ namespace IRaCIS.Core.Application.Service if (_taskAllocationRuleRepository.Where(t => t.TrialId == trialId && t.IsEnable && t.IsJudgeDoctor == false).Count() < 2) { - //throw new BusinessValidationFailedException("能参与读片的医生数量必须>=2,自动分配任务中止"); + throw new BusinessValidationFailedException("能参与读片的医生数量必须>=2,自动分配任务中止"); - break; + //break; } if (!(assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && allocateSubjectArmList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2))) { - //throw new BusinessValidationFailedException("该受试者阅片医生未配置完成"); + throw new BusinessValidationFailedException("该受试者阅片医生未配置完成"); - break; + //break; } #endregion @@ -398,9 +398,9 @@ namespace IRaCIS.Core.Application.Service { if (_taskAllocationRuleRepository.Where(t => t.TrialId == trialId && t.IsEnable).Count() < 2) { - //throw new BusinessValidationFailedException("能参与读片的医生数量必须>=2,自动分配任务中止"); + throw new BusinessValidationFailedException("能参与读片的医生数量必须>=2,自动分配任务中止"); - break; + //break; } //配置了医生