diff --git a/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs b/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs index 100d4271d..f1c84a99d 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs @@ -183,6 +183,7 @@ namespace IRaCIS.Application.Contracts public class SelectionReviewerDTO : DoctorDTO { + public bool IsVacation { get; set; } public int DoctorTrialState { get; set; } public bool IsEnroll { get; set; } = false; diff --git a/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs b/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs index ae2a9ba7f..23747a3e4 100644 --- a/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs @@ -131,6 +131,7 @@ namespace IRaCIS.Core.Application.Service #region 医生基本信息 CreateMap() + .ForMember(d => d.IsVacation, u => u.MapFrom(t => t.VacationList.Any(x=>x.StartDateDateTime.Now))) .ForMember(d => d.DoctorUserName, u => u.MapFrom(t => t.UserRole.IdentityUser.UserName)); diff --git a/IRaCIS.Core.Domain/Dcotor/Doctor.cs b/IRaCIS.Core.Domain/Dcotor/Doctor.cs index bbc3e79de..47d9259ea 100644 --- a/IRaCIS.Core.Domain/Dcotor/Doctor.cs +++ b/IRaCIS.Core.Domain/Dcotor/Doctor.cs @@ -16,6 +16,9 @@ public class Doctor : BaseFullAuditEntity [JsonIgnore] public List EnrollList { get; set; } + [JsonIgnore] + public List VacationList { get; set; } + [JsonIgnore] [ForeignKey("HospitalId")] public Hospital Hospital { get; set; } diff --git a/IRaCIS.Core.Domain/Dcotor/Vacation.cs b/IRaCIS.Core.Domain/Dcotor/Vacation.cs index 9f2e05aca..4c089fdf1 100644 --- a/IRaCIS.Core.Domain/Dcotor/Vacation.cs +++ b/IRaCIS.Core.Domain/Dcotor/Vacation.cs @@ -6,6 +6,9 @@ public class Vacation : BaseFullAuditEntity { #region 导航属性 + [JsonIgnore] + [ForeignKey("DoctorId")] + public Doctor Doctor { get; set; } #endregion public Guid DoctorId { get; set; } public DateTime StartDate { get; set; }