This commit is contained in:
DEVICE8\12494
2023-04-21 09:06:54 +08:00
5 changed files with 44 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
using JNPF.DependencyInjection; using JNPF.DependencyInjection;
using JNPF.Systems.Entitys.Dto.DictionaryData;
namespace JNPF.Systems.Entitys.Dto.DictionaryType; namespace JNPF.Systems.Entitys.Dto.DictionaryType;
@@ -42,4 +43,7 @@ public class DictionaryTypeInfoOutput
/// 排序. /// 排序.
/// </summary> /// </summary>
public long? sortCode { get; set; } public long? sortCode { get; set; }
public List<DictionaryDataInfoOutput> items { get; set; }
} }

View File

@@ -0,0 +1,26 @@
using JNPF.DependencyInjection;
using System.ComponentModel;
namespace JNPF.Systems.Entitys.Enum;
/// <summary>
/// 区域类型.
/// </summary>
[SuppressSniffer]
public enum AreaType
{
[Description("公司")]
company,
[Description("工厂")]
factory,
[Description("部门")]
department,
[Description("车间")]
workshop,
[Description("工作中心")]
workgroup,
[Description("工位")]
workstation,
[Description("产线")]
workline
}

View File

@@ -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; using JNPF.Systems.Entitys.Permission;
namespace JNPF.Systems.Interfaces.Permission; namespace JNPF.Systems.Interfaces.Permission;
@@ -21,14 +22,12 @@ public interface IOrganizeService
/// <summary> /// <summary>
/// 获取机构列表 /// 获取机构列表
/// 提供给其他服务使用.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
Task<List<OrganizeEntity>> GetListAsync(); Task<List<OrganizeEntity>> GetListAsync(Expression<Func<OrganizeEntity, bool>> expression = null);
/// <summary> /// <summary>
/// 获取公司列表 /// 获取公司列表
/// 提供给其他服务使用.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
Task<List<OrganizeEntity>> GetCompanyListAsync(); Task<List<OrganizeEntity>> GetCompanyListAsync();

View File

@@ -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.Enums;
using JNPF.Common.Extension; using JNPF.Common.Extension;
using JNPF.Common.Filter; using JNPF.Common.Filter;
@@ -626,9 +627,10 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[NonAction] [NonAction]
public async Task<List<OrganizeEntity>> GetListAsync() public async Task<List<OrganizeEntity>> GetListAsync(Expression<Func<OrganizeEntity, bool>> 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();
} }
/// <summary> /// <summary>

View File

@@ -1,6 +1,7 @@
using JNPF.Common.Core.Manager; using JNPF.Common.Core.Manager;
using JNPF.Common.Core.Manager.Files; using JNPF.Common.Core.Manager.Files;
using JNPF.Common.Enums; using JNPF.Common.Enums;
using JNPF.Common.Manager;
using JNPF.Common.Security; using JNPF.Common.Security;
using JNPF.DatabaseAccessor; using JNPF.DatabaseAccessor;
using JNPF.DependencyInjection; using JNPF.DependencyInjection;
@@ -46,6 +47,8 @@ public class DictionaryDataService : IDictionaryDataService, IDynamicApiControll
/// </summary> /// </summary>
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly ICacheManager _cache;
/// <summary> /// <summary>
/// 初始化一个<see cref="DictionaryDataService"/>类型的新实例. /// 初始化一个<see cref="DictionaryDataService"/>类型的新实例.
/// </summary> /// </summary>
@@ -53,12 +56,14 @@ public class DictionaryDataService : IDictionaryDataService, IDynamicApiControll
ISqlSugarRepository<DictionaryDataEntity> repository, ISqlSugarRepository<DictionaryDataEntity> repository,
IDictionaryTypeService dictionaryTypeService, IDictionaryTypeService dictionaryTypeService,
IFileManager fileManager, IFileManager fileManager,
IUserManager userManager) IUserManager userManager,
ICacheManager cache)
{ {
_repository = repository; _repository = repository;
_dictionaryTypeService = dictionaryTypeService; _dictionaryTypeService = dictionaryTypeService;
_fileManager = fileManager; _fileManager = fileManager;
_userManager = userManager; _userManager = userManager;
_cache = cache;
} }
#region GET #region GET