From 41b8ea9f4b70f2649d39ea921f914d46811be9b8 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 13 Jun 2022 15:21:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/DTO/VisitTaskViewModel.cs | 6 ++++-- .../Service/Allocation/VisitTaskService.cs | 1 + IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index d5c0c9b4..00dab14f 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 eb28f788..1cd3fa34 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 8e0d430f..ddd83011 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)));