From be498f232973c21cb63c565a53aa4cec2c75e3ea Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 1 Apr 2025 16:54:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Document/AuditDocumentService.cs | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs index 1e7ed2087..36d43e33a 100644 --- a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs @@ -18,6 +18,7 @@ using DocumentFormat.OpenXml.Office2010.Excel; using MassTransit; using NPOI.POIFS.Properties; using Org.BouncyCastle.Crypto; +using Microsoft.AspNetCore.Http; namespace IRaCIS.Core.Application.Service; @@ -26,20 +27,20 @@ public class AuditDocumentService(IRepository _auditDocumentRepos IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer): BaseService { - ///// - ///// 获取稽查文档 - ///// - ///// - ///// - //[HttpPost] - //public async Task> GetAuditDocumentList(AuditDocumentQuery inQuery) - //{ - // var auditDocumentQueryable =_auditDocumentRepository - // .ProjectTo(_mapper.ConfigurationProvider); - // var pageList= await auditDocumentQueryable.ToPagedListAsync(inQuery); + /// + /// 获取稽查文档 + /// + /// + /// + [HttpPost] + public async Task> GetAuditDocumentList(AuditDocumentQuery inQuery) + { + var auditDocumentQueryable = _auditDocumentRepository + .ProjectTo(_mapper.ConfigurationProvider); + var pageList = await auditDocumentQueryable.ToPagedListAsync(inQuery); - // return pageList; - //} + return pageList; + } /// /// 修改稽查文档 @@ -192,9 +193,16 @@ public class AuditDocumentService(IRepository _auditDocumentRepos [HttpPost] public async Task> GetAuditDocumentData(GetAuditDocumentDataInDto inDto) { - var data= await _auditDocumentRepository + + var defalutSortArray = new string[] { nameof(AuditDocumentData.AuditDocumentTypeEnum), nameof(AuditDocumentData.Name) }; + + var data= (await _auditDocumentRepository .Where(x=>x.AuditDocumentTypeEnum!=AuditDocumentType.HistoricalVersion) - .WhereIf(inDto.IsAuthorization!=null,x=>x.IsAuthorization==inDto.IsAuthorization).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + .WhereIf(inDto.IsAuthorization!=null,x=>x.IsAuthorization==inDto.IsAuthorization) + .ProjectTo(_mapper.ConfigurationProvider).ToPagedListAsync(new PageInput() { + PageIndex=1, + PageSize=999999, + }, defalutSortArray) ).CurrentPageData.ToList(); @@ -221,10 +229,8 @@ public class AuditDocumentService(IRepository _auditDocumentRepos PageIndex = inDto.PageIndex, PageSize = inDto.PageSize, TotalCount = query.Count(), - }; - - var root = query - .OrderBy(x => x.Name) + }; + var root = query .Skip(inDto.PageSize * (inDto.PageIndex - 1)).Take(inDto.PageSize).ToList(); foreach (var item in root)