From 9d3e1edd6107c89232ebc346f2b7198bf8c41c37 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 12 Nov 2024 14:09:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Doctor/EducationService.cs | 2 +- IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs | 4 +++- IRaCIS.Core.Domain/Dcotor/Postgraduate.cs | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Doctor/EducationService.cs b/IRaCIS.Core.Application/Service/Doctor/EducationService.cs index 75a609658..ad8d8a751 100644 --- a/IRaCIS.Core.Application/Service/Doctor/EducationService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/EducationService.cs @@ -21,7 +21,7 @@ namespace IRaCIS.Core.Application.Service .OrderBy(t => t.CreateTime).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); var postgraduateList = await _postgraduateRepository.Where(o => o.DoctorId == doctorId) - .OrderBy(t => t.CreateTime).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + .OrderBy(t => t.CreateTime).ProjectTo(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }).ToListAsync(); return new DoctorEducationExperienceDTO() diff --git a/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs b/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs index d4069151e..b8d4e9034 100644 --- a/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs @@ -11,6 +11,7 @@ namespace IRaCIS.Core.Application.Service { public DoctorConfig() { + var isEn_Us = false; // 从 DateTime 映射到 DateOnly CreateMap().ConvertUsing(dt => DateOnly.FromDateTime(dt)); @@ -66,7 +67,8 @@ namespace IRaCIS.Core.Application.Service CreateMap(); CreateMap(); - CreateMap(); + CreateMap() + .ForMember(t => t.HospitalCN, c => c.MapFrom(d => isEn_Us ? d.HospitalEnt.HospitalName : d.HospitalEnt.HospitalNameCN)); CreateMap(); CreateMap(); diff --git a/IRaCIS.Core.Domain/Dcotor/Postgraduate.cs b/IRaCIS.Core.Domain/Dcotor/Postgraduate.cs index 65560c5f0..6af4ba9b2 100644 --- a/IRaCIS.Core.Domain/Dcotor/Postgraduate.cs +++ b/IRaCIS.Core.Domain/Dcotor/Postgraduate.cs @@ -5,7 +5,9 @@ namespace IRaCIS.Core.Domain.Models; public class Postgraduate : BaseFullAuditEntity { #region µ¼º½ÊôÐÔ - + [JsonIgnore] + [ForeignKey("HospitalId")] + public Hospital HospitalEnt { get; set; } #endregion public Guid DoctorId { get; set; }