From d9ad2fd3456b84a0b213f10523fbe17530e349bb Mon Sep 17 00:00:00 2001 From: PhilPan Date: Thu, 20 Apr 2023 16:59:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BB=84=E7=BB=87=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=8A=A0=E6=9D=A1=E4=BB=B6=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tnb.BasicData.Entitys/Mapper/Mapper.cs | 3 +-- .../DictionaryTypeInfoOutput.cs | 4 +++ system/Tnb.Systems.Entitys/Enum/AreaType.cs | 26 +++++++++++++++++++ .../Permission/IOrganizeService.cs | 7 +++-- .../Tnb.Systems/Permission/OrganizeService.cs | 8 +++--- .../System/DictionaryDataService.cs | 7 ++++- 6 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 system/Tnb.Systems.Entitys/Enum/AreaType.cs diff --git a/Tnb.BasicData.Entitys/Mapper/Mapper.cs b/Tnb.BasicData.Entitys/Mapper/Mapper.cs index 3c664fd1..62a2b39b 100644 --- a/Tnb.BasicData.Entitys/Mapper/Mapper.cs +++ b/Tnb.BasicData.Entitys/Mapper/Mapper.cs @@ -1,5 +1,4 @@ -using JNPF.Systems.Entitys.System; -using Mapster; +using Mapster; using SqlSugar; using Tnb.BasicData.Entitys.Dto.ProcessManage; using Tnb.BasicData.Entitys.Entity; diff --git a/system/Tnb.Systems.Entitys/Dto/System/DictionaryType/DictionaryTypeInfoOutput.cs b/system/Tnb.Systems.Entitys/Dto/System/DictionaryType/DictionaryTypeInfoOutput.cs index 332ffeaa..9657ecfc 100644 --- a/system/Tnb.Systems.Entitys/Dto/System/DictionaryType/DictionaryTypeInfoOutput.cs +++ b/system/Tnb.Systems.Entitys/Dto/System/DictionaryType/DictionaryTypeInfoOutput.cs @@ -1,4 +1,5 @@ using JNPF.DependencyInjection; +using JNPF.Systems.Entitys.Dto.DictionaryData; namespace JNPF.Systems.Entitys.Dto.DictionaryType; @@ -42,4 +43,7 @@ public class DictionaryTypeInfoOutput /// 排序. /// public long? sortCode { get; set; } + + public List items { get; set; } + } \ No newline at end of file diff --git a/system/Tnb.Systems.Entitys/Enum/AreaType.cs b/system/Tnb.Systems.Entitys/Enum/AreaType.cs new file mode 100644 index 00000000..24b9fda8 --- /dev/null +++ b/system/Tnb.Systems.Entitys/Enum/AreaType.cs @@ -0,0 +1,26 @@ +using JNPF.DependencyInjection; +using System.ComponentModel; + +namespace JNPF.Systems.Entitys.Enum; + +/// +/// 区域类型. +/// +[SuppressSniffer] +public enum AreaType +{ + [Description("公司")] + company, + [Description("工厂")] + factory, + [Description("部门")] + department, + [Description("车间")] + workshop, + [Description("工作中心")] + workgroup, + [Description("工位")] + workstation, + [Description("产线")] + workline +} \ No newline at end of file diff --git a/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs b/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs index 1cde0b0e..2f5aa59d 100644 --- a/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs +++ b/system/Tnb.Systems.Interfaces/Permission/IOrganizeService.cs @@ -1,4 +1,5 @@ -using JNPF.Systems.Entitys.Dto.Organize; +using System.Linq.Expressions; +using JNPF.Systems.Entitys.Dto.Organize; using JNPF.Systems.Entitys.Permission; namespace JNPF.Systems.Interfaces.Permission; @@ -21,14 +22,12 @@ public interface IOrganizeService /// /// 获取机构列表 - /// 提供给其他服务使用. /// /// - Task> GetListAsync(); + Task> GetListAsync(Expression> expression = null); /// /// 获取公司列表 - /// 提供给其他服务使用. /// /// Task> GetCompanyListAsync(); diff --git a/system/Tnb.Systems/Permission/OrganizeService.cs b/system/Tnb.Systems/Permission/OrganizeService.cs index 45d04e5a..fd50240f 100644 --- a/system/Tnb.Systems/Permission/OrganizeService.cs +++ b/system/Tnb.Systems/Permission/OrganizeService.cs @@ -1,4 +1,5 @@ -using JNPF.Common.Core.Manager; +using System.Linq.Expressions; +using JNPF.Common.Core.Manager; using JNPF.Common.Enums; using JNPF.Common.Extension; using JNPF.Common.Filter; @@ -626,9 +627,10 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie /// /// [NonAction] - public async Task> GetListAsync() + public async Task> GetListAsync(Expression> expression = null) { - return await _repository.AsQueryable().Where(t => t.EnabledMark == 1 && t.DeleteMark == null).OrderBy(o => o.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc).ToListAsync(); + var query = _repository.AsQueryable().Where(t => t.EnabledMark == 1 && t.DeleteMark == null).WhereIF(expression!=null, expression); + return await query.OrderBy(o => o.SortCode).OrderBy(a => a.CreatorTime, OrderByType.Desc).ToListAsync(); } /// diff --git a/system/Tnb.Systems/System/DictionaryDataService.cs b/system/Tnb.Systems/System/DictionaryDataService.cs index efec0a69..1ff8d35b 100644 --- a/system/Tnb.Systems/System/DictionaryDataService.cs +++ b/system/Tnb.Systems/System/DictionaryDataService.cs @@ -1,6 +1,7 @@ using JNPF.Common.Core.Manager; using JNPF.Common.Core.Manager.Files; using JNPF.Common.Enums; +using JNPF.Common.Manager; using JNPF.Common.Security; using JNPF.DatabaseAccessor; using JNPF.DependencyInjection; @@ -46,6 +47,8 @@ public class DictionaryDataService : IDictionaryDataService, IDynamicApiControll /// private readonly IUserManager _userManager; + private readonly ICacheManager _cache; + /// /// 初始化一个类型的新实例. /// @@ -53,12 +56,14 @@ public class DictionaryDataService : IDictionaryDataService, IDynamicApiControll ISqlSugarRepository repository, IDictionaryTypeService dictionaryTypeService, IFileManager fileManager, - IUserManager userManager) + IUserManager userManager, + ICacheManager cache) { _repository = repository; _dictionaryTypeService = dictionaryTypeService; _fileManager = fileManager; _userManager = userManager; + _cache = cache; } #region GET