feat: 部门查询
This commit is contained in:
@@ -7,16 +7,12 @@ using Yi.Framework.Ddd.Dtos;
|
||||
|
||||
namespace Yi.RBAC.Application.Contracts.Identity.Dtos
|
||||
{
|
||||
public class DeptGetListInputVo : PagedAndSortedResultRequestDto
|
||||
public class DeptGetListInputVo : PagedAllResultRequestDto
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime CreationTime { get; set; } = DateTime.Now;
|
||||
public long? CreatorId { get; set; }
|
||||
public bool State { get; set; }
|
||||
public string DeptName { get; set; }=string.Empty;
|
||||
public string DeptCode { get; set; } = string.Empty;
|
||||
public bool? State { get; set; }
|
||||
public string? DeptName { get; set; }
|
||||
public string? DeptCode { get; set; }
|
||||
public string? Leader { get; set; }
|
||||
public long ParentId { get; set; }
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ using NET.AutoWebApi.Setting;
|
||||
using Yi.RBAC.Application.Contracts.Identity.Dtos;
|
||||
using Yi.RBAC.Domain.Identity.Entities;
|
||||
using Yi.Framework.Ddd.Services;
|
||||
using Yi.Framework.Ddd.Dtos;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Yi.RBAC.Application.Identity
|
||||
{
|
||||
@@ -13,5 +15,19 @@ namespace Yi.RBAC.Application.Identity
|
||||
public class DeptService : CrudAppService<DeptEntity, DeptGetOutputDto, DeptGetListOutputDto, long, DeptGetListInputVo, DeptCreateInputVo, DeptUpdateInputVo>,
|
||||
IDeptService, IAutoApiService
|
||||
{
|
||||
public override async Task<PagedResultDto<DeptGetListOutputDto>> GetListAsync(DeptGetListInputVo input)
|
||||
{
|
||||
RefAsync<int> total = 0;
|
||||
var entities = await _DbQueryable
|
||||
.WhereIF(!string.IsNullOrEmpty(input.DeptName), u => u.DeptName.Contains(input.DeptName!))
|
||||
.WhereIF(input.State is not null, u => u.State == input.State)
|
||||
.OrderBy(u => u.OrderNum, OrderByType.Asc)
|
||||
.ToPageListAsync(input.PageNum, input.PageSize, total);
|
||||
return new PagedResultDto<DeptGetListOutputDto>
|
||||
{
|
||||
Items = await MapToGetListOutputDtosAsync(entities),
|
||||
Total = total
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user