From c49f16b055d558e646f9844b3863c69ae9ec1266 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 2 Apr 2025 13:44:36 +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 | 22 ++++--------------- .../Service/TrialSiteUser/TrialSiteService.cs | 6 ++--- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs index ab579ce76..a59e41af3 100644 --- a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs @@ -116,19 +116,15 @@ public class AuditDocumentService(IRepository _auditDocumentRepos else { return alikeData; - } - } else { var entityData = await _auditDocumentRepository.InsertOrUpdateAsync(inDto, true); - var historicalVersionIds = await _auditDocumentRepository.Where(x => x.MainFileId == alikeData.Id).OrderBy(x => x.Version).Select(x => x.Id).ToListAsync(); - historicalVersionIds.Add(alikeData.Id); - int num = 1; + foreach (var item in historicalVersionIds) { await _auditDocumentRepository.UpdatePartialFromQueryAsync(item, x => new AuditDocument() @@ -177,17 +173,6 @@ public class AuditDocumentService(IRepository _auditDocumentRepos } - - ///// - ///// 新增稽查文档 - ///// - ///// - //public async Task InsertAuditDocument() - //{ - - //} - - /// /// 获取文件树形结构 (传Id 根节点就是自己) /// @@ -199,12 +184,13 @@ public class AuditDocumentService(IRepository _auditDocumentRepos 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).ToPagedListAsync(new PageInput() { - PageIndex=1, - PageSize=999999, + PageIndex=1, + PageSize=999999, }, defalutSortArray) ).CurrentPageData.ToList(); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs index 794b3149f..0e47e20c1 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs @@ -148,9 +148,9 @@ namespace IRaCIS.Core.Application.Services public async Task> GetTrialSiteSelectList(string? siteName) { - var list = _siteRepository - .WhereIf(!string.IsNullOrWhiteSpace(siteName), t => t.SiteName.Contains(siteName) || t.SiteNameCN.Contains(siteName) || t.AliasName.Contains(siteName)) - .Select(t => new TrialSiteSelect() { SiteId = t.Id, SiteName = _userInfo.IsEn_Us ? t.SiteName : t.SiteNameCN, AliasName = t.AliasName }) + var list = _trialSiteRepository + .WhereIf(!string.IsNullOrWhiteSpace(siteName), t => t.TrialSiteName.Contains(siteName) || t.TrialSiteAliasName.Contains(siteName) || t.TrialSiteCode.Contains(siteName)) + .Select(t => new TrialSiteSelect() { SiteId = t.Id, SiteName = _userInfo.IsEn_Us ? t.TrialSiteName : t.TrialSiteName, AliasName = t.TrialSiteAliasName }) .OrderBy(x=>x.SiteName) .ToList();