IRC_NewDev
he 2024-10-24 14:57:37 +08:00
parent 3bb02ccb24
commit 1364031439
4 changed files with 66 additions and 2 deletions

View File

@ -1175,6 +1175,13 @@
<param name="Id"></param> <param name="Id"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:IRaCIS.Core.Application.Service.DoctorService.SendEmail(IRaCIS.Application.Contracts.SendEmailInDto)">
<summary>
发送邮件
</summary>
<param name="inDto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.DoctorService.UpdatePaymentMode(IRaCIS.Application.Contracts.PaymentModeDto)"> <member name="M:IRaCIS.Core.Application.Service.DoctorService.UpdatePaymentMode(IRaCIS.Application.Contracts.PaymentModeDto)">
<summary> <summary>
修改支付方式 修改支付方式

View File

@ -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 class PaymentModeDto
{ {
public Guid Id { get; set; } public Guid Id { get; set; }

View File

@ -1,8 +1,12 @@
using IRaCIS.Application.Contracts; using IRaCIS.Application.Contracts;
using IRaCIS.Application.Interfaces; using IRaCIS.Application.Interfaces;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.MassTransit.Consumer;
using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using MimeKit;
namespace IRaCIS.Core.Application.Service namespace IRaCIS.Core.Application.Service
{ {
@ -11,13 +15,15 @@ namespace IRaCIS.Core.Application.Service
IRepository<DoctorDictionary> _doctorDictionaryRepository, IRepository<DoctorDictionary> _doctorDictionaryRepository,
IRepository<Enroll> _enrollRepository, IRepository<Enroll> _enrollRepository,
IRepository<Attachment> _attachmentRepository, IRepository<Attachment> _attachmentRepository,
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
IRepository<DoctorCriterionFile> _doctorCriterionFileRepository, IRepository<DoctorCriterionFile> _doctorCriterionFileRepository,
IRepository<Trial> _trialRepository, IRepository<Trial> _trialRepository,
IRepository<Vacation> _vacationRepository, IRepository<Vacation> _vacationRepository,
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig,
IRepository<TrialPaymentPrice> _trialExtRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IDoctorService IRepository<TrialPaymentPrice> _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; return doctorBasicInfo;
} }
/// <summary>
/// 发送邮件
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> 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;
}
/// <summary> /// <summary>
/// 修改支付方式 /// 修改支付方式

View File

@ -236,7 +236,12 @@ namespace IRaCIS.Core.Domain.Share
/// <summary> /// <summary>
/// PD确认-加急医学反馈回复 /// PD确认-加急医学反馈回复
/// </summary> /// </summary>
PDVerification_ExpeditedMedicalQCResponse = 56 PDVerification_ExpeditedMedicalQCResponse = 56,
/// <summary>
/// 阅片人简历采集
/// </summary>
Reviewer_CV_Collection = 57,
} }