修改合并
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
b0d17b0466
|
@ -107,14 +107,18 @@ public class UrgentMedicalReviewAddedEventConsumer(
|
||||||
dictionValue[0], // 任务类型 {5}
|
dictionValue[0], // 任务类型 {5}
|
||||||
//dictionValue[1], // 阅片人是否同意 {6}
|
//dictionValue[1], // 阅片人是否同意 {6}
|
||||||
dictionValue[2], // 审核状态 {6}
|
dictionValue[2], // 审核状态 {6}
|
||||||
dictionValue[3] // 是否加急 {7}
|
dictionValue[3], // 是否加急 {7}
|
||||||
|
_systemEmailConfig.SiteUrl // 链接 {8}
|
||||||
);
|
);
|
||||||
|
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, EmailBusinessScenario.EligibilityVerification_MedicalQC, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
|
||||||
|
|
||||||
|
context.Message.IsPD ? EmailBusinessScenario.PDVerification_MedicalQC : EmailBusinessScenario.EligibilityVerification_MedicalQC,
|
||||||
|
|
||||||
|
messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -125,6 +129,7 @@ public class UrgentIRRepliedMedicalReviewConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<User> _userRepository,
|
||||||
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<Dictionary> _dictionaryRepository,
|
IRepository<Dictionary> _dictionaryRepository,
|
||||||
|
@ -137,73 +142,85 @@ public class UrgentIRRepliedMedicalReviewConsumer(
|
||||||
//IR 回复医学反馈通知MIM
|
//IR 回复医学反馈通知MIM
|
||||||
public async Task Consume(ConsumeContext<UrgentIRRepliedMedicalReview> context)
|
public async Task Consume(ConsumeContext<UrgentIRRepliedMedicalReview> context)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("发送【加急的医学反馈任务 通知MIM】邮件!!!");
|
Console.WriteLine("发送(028,029) 【IR 回复医学反馈通知MIM】邮件!!!");
|
||||||
//var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||||
|
|
||||||
//var medicalReviewId = context.Message.MedicalReviewId;
|
var medicalReviewId = context.Message.MedicalReviewId;
|
||||||
|
|
||||||
//var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == medicalReviewId).Include(x => x.VisitTask).Include(x => x.MedicalManagerUser).FirstOrDefaultAsync();
|
var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == medicalReviewId).Include(x => x.VisitTask).Include(x => x.MedicalManagerUser).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if (medicalReview.MedicalManagerUserId == null)
|
if (medicalReview.MedicalManagerUserId == null)
|
||||||
//{
|
{
|
||||||
// Console.WriteLine("MIMId为空 ID" + medicalReviewId);
|
Console.WriteLine("MIMId为空 ID" + medicalReviewId);
|
||||||
// return;
|
return;
|
||||||
//}
|
}
|
||||||
//var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
|
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
|
||||||
//var userinfo = await _userRepository.Where(x => x.Id == medicalReview.MedicalManagerUserId).FirstOrDefaultAsync();
|
var userinfo = await _userRepository.Where(x => x.Id == medicalReview.MedicalManagerUserId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
//var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
|
||||||
|
|
||||||
|
|
||||||
//var messageToSend = new MimeMessage();
|
var visitid = taskInfo.SourceSubjectVisit == null ? taskInfo.ReadModule.SubjectVisitId : taskInfo.SourceSubjectVisitId;
|
||||||
////发件地址
|
|
||||||
//messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
|
||||||
//messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
|
|
||||||
|
|
||||||
//var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == medicalReview.TrialId);
|
|
||||||
//var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
|
||||||
|
|
||||||
|
|
||||||
//var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
|
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == visitid).FirstOrDefaultAsync();
|
||||||
//{
|
|
||||||
|
|
||||||
// DictionaryRepository = _dictionaryRepository,
|
|
||||||
// IsEn_US = isEn_US,
|
|
||||||
|
|
||||||
|
|
||||||
// DictionaryList = new List<DictionaryDto>()
|
|
||||||
// {
|
|
||||||
// new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), },
|
|
||||||
// new DictionaryDto (){DictionaryCode= "MedicalReviewDoctorUserIdea",EnumValue=medicalReview.DoctorUserIdeaEnum.GetEnumInt(), },
|
|
||||||
// new DictionaryDto (){DictionaryCode= "MedicalReviewAuditState",EnumValue=medicalReview.AuditState.GetEnumInt(), },
|
|
||||||
// new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString(), }
|
|
||||||
// }
|
|
||||||
//});
|
|
||||||
|
|
||||||
//Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
var messageToSend = new MimeMessage();
|
||||||
//{
|
//发件地址
|
||||||
// var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||||
// var htmlBodyStr = string.Format(
|
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
|
||||||
// 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] // 是否加急
|
|
||||||
// );
|
|
||||||
|
|
||||||
// return (topicStr, htmlBodyStr);
|
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == medicalReview.TrialId);
|
||||||
//};
|
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||||
|
|
||||||
//await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, EmailBusinessScenario.EligibilityVerification_MedicalQC, messageToSend, emailConfigFunc);
|
|
||||||
|
|
||||||
//await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
|
||||||
|
{
|
||||||
|
|
||||||
|
DictionaryRepository = _dictionaryRepository,
|
||||||
|
IsEn_US = isEn_US,
|
||||||
|
|
||||||
|
|
||||||
|
DictionaryList = new List<DictionaryDto>()
|
||||||
|
{
|
||||||
|
new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), },
|
||||||
|
new DictionaryDto (){DictionaryCode= "MedicalReviewDoctorUserIdea",EnumValue=medicalReview.DoctorUserIdeaEnum.GetEnumInt(), },
|
||||||
|
new DictionaryDto (){DictionaryCode= "MedicalReviewAuditState",EnumValue=medicalReview.AuditState.GetEnumInt(), },
|
||||||
|
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString(), }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||||
|
{
|
||||||
|
var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
||||||
|
var htmlBodyStr = string.Format(
|
||||||
|
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||||
|
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], // 审核状态 {7}
|
||||||
|
dictionValue[3], // 是否加急 {8}
|
||||||
|
_systemEmailConfig.SiteUrl // 链接 {9}
|
||||||
|
);
|
||||||
|
|
||||||
|
return (topicStr, htmlBodyStr);
|
||||||
|
};
|
||||||
|
|
||||||
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
|
||||||
|
|
||||||
|
context.Message.IsPD ? EmailBusinessScenario.PDVerification_ExpeditedMedicalQCResponse : EmailBusinessScenario.EligibilityVerification_ExpeditedMedicalQCResponse,
|
||||||
|
|
||||||
|
messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,10 @@ public class UrgentMedicalReviewAddedEvent : DomainEvent
|
||||||
public class UrgentIRRepliedMedicalReview : DomainEvent
|
public class UrgentIRRepliedMedicalReview : DomainEvent
|
||||||
{
|
{
|
||||||
public Guid ReadingMedicalReviewDialogId { get; set; }
|
public Guid ReadingMedicalReviewDialogId { get; set; }
|
||||||
|
|
||||||
|
public Guid MedicalReviewId { get; set; }
|
||||||
|
|
||||||
|
public bool IsPD { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -220,7 +220,7 @@ public static class DBContext_Ext
|
||||||
}
|
}
|
||||||
else if (entry.State == EntityState.Added && readingMedicalReviewDialog.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer)
|
else if (entry.State == EntityState.Added && readingMedicalReviewDialog.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer)
|
||||||
{
|
{
|
||||||
readingMedicalReviewDialog.AddDomainEvent(new UrgentIRRepliedMedicalReview() { ReadingMedicalReviewDialogId = readingMedicalReviewDialog.Id });
|
readingMedicalReviewDialog.AddDomainEvent(new UrgentIRRepliedMedicalReview() { IsPD= findSubjectVisit.PDState == PDStateEnum.PDProgress, MedicalReviewId= readingMedicalReviewDialog.TaskMedicalReviewId, ReadingMedicalReviewDialogId = readingMedicalReviewDialog.Id });
|
||||||
}
|
}
|
||||||
|
|
||||||
//添加进记录
|
//添加进记录
|
||||||
|
|
Loading…
Reference in New Issue