修改
This commit is contained in:
@@ -24,6 +24,7 @@ public class UrgentMedicalReviewAddedEventConsumer(
|
||||
IRepository<User> _userRepository,
|
||||
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
@@ -34,14 +35,14 @@ public class UrgentMedicalReviewAddedEventConsumer(
|
||||
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||
|
||||
/// <summary>
|
||||
/// 加急的医学反馈任务 通知MIM
|
||||
/// 加急的医学反馈任务 通知MIM (026,027)
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task Consume(ConsumeContext<UrgentMedicalReviewAddedEvent> context)
|
||||
{
|
||||
Console.WriteLine("发送【加急的医学反馈任务 通知MIM】邮件!!!");
|
||||
Console.WriteLine("发送(026,027) 【加急的医学反馈任务 通知MIM】邮件!!!");
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||
|
||||
var medicalReviewId = context.Message.MedicalReviewId;
|
||||
@@ -61,6 +62,13 @@ public class UrgentMedicalReviewAddedEventConsumer(
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x=>x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
|
||||
|
||||
|
||||
var visitid = taskInfo.SourceSubjectVisit == null ? taskInfo.ReadModule.SubjectVisitId : taskInfo.SourceSubjectVisitId;
|
||||
|
||||
|
||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == visitid).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
|
||||
var messageToSend = new MimeMessage();
|
||||
//发件地址
|
||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||
@@ -91,15 +99,16 @@ public class UrgentMedicalReviewAddedEventConsumer(
|
||||
var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
||||
var htmlBodyStr = string.Format(
|
||||
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||
userinfo.FullName, // 用户名
|
||||
trialInfo.ExperimentName, // 项目
|
||||
criterion.CriterionName, // 阅片标准
|
||||
taskInfo.BlindSubjectCode.IsNullOrEmpty() ? taskInfo.Subject.Code : taskInfo.BlindSubjectCode, // 受试者
|
||||
taskInfo.TaskBlindName, // 访视
|
||||
dictionValue[0], // 任务类型
|
||||
dictionValue[1], // 阅片人是否同意
|
||||
dictionValue[2], // 审核状态
|
||||
dictionValue[3] // 是否加急
|
||||
userinfo.FullName, // 用户名 {0}
|
||||
trialInfo.ExperimentName, // 项目 {1}
|
||||
criterion.CriterionName, // 阅片标准 {2}
|
||||
taskInfo.BlindSubjectCode.IsNullOrEmpty() ? taskInfo.Subject.Code : taskInfo.BlindSubjectCode, // 受试者 {3}
|
||||
taskInfo.TaskBlindName, // 访视 {4}
|
||||
dictionValue[0], // 任务类型 {5}
|
||||
//dictionValue[1], // 阅片人是否同意 {6}
|
||||
dictionValue[2], // 审核状态 {6}
|
||||
dictionValue[3], // 是否加急 {7}
|
||||
|
||||
);
|
||||
|
||||
return (topicStr, htmlBodyStr);
|
||||
|
||||
Reference in New Issue
Block a user