修改字典表bug
parent
3a7a8dc5e3
commit
a4d0a5a57a
|
@ -123,6 +123,9 @@
|
||||||
<Content Update="wwwroot\EmailTemplate\TrialDoctorFirstJoin.html">
|
<Content Update="wwwroot\EmailTemplate\TrialDoctorFirstJoin.html">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Update="wwwroot\EmailTemplate\SubjectEnrollConfirmOrPDProgress.html">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Update="wwwroot\EmailTemplate\UserOptCommon.html">
|
<Content Update="wwwroot\EmailTemplate\UserOptCommon.html">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang='en'>
|
||||||
|
<head>
|
||||||
|
<meta charset='UTF-8'>
|
||||||
|
<title>Title</title>
|
||||||
|
</head>
|
||||||
|
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
|
||||||
|
<div style='padding-left: 40px;background: #f6f6f6'>
|
||||||
|
<div style='padding-top: 20px;'>
|
||||||
|
<div style='line-height: 40px;font-size: 18px'>
|
||||||
|
您好:
|
||||||
|
</div>
|
||||||
|
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||||
|
感谢您使用展影云平台。
|
||||||
|
</div>
|
||||||
|
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||||
|
{0}。
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||||
|
<div>祝您顺利!/Best Regards</div>
|
||||||
|
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -31,8 +31,53 @@ public static class SendEmailHelper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task SendEmailAsync(MimeMessage messageToSend, SMTPEmailConfig sMTPEmailConfig, EventHandler<MessageSentEventArgs>? messageSentSuccess = null)
|
public static async Task SendEmailAsync(SMTPEmailConfig sMTPEmailConfig, EventHandler<MessageSentEventArgs>? messageSentSuccess = null)
|
||||||
{
|
{
|
||||||
|
var messageToSend = new MimeMessage();
|
||||||
|
|
||||||
|
//主题
|
||||||
|
messageToSend.Subject = sMTPEmailConfig.TopicDescription;
|
||||||
|
|
||||||
|
//发件地址
|
||||||
|
messageToSend.From.Add(sMTPEmailConfig.FromEmailAddress);
|
||||||
|
|
||||||
|
//收件地址
|
||||||
|
|
||||||
|
if (sMTPEmailConfig.ToMailAddressList.Count == 0)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("没有收件人");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var item in sMTPEmailConfig.ToMailAddressList)
|
||||||
|
{
|
||||||
|
messageToSend.To.Add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
//抄送
|
||||||
|
foreach (var copyToMailAddress in sMTPEmailConfig.CopyToMailAddressList)
|
||||||
|
{
|
||||||
|
messageToSend.Cc.Add(copyToMailAddress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var builder = new BodyBuilder();
|
||||||
|
|
||||||
|
//html body
|
||||||
|
|
||||||
|
builder.HtmlBody = sMTPEmailConfig.HtmlBodyStr;
|
||||||
|
|
||||||
|
|
||||||
|
//附件
|
||||||
|
|
||||||
|
foreach (var item in sMTPEmailConfig.EmailAttachMentConfigList)
|
||||||
|
{
|
||||||
|
await builder.Attachments.AddAsync(item.FileName, item.FileStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
messageToSend.Body = builder.ToMessageBody();
|
||||||
|
|
||||||
using (var smtp = new MailKit.Net.Smtp.SmtpClient())
|
using (var smtp = new MailKit.Net.Smtp.SmtpClient())
|
||||||
{
|
{
|
||||||
if (messageSentSuccess != null)
|
if (messageSentSuccess != null)
|
||||||
|
@ -61,12 +106,42 @@ public static class SendEmailHelper
|
||||||
|
|
||||||
public class SMTPEmailConfig
|
public class SMTPEmailConfig
|
||||||
{
|
{
|
||||||
public int Port { get; set; }
|
public int Port { get; set; } = 465;
|
||||||
|
|
||||||
public string Host { get; set; }
|
public string Host { get; set; } = "smtp.163.com";
|
||||||
|
|
||||||
|
|
||||||
public string UserName { get; set; }
|
public string UserName { get; set; } = "iracis_grr@163.com";
|
||||||
|
|
||||||
|
public string AuthorizationCode { get; set; } = "XLWVQKZAEKLDWOAH";
|
||||||
|
|
||||||
|
|
||||||
|
//邮件HtmlBody
|
||||||
|
|
||||||
|
public string HtmlBodyStr { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
//发
|
||||||
|
public MailboxAddress FromEmailAddress { get; set; } = new MailboxAddress("GRR", "iracis_grr@163.com");
|
||||||
|
|
||||||
|
//收
|
||||||
|
public List<MailboxAddress> ToMailAddressList { get; set; } = new List<MailboxAddress>();
|
||||||
|
|
||||||
|
//抄送
|
||||||
|
public List<MailboxAddress> CopyToMailAddressList { get; set; } = new List<MailboxAddress>();
|
||||||
|
|
||||||
|
//邮件主题
|
||||||
|
public string TopicDescription { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
//邮件附件
|
||||||
|
public List<EmailAttachMentConfig> EmailAttachMentConfigList { get; set; } = new List<EmailAttachMentConfig>() { };
|
||||||
|
|
||||||
public string AuthorizationCode { get; set; }
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class EmailAttachMentConfig
|
||||||
|
{
|
||||||
|
public string FileName { get; set; }
|
||||||
|
|
||||||
|
public Stream FileStream { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,6 +92,7 @@
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="MimeKit" Version="3.4.1" />
|
<PackageReference Include="MimeKit" Version="3.4.1" />
|
||||||
<PackageReference Include="MiniExcel" Version="1.28.0" />
|
<PackageReference Include="MiniExcel" Version="1.28.0" />
|
||||||
|
<PackageReference Include="MiniWord" Version="0.6.1" />
|
||||||
<PackageReference Include="My.Extensions.Localization.Json" Version="3.0.0">
|
<PackageReference Include="My.Extensions.Localization.Json" Version="3.0.0">
|
||||||
<TreatAsUsed>true</TreatAsUsed>
|
<TreatAsUsed>true</TreatAsUsed>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
|
@ -398,6 +398,7 @@
|
||||||
同步系统配置的文档到想项目中
|
同步系统配置的文档到想项目中
|
||||||
</summary>
|
</summary>
|
||||||
<param name="trialId"></param>
|
<param name="trialId"></param>
|
||||||
|
<param name="criterionTypeEnum"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
|
|
||||||
</member>
|
</member>
|
||||||
|
@ -7059,6 +7060,13 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.TrialConfigService.AsyncTrialCriterionDictionary(IRaCIS.Core.Application.Contracts.AsyncTrialCriterionDictionaryInDto)">
|
||||||
|
<summary>
|
||||||
|
同步项目标准字典信息
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.TrialConfigService.SetGlobalReadingInfo(IRaCIS.Core.Application.Contracts.SetGlobalReadingInfoInDto)">
|
<member name="M:IRaCIS.Core.Application.TrialConfigService.SetGlobalReadingInfo(IRaCIS.Core.Application.Contracts.SetGlobalReadingInfoInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
修改全局阅片配置信息
|
修改全局阅片配置信息
|
||||||
|
|
|
@ -123,9 +123,11 @@ namespace IRaCIS.Application.Services
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
if (addOrEditBasic.Id != null && addOrEditBasic.ParentId!=null)
|
if (addOrEditBasic.Id != null && addOrEditBasic.ParentId==null)
|
||||||
{
|
{
|
||||||
await _dicRepository.UpdatePartialFromQueryAsync(t => t.ParentId == addOrEditBasic.Id, c => new Dictionary() { DataTypeEnum = addOrEditBasic.DataTypeEnum });
|
await _dicRepository.UpdatePartialFromQueryAsync(t => t.ParentId == addOrEditBasic.Id, c => new Dictionary() { DataTypeEnum = addOrEditBasic.DataTypeEnum });
|
||||||
|
|
||||||
|
//await _dicRepository.BatchUpdateNoTrackingAsync(t => t.ParentId == addOrEditBasic.Id, c => new Dictionary() { DataTypeEnum = addOrEditBasic.DataTypeEnum });
|
||||||
}
|
}
|
||||||
|
|
||||||
var entity = await _dicRepository.InsertOrUpdateAsync(addOrEditBasic, true, verifyExp1);
|
var entity = await _dicRepository.InsertOrUpdateAsync(addOrEditBasic, true, verifyExp1);
|
||||||
|
|
|
@ -92,7 +92,7 @@ namespace IRaCIS.Application.Services
|
||||||
messageToSend.To.Add(new MailboxAddress(userName, emailAddress));
|
messageToSend.To.Add(new MailboxAddress(userName, emailAddress));
|
||||||
//主题
|
//主题
|
||||||
messageToSend.Subject = "[来自展影IRC] 关于重置邮箱的提醒";
|
messageToSend.Subject = "[来自展影IRC] 关于重置邮箱的提醒";
|
||||||
|
|
||||||
var builder = new BodyBuilder();
|
var builder = new BodyBuilder();
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,7 +115,6 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
messageToSend.Body = builder.ToMessageBody();
|
messageToSend.Body = builder.ToMessageBody();
|
||||||
|
|
||||||
|
|
||||||
|
@ -495,7 +494,7 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//医生生成账号加入 或者已存在账号加入到项目中
|
||||||
public async Task<Guid> DoctorJoinTrialEmail(Guid trialId, Guid doctorId, string baseUrl, string rootUrl)
|
public async Task<Guid> DoctorJoinTrialEmail(Guid trialId, Guid doctorId, string baseUrl, string rootUrl)
|
||||||
{
|
{
|
||||||
var doctor = await _doctorTypeRepository.FindAsync(doctorId);
|
var doctor = await _doctorTypeRepository.FindAsync(doctorId);
|
||||||
|
|
|
@ -9,6 +9,8 @@ using Microsoft.AspNetCore.Mvc;
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
|
@ -31,6 +33,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// 同步系统配置的文档到想项目中
|
/// 同步系统配置的文档到想项目中
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="trialId"></param>
|
/// <param name="trialId"></param>
|
||||||
|
/// <param name="criterionTypeEnum"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
///
|
///
|
||||||
private async Task SyncSystemEmainCofigDocListAsync(Guid trialId, CriterionType? criterionTypeEnum)
|
private async Task SyncSystemEmainCofigDocListAsync(Guid trialId, CriterionType? criterionTypeEnum)
|
||||||
|
@ -56,6 +59,91 @@ namespace IRaCIS.Core.Application.Service
|
||||||
await _trialEmailNoticeConfigRepository.SaveChangesAsync();
|
await _trialEmailNoticeConfigRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private async Task FillWordTemplate(Guid trialId, CriterionType criterionTypeEnum, CommonDocumentBusinessScenario businessScenarioEnum)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private async Task <SMTPEmailConfig> FillWordTemplateAndEmailConfig(Guid trialId, Guid visitTaskId, Guid trialReadingCriterionId, CommonDocumentBusinessScenario businessScenarioEnum)
|
||||||
|
{
|
||||||
|
var criterionTypeEnum = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId && t.Id == trialReadingCriterionId).Select(t => t.CriterionType).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var emailConfig = await _trialEmailNoticeConfigRepository.Where(t => t.TrialId == trialId && t.CriterionTypeEnum == criterionTypeEnum && t.BusinessScenarioEnum == businessScenarioEnum).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (emailConfig == null)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("找不到该项目标准场景下邮件的配置");
|
||||||
|
}
|
||||||
|
|
||||||
|
//填充邮件基本配置
|
||||||
|
|
||||||
|
var sendEmailConfig = new SMTPEmailConfig();
|
||||||
|
|
||||||
|
sendEmailConfig.TopicDescription = "入组确认测试";
|
||||||
|
|
||||||
|
foreach (var item in emailConfig.ReceiveEmailList)
|
||||||
|
{
|
||||||
|
sendEmailConfig.ToMailAddressList.Add(new MimeKit.MailboxAddress(string.Empty, item));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in emailConfig.CopyEmailList)
|
||||||
|
{
|
||||||
|
sendEmailConfig.CopyToMailAddressList.Add(new MimeKit.MailboxAddress(string.Empty, item));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//邮件内容html
|
||||||
|
var pathToFile = _hostEnvironment.WebRootPath
|
||||||
|
+ Path.DirectorySeparatorChar.ToString()
|
||||||
|
+ "EmailTemplate"
|
||||||
|
+ Path.DirectorySeparatorChar.ToString()
|
||||||
|
+ "SubjectEnrollConfirm.html";
|
||||||
|
|
||||||
|
using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile))
|
||||||
|
{
|
||||||
|
var templateInfo = SourceReader.ReadToEnd();
|
||||||
|
|
||||||
|
|
||||||
|
sendEmailConfig.HtmlBodyStr = string.Format(templateInfo,
|
||||||
|
$" 附件为入组确认报告,请查收 "
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//邮件附件
|
||||||
|
|
||||||
|
var path= FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, emailConfig.FilePath);
|
||||||
|
|
||||||
|
//sendEmailConfig.EmailAttachMentConfigList.Add(new EmailAttachMentConfig()
|
||||||
|
//{
|
||||||
|
// FileName = emailConfig.FileName,
|
||||||
|
// FileStream =
|
||||||
|
//});
|
||||||
|
|
||||||
|
|
||||||
|
if (businessScenarioEnum == CommonDocumentBusinessScenario.EnrollConfirmed)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(businessScenarioEnum == CommonDocumentBusinessScenario.PDConfirmed)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return sendEmailConfig;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task<List<TrialEmailNoticeConfigView>> GetTrialEmailNoticeConfigList(TrialEmailNoticeConfigQuery inQuery)
|
public async Task<List<TrialEmailNoticeConfigView>> GetTrialEmailNoticeConfigList(TrialEmailNoticeConfigQuery inQuery)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue