From 8ee34d7656d017808fd78ee84875b04ae1ee257f Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Mon, 20 Mar 2023 11:33:48 +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/Common/DTO/DictionaryModel.cs | 3 +++ IRaCIS.Core.Application/Service/Common/DictionaryService.cs | 1 + 2 files changed, 4 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs index 395493195..d2732d6cb 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs @@ -83,6 +83,9 @@ namespace IRaCIS.Application.Contracts public Guid? ReadingCriterionId { get; set; } public string DictionaryCode { get; set; } + + + public List DictionaryCodeList { get; set; } = new List(); } public class GetBasicDataAllSelectInDto diff --git a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs index 11e02a510..a862583de 100644 --- a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs +++ b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs @@ -311,6 +311,7 @@ namespace IRaCIS.Application.Services { var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable) .WhereIf(!inDto.DictionaryCode.IsNullOrEmpty(), x =>x.Parent.Code==inDto.DictionaryCode) + .WhereIf(inDto.DictionaryCodeList.Count()>0, x => inDto.DictionaryCodeList.Contains(x.Parent.Code)) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); var result = searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList());