diff --git a/Src/Dlhis.Basic/Organization/Services/IDepartmentService.cs b/Src/Dlhis.Basic/Organization/Services/IDepartmentService.cs index cfd0b9d2..5e3784c1 100644 --- a/Src/Dlhis.Basic/Organization/Services/IDepartmentService.cs +++ b/Src/Dlhis.Basic/Organization/Services/IDepartmentService.cs @@ -1,12 +1,8 @@ -using Dlhis.Basic.Organization.Request; -using Dlhis.Basic.Organization.Response; -using Kurisu.Core.DataAccess.Dto; +using Dlhis.Basic.Organization.Response; namespace Dlhis.Basic.Organization.Services; public interface IDepartmentService : IScopeDependency { Task> GetTreeAsync(); - - Task> GetTreePageAsync(DepartmentPageRequest request); } diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs index 77f42f9a..bf42c549 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/DepartmentService.cs @@ -32,35 +32,6 @@ public class DepartmentService : IDepartmentService return tops; } - public async Task> GetTreePageAsync(DepartmentPageRequest request) - { - var departments = await _dbContext - .Queryable() - .WhereIF(!request.Search.IsEmpty(), x => x.Name.Contains(request.Search) || x.No.Contains(request.Search)).ToListAsync(); - - var tops = departments.Where(x => x.PNo.IsEmpty()).Adapt>(); - - tops.ForEach(x => - { - RecursionGetNext(x, departments); - }); - - // 分页操作 - var startIndex = (request.PageIndex - 1) * request.PageSize; - var pagedData = tops.Skip(startIndex).Take(request.PageSize).ToList(); - - var pagination = new Pagination - { - PageIndex = request.PageIndex, - PageSize = request.PageSize, - Total = tops.Count, // 使用原始列表的总数进行分页 - Data = pagedData - }; - - return pagination; - - } - private void RecursionGetNext(DepartmentTreeResponse current, List departments) { var next = departments.Where(x => x.PNo == current.No).ToList();