From 58b7cf6c3b0db039e812b39875f7d3416c6fe162 Mon Sep 17 00:00:00 2001 From: mahao Date: Wed, 12 Apr 2023 16:04:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E9=85=8D=E7=BD=AE=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- host/WmsWebApi.HttpApi.Host/appsettings.json | 1 + .../OtherZll/OtherZllService.cs | 8 ++++---- .../Options/OtherZllConfigOptions.cs | 15 ++++++++++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/host/WmsWebApi.HttpApi.Host/appsettings.json b/host/WmsWebApi.HttpApi.Host/appsettings.json index 665c6ec..bff64ed 100644 --- a/host/WmsWebApi.HttpApi.Host/appsettings.json +++ b/host/WmsWebApi.HttpApi.Host/appsettings.json @@ -28,6 +28,7 @@ }, "CustomConfig": { "OtherZllConfig": { + "IsEnableErnamFilter": true, "ErnamFilters": [ "1023", "1024" ] } } diff --git a/src/WmsWebApi.Application/OtherZll/OtherZllService.cs b/src/WmsWebApi.Application/OtherZll/OtherZllService.cs index ff75727..b2ff81f 100644 --- a/src/WmsWebApi.Application/OtherZll/OtherZllService.cs +++ b/src/WmsWebApi.Application/OtherZll/OtherZllService.cs @@ -102,11 +102,11 @@ public class OtherZllService : ApplicationService, IOtherZllService if (_dtoList != null && _dtoList.Count() > 0) { - //根据配置文件过滤ERNAM - List ernamFilters = _otherZllConfigOptions.ErnamFilters; - if (ernamFilters != null && ernamFilters.Count > 0) + if (_otherZllConfigOptions.IsEnableErnamFilter == true) { - _dtoList = _dtoList.FindAll(e => !ernamFilters.Contains(e.ERNAM)); + //根据配置文件过滤ERNAM + List ernamFilters = _otherZllConfigOptions.ErnamFilters; + _dtoList = _dtoList.FindAll(e => ernamFilters.Contains(e.ERNAM)); } } diff --git a/src/WmsWebApi.Domain/Options/OtherZllConfigOptions.cs b/src/WmsWebApi.Domain/Options/OtherZllConfigOptions.cs index faddcf2..0c3cd1e 100644 --- a/src/WmsWebApi.Domain/Options/OtherZllConfigOptions.cs +++ b/src/WmsWebApi.Domain/Options/OtherZllConfigOptions.cs @@ -8,8 +8,21 @@ namespace WmsWebApi.Options public class OtherZllConfigOptions { /// - /// 创建对象的人员名称过滤 + /// 是否启用 + /// + public bool IsEnableErnamFilter { get; set; } + + /// + /// 创建对象的人员名称保留 + /// 前置条件 IsEnableErnamFilter == True + /// []都不保留 + /// ["1023","1024"]保留1023、1024 /// public List ErnamFilters { get; set; } + + public OtherZllConfigOptions() + { + ErnamFilters = new List(); + } } }