From 9e9f07e4fd4b55aadec5fa3e0793b4da1ee0d9e3 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 8 May 2025 13:41:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Consumer/Dto/SendImageReuploadEmailDto.cs | 2 ++ .../MassTransit/Consumer/ImageConsumer.cs | 21 +++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.Application/MassTransit/Consumer/Dto/SendImageReuploadEmailDto.cs b/IRaCIS.Core.Application/MassTransit/Consumer/Dto/SendImageReuploadEmailDto.cs index 539d06827..263f606e4 100644 --- a/IRaCIS.Core.Application/MassTransit/Consumer/Dto/SendImageReuploadEmailDto.cs +++ b/IRaCIS.Core.Application/MassTransit/Consumer/Dto/SendImageReuploadEmailDto.cs @@ -21,6 +21,8 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer.Dto public RequestBackStateEnum RequestBackStateEnum { get; set; } = RequestBackStateEnum.NotRequest; + public ReReadingApplyState ReReadingApplyState { get; set; } = ReReadingApplyState.Default; + diff --git a/IRaCIS.Core.Application/MassTransit/Consumer/ImageConsumer.cs b/IRaCIS.Core.Application/MassTransit/Consumer/ImageConsumer.cs index dbdab6bce..60cf684f5 100644 --- a/IRaCIS.Core.Application/MassTransit/Consumer/ImageConsumer.cs +++ b/IRaCIS.Core.Application/MassTransit/Consumer/ImageConsumer.cs @@ -248,7 +248,8 @@ public class ImageConsumer( EmailNoticeConfig = emailConfig, Scenario = scenario, SubjectVisit = subjectVisit, - TrialId = trialId + TrialId = trialId, + ReReadingApplyState= context.Message.ReReadingApplyState, }; await SendImageReuploadEmail(inDto); } @@ -327,16 +328,18 @@ public class ImageConsumer( List dictionaryDtos = new List() { new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=inDto.SubjectVisit.IsUrgent.ToString().ToLower(), }, //是否加急 }; - if (inDto.Scenario == EmailBusinessScenario.DataReconciliation_PMApprovalRe_Uploading) + switch (inDto.Scenario) { - dictionaryDtos.Add(new DictionaryDto() { DictionaryCode = "RequestBackState", EnumValue = inDto.RequestBackStateEnum.GetEnumInt(), }); + case EmailBusinessScenario.Re_ReadApproval_SPMCPMApprovalRe_Reading: + dictionaryDtos.Add(new DictionaryDto() { DictionaryCode = "ReReadingApplyState", EnumValue = inDto.ReReadingApplyState.GetEnumInt(), }); + break; + case EmailBusinessScenario.DataReconciliation_PMApprovalRe_Uploading: + dictionaryDtos.Add(new DictionaryDto() { DictionaryCode = "RequestBackState", EnumValue = inDto.RequestBackStateEnum.GetEnumInt(), }); + break; + default: + dictionaryDtos.Add(new DictionaryDto() { DictionaryCode = "ImageBackStateEnum", EnumValue = inDto.ImageBackStateEnum.GetEnumInt(), });//审批结果 + break; } - else - { - dictionaryDtos.Add(new DictionaryDto() { DictionaryCode = "ImageBackStateEnum", EnumValue = inDto.ImageBackStateEnum.GetEnumInt(), });//审批结果 - } - - var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto() { From ee9ad472f01a6f770551e13295efb201c3d6ab13 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 8 May 2025 13:57:16 +0800 Subject: [PATCH 2/3] =?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 | 1 + .../Service/Document/DTO/AuditDocumentViewModel.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs index a3411fc42..fc8bc3ba6 100644 --- a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs @@ -278,6 +278,7 @@ public class AuditDocumentService(IRepository _auditDocumentRepos private void GetChildren(AuditDocumentData item, List dataList) { item.Children = dataList.Where(x => x.ParentId == item.Id).ToList(); + item.HistoricalVersionsCount= dataList.Where(x => x.MainFileId == item.Id).Count(); foreach (var x in item.Children) { GetChildren(x, dataList); diff --git a/IRaCIS.Core.Application/Service/Document/DTO/AuditDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/AuditDocumentViewModel.cs index ab2192b00..73a71c913 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/AuditDocumentViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/AuditDocumentViewModel.cs @@ -47,7 +47,12 @@ public class AuditDocumentData : AuditDocumentUpdateDto public DateTime UpdateTime { get; set; } + public Guid? MainFileId { get; set; } + + public int? Version { get; set; } + + public int HistoricalVersionsCount { get; set; } public List Children { get; set; }=new List (){ }; } From 10cf9087759790037f4df9698aefa6066246b5b9 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 8 May 2025 14:49:57 +0800 Subject: [PATCH 3/3] =?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 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs index fc8bc3ba6..d5bea6976 100644 --- a/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/AuditDocumentService.cs @@ -252,9 +252,12 @@ public class AuditDocumentService(IRepository _auditDocumentRepos var root = query .Skip(inDto.PageSize * (inDto.PageIndex - 1)).Take(inDto.PageSize).ToList(); + var historicalVersionList = await _auditDocumentRepository + .Where(x => x.AuditDocumentTypeEnum == AuditDocumentType.HistoricalVersion).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + foreach (var item in root) { - GetChildren(item, data); + GetChildren(item, data, historicalVersionList); } result.CurrentPageData = root; @@ -275,13 +278,13 @@ public class AuditDocumentService(IRepository _auditDocumentRepos } - private void GetChildren(AuditDocumentData item, List dataList) + private void GetChildren(AuditDocumentData item, List dataList, List historyList) { item.Children = dataList.Where(x => x.ParentId == item.Id).ToList(); - item.HistoricalVersionsCount= dataList.Where(x => x.MainFileId == item.Id).Count(); + item.HistoricalVersionsCount= historyList.Where(x => x.MainFileId == item.Id).Count(); foreach (var x in item.Children) { - GetChildren(x, dataList); + GetChildren(x, dataList, historyList); } }