From 844e27e94ec3f9e30e30dfad485621974b62a648 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 15 Apr 2025 17:55:16 +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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index 27fc19428..850cc30c1 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -804,7 +804,6 @@ namespace IRaCIS.Core.Application.Services select new UnionDocumentWithConfirmInfoView() { IsSystemDoc = true, - Id = sysDoc.Id, CreateTime = sysDoc.CreateTime, IsDeleted = sysDoc.IsDeleted, @@ -855,9 +854,19 @@ namespace IRaCIS.Core.Application.Services var identityUserUserTypeList = _identityUserRepository.Where(t => identityUserIdList.Contains(t.Id)).IgnoreQueryFilters().Select(t => new { IdentityUserId = t.Id, UserTypeList = t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Select(c => c.UserTypeRole.UserTypeShortName).ToList() }); + //Concat 不能用导航属性 + 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(); + foreach (var item in result.CurrentPageData) { + + if (sysDataList.Any(y => y.Id == item.Id)) + { + item.AttachmentCount = sysDataList.Where(y => y.Id == item.Id).Select(x => x.SystemDocumentAttachmentList.Count()).FirstOrDefault(); + } + if (item.IsSystemDoc) { item.DocNeedSignUserTypeList = sysDocUserTypeList.Where(t => t.SystemDocumentId == item.Id).Select(t => t.UserTypeShortName).ToList();