部门管理:增删改查、用户部门显示

This commit is contained in:
陈淳
2022-09-13 17:50:20 +08:00
parent 7b6d8671cf
commit 5b1ad450d3
9 changed files with 63 additions and 54 deletions

View File

@@ -168,12 +168,11 @@
<param name="ids"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DeptController.PageList(Yi.Framework.Model.Models.DeptEntity,Yi.Framework.Common.Models.PageParModel)">
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DeptController.SelctGetList(Yi.Framework.Model.Models.DeptEntity)">
<summary>
动态条件分页查询
动态条件查询
</summary>
<param name="dept"></param>
<param name="page"></param>
<returns></returns>
</member>
<member name="M:Yi.Framework.ApiMicroservice.Controllers.DictionaryController.PageList(Yi.Framework.Model.Models.DictionaryEntity,Yi.Framework.Common.Models.PageParModel)">

View File

@@ -26,15 +26,14 @@ namespace Yi.Framework.ApiMicroservice.Controllers
}
/// <summary>
/// 动态条件分页查询
/// 动态条件查询
/// </summary>
/// <param name="dept"></param>
/// <param name="page"></param>
/// <returns></returns>
[HttpGet]
public async Task<Result> PageList([FromQuery] DeptEntity dept, [FromQuery] PageParModel page)
public async Task<Result> SelctGetList([FromQuery] DeptEntity dept)
{
return Result.Success().SetData(await _iDeptService.SelctPageList(dept, page));
return Result.Success().SetData(await _iDeptService.SelctGetList(dept));
}

View File

@@ -9,11 +9,10 @@ namespace Yi.Framework.Interface
public partial interface IDeptService:IBaseService<DeptEntity>
{
/// <summary>
/// 动态条件分页查询
/// 动态条件查询
/// </summary>
/// <param name="dept"></param>
/// <param name="page"></param>
/// <returns></returns>
Task<PageModel<List<DeptEntity>>> SelctPageList(DeptEntity dept, PageParModel page);
Task<List<DeptEntity>> SelctGetList(DeptEntity dept);
}
}

View File

@@ -9,18 +9,17 @@ using Yi.Framework.Repository;
namespace Yi.Framework.Service
{
public partial class DeptService : BaseService<DeptEntity>, IDeptService
public partial class DeptService
{
public async Task<PageModel<List<DeptEntity>>> SelctPageList(DeptEntity dept, PageParModel page)
public async Task<List<DeptEntity>> SelctGetList(DeptEntity dept)
{
RefAsync<int> total = 0;
var data = await _repository._DbQueryable
.WhereIF(!string.IsNullOrEmpty(dept.DeptName), u => u.DeptName.Contains(dept.DeptName))
.WhereIF(dept.IsDeleted.IsNotNull(), u => u.IsDeleted == dept.IsDeleted)
.OrderBy(u => u.OrderNum, OrderByType.Desc)
.ToPageListAsync(page.PageNum, page.PageSize, total);
.ToListAsync();
return new PageModel<List<DeptEntity>>(data, total);
return data;
}
}
}