From f8a1b396b9506b6fbbe94cd386cdaa605c125fc6 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 31 May 2022 11:31:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=B3=E9=94=AE=E5=AD=97?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/DTO/DictionaryModel.cs | 2 ++ .../Service/Common/DictionaryService.cs | 3 +++ IRaCIS.Core.Domain/Common/Dictionary.cs | 1 + .../Common/AuditingData.cs | 18 ------------------ .../Context/IRaCISDBContext.cs | 2 +- .../Repository/Repository.cs | 9 --------- 6 files changed, 7 insertions(+), 28 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs index 70302bfb6..1574dd2e9 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs @@ -78,6 +78,8 @@ namespace IRaCIS.Application.Contracts public class BasicDicQuery:PageInput { + public string? keyInfo { get; set; } + public string? Code { get; set; } diff --git a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs index f48441630..091141649 100644 --- a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs +++ b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs @@ -42,6 +42,9 @@ namespace IRaCIS.Application.Services var systemBasicDataQueryable = _dicRepository.Where(t => t.ParentId == null) .WhereIf(!string.IsNullOrEmpty(basicDicQuery.Code), t => t.Code.Contains(basicDicQuery.Code!)) + .WhereIf(!string.IsNullOrEmpty(basicDicQuery.keyInfo), t => t.Description.Contains(basicDicQuery.keyInfo!) || t.Code.Contains(basicDicQuery.keyInfo!) + || t.ChildList.Any(u=>u.ValueCN.Contains(basicDicQuery.keyInfo!)) || t.ChildList.Any(u => u.Description.Contains(basicDicQuery.keyInfo!))) + .WhereIf(basicDicQuery.ConfigTypeId != null, t => t.ConfigTypeId == basicDicQuery.ConfigTypeId!) .WhereIf(basicDicQuery.DataTypeEnum != null, t => t.DataTypeEnum == basicDicQuery.DataTypeEnum) diff --git a/IRaCIS.Core.Domain/Common/Dictionary.cs b/IRaCIS.Core.Domain/Common/Dictionary.cs index 805f6c652..1ca2012bb 100644 --- a/IRaCIS.Core.Domain/Common/Dictionary.cs +++ b/IRaCIS.Core.Domain/Common/Dictionary.cs @@ -55,6 +55,7 @@ namespace IRaCIS.Core.Domain.Models [ForeignKey("ParentId")] public Dictionary Parent { get; set; } + public List ChildList { get; set; } = new List(); [NotMapped] diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 21c85920d..4e681c5a0 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -1077,24 +1077,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common } - /// - /// 判断是否为空 - /// - /// - /// - private bool IsNullOrEmpty(object value) - { - if (value == null || value.ToString() == string.Empty) - { - return true; - } - else - { - return false; - } - } - - /// diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 6e8316eaa..6e31f1de9 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -88,7 +88,7 @@ namespace IRaCIS.Core.Infra.EFCore //modelBuilder.HasDbFunction(typeof(DbContext).GetMethod(nameof(GetTableList))); - + modelBuilder.Entity().HasMany(t => t.ChildList).WithOne(t => t.Parent); if (_userInfo.IsEn_Us) { modelBuilder.Entity().Property(t => t.MappedValue).HasColumnName(nameof(Domain.Models.Dictionary.Value)); diff --git a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs index d776b7c21..3725618ce 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs @@ -570,15 +570,6 @@ namespace IRaCIS.Core.Infra.EFCore } - #endregion - - #region 稽查 - - - - - - #endregion