From 4ad3ee56bf9207fb62b94131d48dd7e1614676f0 Mon Sep 17 00:00:00 2001 From: "{872297557@qq.com}" <872297557@qq.com> Date: Tue, 17 Jan 2023 16:04:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9qc=20=E5=AE=A1=E6=A0=B8=20?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=B1=BB=E5=9E=8B=20=20=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/DTO/SystemBasicDataViewModel.cs | 1 - .../Service/Common/SystemBasicDataService.cs | 2 +- IRaCIS.Core.Application/Service/Common/_MapConfig.cs | 6 ++++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs index 76faf6503..7758d3f5d 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs @@ -25,7 +25,6 @@ namespace IRaCIS.Core.Application.Contracts { public Guid Id { get; set; } public string Name { get; set; } = string.Empty; - public string ValueCN { get; set; } = string.Empty; public string Value { get; set; } = string.Empty; public string Code { get; set; } = string.Empty; diff --git a/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs b/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs index f6dd559c5..b45df75ff 100644 --- a/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs +++ b/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs @@ -99,7 +99,7 @@ namespace IRaCIS.Core.Application.Services public async Task>> GetBasicDataSelect(string[] searchArray) { - var searchList = await _systemBasicDataRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var searchList = await _systemBasicDataRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null).ProjectTo(_mapper.ConfigurationProvider,new { _userInfo.IsEn_Us}).ToListAsync(); return searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.ToList()); diff --git a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs index a5db56579..67e4ef6fc 100644 --- a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs @@ -25,8 +25,10 @@ namespace IRaCIS.Core.Application.Service CreateMap(); + var isEn_Us = false; CreateMap() - .ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code)); + .ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code)) + .ForMember(o => o.Value, t => t.MapFrom(u => isEn_Us? u.Value:u.ValueCN)); CreateMap().ReverseMap(); @@ -40,7 +42,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(o => o.ParentChildCodeEnum, t => t.MapFrom(u => u.Parent.ChildCodeEnum)) - + .ForMember(o => o.Value, t => t.MapFrom(u => u.MappedValue)) .ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code)); var token = "";