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(); + } } }