修改中间调研邮件驳回
parent
a6cc74e1fe
commit
0cb54b4c40
|
@ -6605,7 +6605,7 @@
|
||||||
<param name="trialId"></param>
|
<param name="trialId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</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>
|
<summary>
|
||||||
驳回 New
|
驳回 New
|
||||||
</summary>
|
</summary>
|
||||||
|
|
|
@ -16,6 +16,8 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
Task AnolymousSendEmail(string researchProgramNo, string emailAddress, int verificationCode);
|
Task AnolymousSendEmail(string researchProgramNo, string emailAddress, int verificationCode);
|
||||||
|
|
||||||
|
Task SiteSurveyRejectEmail(MimeMessage messageToSend);
|
||||||
|
|
||||||
Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode);
|
Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode);
|
||||||
|
|
||||||
Task AnolymousSendEmailForResetAccount(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)
|
public async Task AddUserSendEmailAsync(Guid userId, string baseUrl, string routeUrl)
|
||||||
|
|
|
@ -170,7 +170,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
if (latestLock!.Email != userInfo.ReplaceUserEmailOrPhone)
|
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)
|
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>
|
/// </summary>
|
||||||
/// <param name="addOrEditTrialSiteSurvey"></param>
|
/// <param name="addOrEditTrialSiteSurvey"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
|
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||||
public async Task<IResponseOutput> AddOrUpdateTrialSiteSurvey(TrialSiteSurveyAddOrEdit addOrEditTrialSiteSurvey)
|
public async Task<IResponseOutput> AddOrUpdateTrialSiteSurvey(TrialSiteSurveyAddOrEdit addOrEditTrialSiteSurvey)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -466,9 +466,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
/// 驳回 New
|
/// 驳回 New
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <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;
|
var trialSiteSurveyId = trialSiteSubmitBackCommand.TrialSiteSurveyId;
|
||||||
|
|
||||||
|
@ -479,8 +479,6 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
User? user = null;
|
User? user = null;
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
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();
|
messageToSend.Body = builder.ToMessageBody();
|
||||||
|
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, null);
|
await _IMailVerificationService.SiteSurveyRejectEmail(messageToSend);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await _trialSiteSurveyRepository.SaveChangesAsync();
|
await _trialSiteSurveyRepository.SaveChangesAsync();
|
||||||
|
@ -617,7 +617,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
|
|
||||||
[HttpPut("{trialId:guid}/{trialSiteSurveyId:guid}")]
|
[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)
|
public async Task<IResponseOutput> AbandonSiteSurvey(Guid trialSiteSurveyId)
|
||||||
{
|
{
|
||||||
|
@ -645,7 +645,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
// [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
|
// [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
|
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> TrialSurveySubmit(TrialSiteSurvyeSubmitDTO siteSurvyeSubmit)
|
public async Task<IResponseOutput> TrialSurveySubmit(TrialSiteSurvyeSubmitDTO siteSurvyeSubmit)
|
||||||
{
|
{
|
||||||
|
@ -756,7 +756,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
await _trialSiteUserSurveyRepository.SaveChangesAsync();
|
await _trialSiteUserSurveyRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })]
|
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||||
|
|
||||||
public async Task<IResponseOutput> SendSiteSurveyUserJoinEmail(TrialSiteUserSurveyJoinCommand joinCommand)
|
public async Task<IResponseOutput> SendSiteSurveyUserJoinEmail(TrialSiteUserSurveyJoinCommand joinCommand)
|
||||||
{
|
{
|
||||||
|
@ -766,7 +766,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
foreach (var userInfo in joinCommand.UserList)
|
foreach (var userInfo in joinCommand.UserList)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(userInfo.SystemUserId == null)
|
if (userInfo.SystemUserId == null)
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException("生成账户Id 未取到值,请排查");
|
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))
|
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 });
|
await _repository.AddAsync(new TrialSiteUser() { TrialId = trialId, SiteId = siteId, UserId = userId });
|
||||||
|
|
||||||
|
@ -892,7 +892,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
smtp.MessageSent += (sender, args) =>
|
smtp.MessageSent += (sender, args) =>
|
||||||
{
|
{
|
||||||
|
|
||||||
_ = _trialSiteUserSurveyRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new TrialSiteUserSurvey() { IsGenerateSuccess = true, InviteState = TrialSiteUserStateEnum.HasSend, ConfirmTime = null, RejectReason = String.Empty, SystemUserId = sysUserInfo.Id, ExpireTime = DateTime.Now.AddDays(7) }).Result;
|
_ = _trialSiteUserSurveyRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new TrialSiteUserSurvey() { IsGenerateSuccess = true, InviteState = TrialSiteUserStateEnum.HasSend, ConfirmTime = null, RejectReason = String.Empty, SystemUserId = sysUserInfo.Id, ExpireTime = DateTime.Now.AddDays(7) }).Result;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue