From 8590a5012c6f122a110e93a7526fd7ff45f46ff1 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 21 Oct 2022 15:27:53 +0800 Subject: [PATCH] x --- .../DTO/TrialEmailNoticeConfigViewModel.cs | 2 +- .../Document/TrialEmailNoticeConfigService.cs | 80 ++++++++++--------- IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs | 6 +- .../ReadingQuestionCriterionTrial.cs | 2 +- 4 files changed, 48 insertions(+), 42 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs index 523ddb8ae..4dc91477d 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs @@ -21,7 +21,7 @@ namespace IRaCIS.Core.Application.ViewModel public DateTime CreateTime { get; set; } - public DateTime CreateUserId { get; set; } + public Guid CreateUserId { get; set; } } ///TrialEmailNoticeConfigQuery 列表查询参数模型 diff --git a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs index c90fa2d1c..6c01ccee8 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs @@ -101,43 +101,7 @@ namespace IRaCIS.Core.Application.Service //邮件内容html - var pathToFile = _hostEnvironment.WebRootPath - + Path.DirectorySeparatorChar.ToString() - + "EmailTemplate" - + Path.DirectorySeparatorChar.ToString() - + "SubjectEnrollConfirmOrPDProgress.html"; - - - if (businessScenarioEnum == CommonDocumentBusinessScenario.EnrollConfirmed) - { - - sendEmailConfig.TopicDescription = "入组确认测试"; - - using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile)) - { - var templateInfo = SourceReader.ReadToEnd(); - - - sendEmailConfig.HtmlBodyStr = string.Format(templateInfo, - $" 附件为入组确认报告,请查收 " - ); - } - } - else if (businessScenarioEnum == CommonDocumentBusinessScenario.PDConfirmed) - { - - sendEmailConfig.TopicDescription = "疾病进展测试"; - - using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile)) - { - var templateInfo = SourceReader.ReadToEnd(); - - - sendEmailConfig.HtmlBodyStr = string.Format(templateInfo, - $" 附件为疾病进展确认报告,请查收 " - ); - } - } + await FillWordTemplateAndSetEmailAsync(sendEmailConfig, businessScenarioEnum, criterionTypeEnum!); //邮件附件 var path = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, emailConfig.FilePath); @@ -162,6 +126,48 @@ namespace IRaCIS.Core.Application.Service + private async Task FillWordTemplateAndSetEmailAsync(SMTPEmailConfig sendEmailConfig, CommonDocumentBusinessScenario businessScenarioEnum, CriterionType criterionType) + { + var pathToFile = _hostEnvironment.WebRootPath + + Path.DirectorySeparatorChar.ToString() + + "EmailTemplate" + + Path.DirectorySeparatorChar.ToString() + + "SubjectEnrollConfirmOrPDProgress.html"; + + + if (businessScenarioEnum == CommonDocumentBusinessScenario.EnrollConfirmed) + { + + sendEmailConfig.TopicDescription = "入组确认"; + + using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile)) + { + var templateInfo = SourceReader.ReadToEnd(); + + + sendEmailConfig.HtmlBodyStr = string.Format(templateInfo, + $" 附件为入组确认报告,请查收 " + ); + } + } + else if (businessScenarioEnum == CommonDocumentBusinessScenario.PDConfirmed) + { + + sendEmailConfig.TopicDescription = "疾病进展"; + + using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile)) + { + var templateInfo = SourceReader.ReadToEnd(); + + + sendEmailConfig.HtmlBodyStr = string.Format(templateInfo, + $" 附件为疾病进展确认报告,请查收 " + ); + } + } + } + + [HttpPost] public async Task> GetTrialEmailNoticeConfigList(TrialEmailNoticeConfigQuery inQuery) { diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index 23e799c22..52f3eb1b2 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -78,10 +78,10 @@ namespace IRaCIS.Core.Domain.Share /// public enum CriterionType { - NoCriterion=-1, + NoCriterion = -1, - - None = 0, + //自定义 + SelfDefine = 0, /// /// RECIST 1.1 diff --git a/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs b/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs index 38170bcf6..f2aa83d67 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingCriterion/ReadingQuestionCriterionTrial.cs @@ -113,7 +113,7 @@ namespace IRaCIS.Core.Domain.Models /// /// 标准类型 /// - public CriterionType? CriterionType { get; set; } + public CriterionType CriterionType { get; set; } #region 阅片单元配置 新加