修改中间调研邮件驳回

Uat_Study
{872297557@qq.com} 2022-12-13 14:45:25 +08:00
parent a6cc74e1fe
commit 0cb54b4c40
3 changed files with 31 additions and 19 deletions

View File

@ -6605,7 +6605,7 @@
<param name="trialId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.SubmissionRejection(IRaCIS.Core.Application.Contracts.TrialSiteSubmitBackCommand)">
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.SubmissionRejection(IRaCIS.Core.Application.Contracts.TrialSiteSubmitBackCommand,IRaCIS.Application.Services.IMailVerificationService)">
<summary>
驳回 New
</summary>

View File

@ -16,6 +16,8 @@ namespace IRaCIS.Application.Services
Task AnolymousSendEmail(string researchProgramNo, string emailAddress, int verificationCode);
Task SiteSurveyRejectEmail(MimeMessage messageToSend);
Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode);
Task AnolymousSendEmailForResetAccount(string emailAddress, int verificationCode);
@ -269,7 +271,17 @@ namespace IRaCIS.Application.Services
}
public async Task SiteSurveyRejectEmail(MimeMessage messageToSend)
{
//发件地址
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
}
//添加用户发送邮件
public async Task AddUserSendEmailAsync(Guid userId, string baseUrl, string routeUrl)

View File

@ -170,7 +170,7 @@ namespace IRaCIS.Core.Application.Contracts
if (latestLock!.Email != userInfo.ReplaceUserEmailOrPhone)
{
return ResponseOutput.NotOk($"该邮箱{userInfo.ReplaceUserEmailOrPhone }对应的调查表不是最新锁定的记录,不允许更新!");
return ResponseOutput.NotOk($"该邮箱{userInfo.ReplaceUserEmailOrPhone}对应的调查表不是最新锁定的记录,不允许更新!");
}
var lockedLastSurvey = await _trialSiteSurveyRepository.Where(t => (t.Email == userInfo.ReplaceUserEmailOrPhone || t.Phone == userInfo.ReplaceUserEmailOrPhone) && t.SiteId == userInfo.SiteId && t.TrialId == userInfo.TrialId && t.State == TrialSiteSurveyEnum.PMCreatedAndLock == true)
@ -323,7 +323,7 @@ namespace IRaCIS.Core.Application.Contracts
/// </summary>
/// <param name="addOrEditTrialSiteSurvey"></param>
/// <returns></returns>
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> AddOrUpdateTrialSiteSurvey(TrialSiteSurveyAddOrEdit addOrEditTrialSiteSurvey)
{
@ -466,9 +466,9 @@ namespace IRaCIS.Core.Application.Contracts
/// 驳回 New
/// </summary>
/// <returns></returns>
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> SubmissionRejection(TrialSiteSubmitBackCommand trialSiteSubmitBackCommand)
public async Task<IResponseOutput> SubmissionRejection(TrialSiteSubmitBackCommand trialSiteSubmitBackCommand, [FromServices] IMailVerificationService _IMailVerificationService)
{
var trialSiteSurveyId = trialSiteSubmitBackCommand.TrialSiteSurveyId;
@ -479,8 +479,6 @@ namespace IRaCIS.Core.Application.Contracts
User? user = null;
var messageToSend = new MimeMessage();
//发件地址
messageToSend.From.Add(new MailboxAddress("GRR", "iracis_grr@163.com"));
@ -565,11 +563,13 @@ namespace IRaCIS.Core.Application.Contracts
);
}
messageToSend.Body = builder.ToMessageBody();
await SendEmailHelper.SendEmailAsync(messageToSend, null);
await _IMailVerificationService.SiteSurveyRejectEmail(messageToSend);
await _trialSiteSurveyRepository.SaveChangesAsync();
@ -617,7 +617,7 @@ namespace IRaCIS.Core.Application.Contracts
[HttpPut("{trialId:guid}/{trialSiteSurveyId:guid}")]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> AbandonSiteSurvey(Guid trialSiteSurveyId)
{
@ -645,7 +645,7 @@ namespace IRaCIS.Core.Application.Contracts
/// <returns></returns>
// [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[HttpPost]
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
[UnitOfWork]
public async Task<IResponseOutput> TrialSurveySubmit(TrialSiteSurvyeSubmitDTO siteSurvyeSubmit)
{
@ -756,7 +756,7 @@ namespace IRaCIS.Core.Application.Contracts
await _trialSiteUserSurveyRepository.SaveChangesAsync();
}
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
public async Task<IResponseOutput> SendSiteSurveyUserJoinEmail(TrialSiteUserSurveyJoinCommand joinCommand)
{
@ -766,7 +766,7 @@ namespace IRaCIS.Core.Application.Contracts
foreach (var userInfo in joinCommand.UserList)
{
if(userInfo.SystemUserId == null)
if (userInfo.SystemUserId == null)
{
throw new BusinessValidationFailedException("生成账户Id 未取到值,请排查");
}
@ -782,7 +782,7 @@ namespace IRaCIS.Core.Application.Contracts
if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId, true))
{
await _repository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId ,JoinTime=DateTime.Now});
await _repository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId });