diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs index 9da354d11..f01f99ede 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs @@ -125,18 +125,20 @@ namespace IRaCIS.Core.Application.Service [HttpGet("{trialId:guid}")] public async Task> GetDoctorUserSelectList(Guid trialId, [FromServices] IRepository _enrollRepository) { - var query = _enrollRepository.Where(t => t.TrialId == trialId && t.EnrollStatus >= EnrollStatus.ConfirmIntoGroup) - .Select(x => new TrialDoctorUserSelectView { + var query = from enroll in _enrollRepository.Where(t => t.TrialId == trialId && t.EnrollStatus >= EnrollStatus.ConfirmIntoGroup) + join user in _userRoleRepository.AsQueryable() on enroll.DoctorId equals user.DoctorId + select new TrialDoctorUserSelectView() + { + TrialId = enroll.TrialId, + //ReadingType = enroll.Trial.ReadingType, + DoctorUserId = user.Id, + FullName = user.IdentityUser.FullName, + UserCode = user.IdentityUser.UserCode, + UserName = user.IdentityUser.UserName, + UserTypeEnum = user.UserTypeRole.UserTypeEnum, + ReadingCategoryList = enroll.EnrollReadingCategoryList.Select(t => t.ReadingCategory).ToList() - TrialId = x.TrialId, - //ReadingType = enroll.Trial.ReadingType, - DoctorUserId = x.DoctorUser.Id, - FullName = x.DoctorUser.IdentityUser.FullName, - UserCode = x.DoctorUser.IdentityUser.UserCode, - UserName = x.DoctorUser.IdentityUser.UserName, - UserTypeEnum = x.DoctorUser.UserTypeRole.UserTypeEnum, - ReadingCategoryList = x.EnrollReadingCategoryList.Select(t => t.ReadingCategory).ToList() - }); + }; return await query.ToListAsync(); }