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; }