From 52ffdac94838b326965ebaba60cf4f12c9c23351 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 4 Jun 2025 17:09: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/TrialDocumentService.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index 4306464eb..b05b486e2 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -498,15 +498,27 @@ namespace IRaCIS.Core.Application.Services var sysids = result.CurrentPageData.Where(t => t.IsSystemDoc == true).Select(t => t.Id).ToList(); var sysDataList = await _systemDocumentRepository.Where(x => sysids.Contains(x.Id)).Include(x => x.SystemDocumentAttachmentList).ToListAsync(); + + + result.CurrentPageData.ForEach(x => { if (sysDataList.Any(y => y.Id == x.Id)) { x.AttachmentCount = sysDataList.Where(y => y.Id == x.Id).Select(x => x.SystemDocumentAttachmentList.Where(z => !z.OffLine).Count()).FirstOrDefault(); } + }); + var trialids = result.CurrentPageData.Where(t => t.IsSystemDoc == false).Select(t => t.Id).ToList(); + var trialDataList = await _trialDocumentRepository.Where(x => trialids.Contains(x.Id)).Include(x => x.TrialDocumentAttachmentList).ToListAsync(); + result.CurrentPageData.ForEach(x => + { + if (trialDataList.Any(y => y.Id == x.Id)) + { + x.AttachmentCount = trialDataList.Where(y => y.Id == x.Id).Select(x => x.TrialDocumentAttachmentList.Where(z => !z.OffLine).Count()).FirstOrDefault(); + } }); #endregion