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.Systems.Entitys.Dto.DictionaryData;
namespace JNPF.Systems.Entitys.Dto.DictionaryType;
@@ -42,4 +43,7 @@ public class DictionaryTypeInfoOutput
/// 排序.
/// </summary>
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;
namespace JNPF.Systems.Interfaces.Permission;
@@ -21,14 +22,12 @@ public interface IOrganizeService
/// <summary>
/// 获取机构列表
/// 提供给其他服务使用.
/// </summary>
/// <returns></returns>
Task<List<OrganizeEntity>> GetListAsync();
Task<List<OrganizeEntity>> GetListAsync(Expression<Func<OrganizeEntity, bool>> expression = null);
/// <summary>
/// 获取公司列表
/// 提供给其他服务使用.
/// </summary>
/// <returns></returns>
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.Extension;
using JNPF.Common.Filter;
@@ -626,9 +627,10 @@ public class OrganizeService : IOrganizeService, IDynamicApiController, ITransie
/// </summary>
/// <returns></returns>
[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>

View File

@@ -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
/// </summary>
private readonly IUserManager _userManager;
private readonly ICacheManager _cache;
/// <summary>
/// 初始化一个<see cref="DictionaryDataService"/>类型的新实例.
/// </summary>
@@ -53,12 +56,14 @@ public class DictionaryDataService : IDictionaryDataService, IDynamicApiControll
ISqlSugarRepository<DictionaryDataEntity> repository,
IDictionaryTypeService dictionaryTypeService,
IFileManager fileManager,
IUserManager userManager)
IUserManager userManager,
ICacheManager cache)
{
_repository = repository;
_dictionaryTypeService = dictionaryTypeService;
_fileManager = fileManager;
_userManager = userManager;
_cache = cache;
}
#region GET