From 1364031439efb8e7f15fe9f2409d52582965006a Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Thu, 24 Oct 2024 14:57:37 +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
---
.../IRaCIS.Core.Application.xml | 7 +++
.../Service/Doctor/DTO/DoctorModel.cs | 8 ++++
.../Service/Doctor/DoctorService.cs | 46 ++++++++++++++++++-
.../Common/EmailScenarioEnum.cs | 7 ++-
4 files changed, 66 insertions(+), 2 deletions(-)
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 5831202c8..363131471 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -1175,6 +1175,13 @@
+
+
+ 发送邮件
+
+
+
+
修改支付方式
diff --git a/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs b/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs
index 5011252ea..8221204be 100644
--- a/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs
+++ b/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs
@@ -315,6 +315,14 @@ namespace IRaCIS.Application.Contracts
}
+
+ public class SendEmailInDto
+ {
+ public string Email { get; set; }
+
+ public string Url { get; set; }
+ }
+
public class PaymentModeDto
{
public Guid Id { get; set; }
diff --git a/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs b/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs
index bf11fb433..5fd272523 100644
--- a/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs
+++ b/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs
@@ -1,8 +1,12 @@
using IRaCIS.Application.Contracts;
using IRaCIS.Application.Interfaces;
+using IRaCIS.Core.Application.Helper;
+using IRaCIS.Core.Application.MassTransit.Consumer;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Options;
+using MimeKit;
namespace IRaCIS.Core.Application.Service
{
@@ -11,13 +15,15 @@ namespace IRaCIS.Core.Application.Service
IRepository _doctorDictionaryRepository,
IRepository _enrollRepository,
IRepository _attachmentRepository,
+ IRepository _emailNoticeConfigrepository,
IRepository _doctorCriterionFileRepository,
IRepository _trialRepository,
IRepository _vacationRepository,
+ IOptionsMonitor systemEmailConfig,
IRepository _trialExtRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IDoctorService
{
-
+ private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
@@ -236,6 +242,44 @@ namespace IRaCIS.Core.Application.Service
return doctorBasicInfo;
}
+ ///
+ /// 发送邮件
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task SendEmail(SendEmailInDto inDto)
+ {
+ var messageToSend = new MimeMessage();
+ //发件地址
+ messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
+ messageToSend.To.Add(new MailboxAddress(String.Empty, inDto.Email));
+
+
+ Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
+ {
+ ;
+ var topicStr = string.Format(input.topicStr,string.Empty);
+ var htmlBodyStr = string.Format(
+
+
+ CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
+ _systemEmailConfig.SiteUrl.Replace("login",string.Empty)+inDto.Url
+ );
+
+ return (topicStr, htmlBodyStr);
+ };
+
+ await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
+
+ EmailBusinessScenario.Reviewer_CV_Collection,
+
+ messageToSend, emailConfigFunc);
+
+ await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
+
+ return true;
+ }
///
/// 修改支付方式
diff --git a/IRaCIS.Core.Domain.Share/Common/EmailScenarioEnum.cs b/IRaCIS.Core.Domain.Share/Common/EmailScenarioEnum.cs
index 1caeec8d2..096ef73cb 100644
--- a/IRaCIS.Core.Domain.Share/Common/EmailScenarioEnum.cs
+++ b/IRaCIS.Core.Domain.Share/Common/EmailScenarioEnum.cs
@@ -236,7 +236,12 @@ namespace IRaCIS.Core.Domain.Share
///
/// PD确认-加急医学反馈回复
///
- PDVerification_ExpeditedMedicalQCResponse = 56
+ PDVerification_ExpeditedMedicalQCResponse = 56,
+
+ ///
+ /// 阅片人简历采集
+ ///
+ Reviewer_CV_Collection = 57,
}