中心调研拒绝邮件模板
parent
f0f99ce647
commit
6e45be1f56
|
@ -109,6 +109,9 @@
|
||||||
<Content Update="NLog.config">
|
<Content Update="NLog.config">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Update="wwwroot\EmailTemplate\TrialSiteSurveyReject.html">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Update="wwwroot\EmailTemplate\TrialUserExistJoin.html">
|
<Content Update="wwwroot\EmailTemplate\TrialUserExistJoin.html">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<!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'>
|
||||||
|
尊敬的 {0} ,您好:
|
||||||
|
</div>
|
||||||
|
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||||
|
您好, 您填写的中心调研表被驳回,详细信息如下:
|
||||||
|
</div>
|
||||||
|
<span style="color: #00D1B2"></span>
|
||||||
|
<div style='border: 1px solid #eee;box-sizing:border-box;width: 50%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;'>
|
||||||
|
<div>
|
||||||
|
项目编号: {1}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
试验方案号: {2}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
试验名称: {3}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
中心编号: {4}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
中心名称: {5}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
驳回原因: {6}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<a href='{7}' style='margin-left:60px;font-size:14px;padding: 10px;text-decoration: none;display:{8} ;height: 40px;width: 140px;background: #00D1B2;color:#fff;border-radius: 5px;line-height: 40px;text-align: center;margin-bottom: 100px;'>
|
||||||
|
登陆并查看
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<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,7 +31,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
private readonly IRepository<TrialUser> _trialUserRepository;
|
private readonly IRepository<TrialUser> _trialUserRepository;
|
||||||
private readonly ITokenService _tokenService;
|
private readonly ITokenService _tokenService;
|
||||||
|
|
||||||
public TrialSiteSurveyService(IRepository<TrialSiteSurvey> trialSiteSurveyRepository, IRepository<TrialUser> trialUserRepository,IRepository<TrialSiteUserSurvey> trialSiteUserSurveyRepository,
|
public TrialSiteSurveyService(IRepository<TrialSiteSurvey> trialSiteSurveyRepository, IRepository<TrialUser> trialUserRepository, IRepository<TrialSiteUserSurvey> trialSiteUserSurveyRepository,
|
||||||
IRepository<User> userRepository, IRepository<TrialSite> trialSiteRepository, ITokenService tokenService)
|
IRepository<User> userRepository, IRepository<TrialSite> trialSiteRepository, ITokenService tokenService)
|
||||||
{
|
{
|
||||||
_trialSiteSurveyRepository = trialSiteSurveyRepository;
|
_trialSiteSurveyRepository = trialSiteSurveyRepository;
|
||||||
|
@ -373,7 +373,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
var entity = await _trialSiteSurveyRepository.Where(t => t.Id == addOrEditTrialSiteSurvey.Id, true).Include(x=>x.ReviewerUser).Include(x=>x.PreliminaryUser).FirstOrDefaultAsync();
|
var entity = await _trialSiteSurveyRepository.Where(t => t.Id == addOrEditTrialSiteSurvey.Id, true).Include(x => x.ReviewerUser).Include(x => x.PreliminaryUser).FirstOrDefaultAsync();
|
||||||
_mapper.Map(addOrEditTrialSiteSurvey, entity);
|
_mapper.Map(addOrEditTrialSiteSurvey, entity);
|
||||||
await _trialSiteSurveyRepository.SaveChangesAsync();
|
await _trialSiteSurveyRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
@ -567,44 +567,30 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
//主题
|
//主题
|
||||||
messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 关于中心调研审批的提醒";
|
messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 关于中心调研审批的提醒";
|
||||||
|
|
||||||
builder.HtmlBody = @$"<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
|
var pathToFile = _hostEnvironment.WebRootPath
|
||||||
<div style='padding-left: 40px;background: #f6f6f6'>
|
+ Path.DirectorySeparatorChar.ToString()
|
||||||
<div style='padding-top: 20px;'>
|
+ "EmailTemplate"
|
||||||
<div style='line-height: 40px;font-size: 18px'>
|
+ Path.DirectorySeparatorChar.ToString()
|
||||||
{ (user == null ? survey.UserName : user.LastName + "/ " + user.FirstName)}:
|
+ "TrialSiteSurveyReject.html";
|
||||||
</div>
|
|
||||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
|
||||||
您好, 您填写的中心调研表被驳回,详细信息如下:
|
|
||||||
</div>
|
|
||||||
<div style='border: 1px solid #eee;box-sizing:border-box;width: 80%;background: #fff;padding: 20px;line-height: 40px;font-size: 14px;border-radius: 5px;margin-left: 60px;margin-bottom: 30px;'>
|
|
||||||
<div>
|
|
||||||
项目编号: {trialInfo.TrialCode}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
试验方案号: {trialInfo.ResearchProgramNo}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
试验名称: {trialInfo.ExperimentName}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
中心编号: {siteInfo.TrialSiteCode}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
中心名称: {siteInfo.TrialSiteAliasName}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
驳回原因: {survey.LatestBackReason}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
|
|
||||||
<a href='{ trialSiteSubmitBackCommand.RouteUrl}' style='margin-left:60px;font-size:14px;padding: 10px;text-decoration: none;display:{(survey.State == TrialSiteSurveyEnum.ToSubmit ? "inline - block" : "none")} ;height: 40px;width: 140px;background: #00D1B2;color:#fff;border-radius: 5px;line-height: 40px;text-align: center;margin-bottom: 100px;'>
|
using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile))
|
||||||
登陆并查看
|
{
|
||||||
</a>
|
var templateInfo = SourceReader.ReadToEnd();
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
builder.HtmlBody = string.Format(templateInfo,
|
||||||
</div>
|
(user == null ? survey.UserName : user.LastName + "/ " + user.FirstName),
|
||||||
</body>";
|
trialInfo.TrialCode,
|
||||||
|
trialInfo.ResearchProgramNo,
|
||||||
|
trialInfo.ExperimentName,
|
||||||
|
siteInfo.TrialSiteCode,
|
||||||
|
siteInfo.TrialSiteAliasName,
|
||||||
|
survey.LatestBackReason,
|
||||||
|
trialSiteSubmitBackCommand.RouteUrl,
|
||||||
|
(survey.State == TrialSiteSurveyEnum.ToSubmit ? "inline - block" : "none")
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
messageToSend.Body = builder.ToMessageBody();
|
messageToSend.Body = builder.ToMessageBody();
|
||||||
|
|
||||||
|
@ -732,7 +718,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
|
|
||||||
await GenerateAccountAsync(needGenerateList);
|
await GenerateAccountAsync(needGenerateList);
|
||||||
await SendSiteSurveyUserJoinEmail(new TrialSiteUserSurveyJoinCommand() { TrialId = trialId, TrialSiteSurveyId= trialSiteSurveyId, RouteUrl = siteSurvyeSubmit.RouteUrl, BaseUrl = siteSurvyeSubmit.BaseUrl, UserList = needGenerateList });
|
await SendSiteSurveyUserJoinEmail(new TrialSiteUserSurveyJoinCommand() { TrialId = trialId, TrialSiteSurveyId = trialSiteSurveyId, RouteUrl = siteSurvyeSubmit.RouteUrl, BaseUrl = siteSurvyeSubmit.BaseUrl, UserList = needGenerateList });
|
||||||
|
|
||||||
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.SPMApproved, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.PMCreatedAndLock, ReviewerUserId = _userInfo.Id, ReviewerTime = DateTime.Now });
|
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.SPMApproved, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.PMCreatedAndLock, ReviewerUserId = _userInfo.Id, ReviewerTime = DateTime.Now });
|
||||||
|
|
||||||
|
@ -835,7 +821,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
trialInfo.TrialCode,
|
trialInfo.TrialCode,
|
||||||
sysUserInfo.UserName,
|
sysUserInfo.UserName,
|
||||||
sysUserInfo.UserTypeRole.UserTypeShortName,
|
sysUserInfo.UserTypeRole.UserTypeShortName,
|
||||||
sysUserInfo.IsFirstAdd ? routeUrl:joinCommand.BaseUrl
|
sysUserInfo.IsFirstAdd ? routeUrl : joinCommand.BaseUrl
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -851,7 +837,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
var siteId = trialSiteSurvey.SiteId;
|
var siteId = trialSiteSurvey.SiteId;
|
||||||
|
|
||||||
//判断TrialUser中是否存在 不存在就插入
|
//判断TrialUser中是否存在 不存在就插入
|
||||||
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 });
|
await _repository.AddAsync(new TrialUser() { TrialId = trialId, UserId = userId });
|
||||||
|
|
Loading…
Reference in New Issue