diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index d5c0c9b4c..00dab14f5 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -97,6 +97,8 @@ namespace IRaCIS.Core.Application.ViewModel public bool? IsHaveAssigned { get; set; } + public bool? IsHaveApplyedTask { get; set; } + } public class SubjectAssignView @@ -110,9 +112,9 @@ namespace IRaCIS.Core.Application.ViewModel public string SubjectCode { get; set; } = String.Empty; - public bool IsAssignDoctorUser { get; set; } - + public bool IsAssignedDoctorUser { get; set; } + public bool IsAssignDoctorApplyedTask => DoctorUserList.All(t=>t.IsAssignDoctorApplyedTask); public List DoctorUserList { get; set; } = new List(); } diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index eb28f7881..1cd3fa347 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -85,6 +85,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(querySubjectAssign.SubjectId != null, t => t.Id == querySubjectAssign.SubjectId) .WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == true, t => t.SubjectDoctorList.Count() > 0) .WhereIf(querySubjectAssign.IsHaveAssigned != null && querySubjectAssign.IsHaveAssigned == false, t => t.SubjectDoctorList.Count() == 0) + .WhereIf(querySubjectAssign.IsHaveApplyedTask != null , t => t.SubjectDoctorList.SelectMany(t=>t.Subject.SubjectVisitTaskList).All(u=>u.DoctorUserId!=null) ) .WhereIf(querySubjectAssign.DoctorUserId != null, t => t.SubjectDoctorList.Any(t => t.DoctorUserId == querySubjectAssign.DoctorUserId)) .ProjectTo(_mapper.ConfigurationProvider); diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index 8e0d430f6..ddd830118 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -45,7 +45,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.SubjectId, t => t.MapFrom(u => u.Id)) .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Code)) - .ForMember(o => o.IsAssignDoctorUser, t => t.MapFrom(u => u.SubjectDoctorList.Any())) + .ForMember(o => o.IsAssignedDoctorUser, t => t.MapFrom(u => u.SubjectDoctorList.Any())) .ForMember(o => o.DoctorUserList, t => t.MapFrom(u => u.SubjectDoctorList.OrderByDescending(t=>t.UpdateTime)));