Compare commits
No commits in common. "b809a3b102abd08a70dd6902665b492d150f2f19" and "5ee5bac4adc3b6746b48073b0704e009fdf8a937" have entirely different histories.
b809a3b102
...
5ee5bac4ad
|
|
@ -55,20 +55,6 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
|
|||
auditStateCode = "AuditStateRC";
|
||||
}
|
||||
|
||||
|
||||
|
||||
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
|
||||
{
|
||||
|
||||
DictionaryRepository = _dictionaryRepository,
|
||||
IsEn_US = isEn_US,
|
||||
DictionaryList = new List<DictionaryDto>()
|
||||
{
|
||||
new DictionaryDto (){DictionaryCode= auditStateCode,EnumValue=subjectVisit.AuditState.GetEnumInt(), }, //审核状态
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
foreach (var userinfo in userinfoList)
|
||||
{
|
||||
var messageToSend = new MimeMessage();
|
||||
|
|
@ -80,6 +66,17 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
|
|||
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||
|
||||
|
||||
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
|
||||
{
|
||||
|
||||
DictionaryRepository = _dictionaryRepository,
|
||||
IsEn_US = isEn_US,
|
||||
DictionaryList = new List<DictionaryDto>()
|
||||
{
|
||||
new DictionaryDto (){DictionaryCode= auditStateCode,EnumValue=subjectVisit.AuditState.GetEnumInt(), }, //审核状态
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
|
|
@ -200,180 +197,25 @@ public class CRCRepliedQCChallengeEventConsumer(
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// QC回复 质控质疑,通知CRC (014,015)
|
||||
/// QC回复 质控质疑,通知CRC
|
||||
/// </summary>
|
||||
public class QCRepliedQCChallengeEventConsumer(
|
||||
IRepository<User> _userRepository,
|
||||
IRepository<TrialUser> _trialUseRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<QCChallenge> _qCChallengeRepository,
|
||||
IRepository<QCChallengeDialog> _qCChallengeDialogRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<QCRepliedQCChallengeEvent>
|
||||
public class QCRepliedQCChallengeEventConsumer : IConsumer<QCRepliedQCChallengeEvent>
|
||||
{
|
||||
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||
public async Task Consume(ConsumeContext<QCRepliedQCChallengeEvent> context)
|
||||
public Task Consume(ConsumeContext<QCRepliedQCChallengeEvent> context)
|
||||
{
|
||||
Console.WriteLine("发送(014,015) 【 QC回复 质控质疑,通知CRC】邮件!!!");
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||
|
||||
var subjectVisitId = context.Message.SubjectVisitId;
|
||||
|
||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
|
||||
|
||||
var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
|
||||
|
||||
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.CRA || x.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).ToList();
|
||||
|
||||
|
||||
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
|
||||
|
||||
|
||||
|
||||
|
||||
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
|
||||
{
|
||||
|
||||
DictionaryRepository = _dictionaryRepository,
|
||||
IsEn_US = isEn_US,
|
||||
DictionaryList = new List<DictionaryDto>()
|
||||
{
|
||||
new DictionaryDto (){DictionaryCode= "CheckState",EnumValue=subjectVisit.CheckState.GetEnumInt(), }, //审核状态
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
foreach (var userinfo in userinfoList)
|
||||
{
|
||||
var messageToSend = new MimeMessage();
|
||||
//发件地址
|
||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
|
||||
|
||||
|
||||
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||
|
||||
|
||||
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
var subjectCode = subjectVisit.Subject.Code;
|
||||
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
||||
var htmlBodyStr = string.Format(
|
||||
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||
trialInfo.ExperimentName, // 项目 {1}
|
||||
userinfo.FullName, // 用户名 {1}
|
||||
subjectCode, // 受试者 {2}
|
||||
subjectVisit.VisitName, // 访视 {3}
|
||||
dictionValue[0], // 核查状态 {4}
|
||||
_systemEmailConfig.SiteUrl // 链接 {5}
|
||||
);
|
||||
|
||||
return (topicStr, htmlBodyStr);
|
||||
};
|
||||
|
||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
|
||||
|
||||
context.Message.IsPd ? EmailBusinessScenario.PDVerification_UnderDRForPMOrAPM : EmailBusinessScenario.EligibilityVerification_UnderDRForPMOrAPM,
|
||||
|
||||
messageToSend, emailConfigFunc);
|
||||
|
||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CRC 回复一致性核查质疑 通知PM (019,020)
|
||||
/// CRC 回复一致性核查质疑 通知PM
|
||||
/// </summary>
|
||||
public class CRCRepliedCheckChallengeEventConsumer(
|
||||
IRepository<User> _userRepository,
|
||||
IRepository<TrialUser> _trialUseRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<QCChallenge> _qCChallengeRepository,
|
||||
IRepository<QCChallengeDialog> _qCChallengeDialogRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<CRCRepliedCheckChallengeEvent>
|
||||
public class CRCRepliedCheckChallengeEventConsumer : IConsumer<CRCRepliedCheckChallengeEvent>
|
||||
{
|
||||
|
||||
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||
public async Task Consume(ConsumeContext<CRCRepliedCheckChallengeEvent> context)
|
||||
public Task Consume(ConsumeContext<CRCRepliedCheckChallengeEvent> context)
|
||||
{
|
||||
Console.WriteLine("发送(019,020) 【 CRC 回复一致性核查质疑 通知PM】邮件!!!");
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||
|
||||
var subjectVisitId = context.Message.SubjectVisitId;
|
||||
|
||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
|
||||
|
||||
var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
|
||||
|
||||
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
|
||||
|
||||
|
||||
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
|
||||
|
||||
|
||||
|
||||
|
||||
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
|
||||
{
|
||||
|
||||
DictionaryRepository = _dictionaryRepository,
|
||||
IsEn_US = isEn_US,
|
||||
DictionaryList = new List<DictionaryDto>()
|
||||
{
|
||||
new DictionaryDto (){DictionaryCode= "CheckState",EnumValue=subjectVisit.CheckState.GetEnumInt(), }, //审核状态
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
foreach (var userinfo in userinfoList)
|
||||
{
|
||||
var messageToSend = new MimeMessage();
|
||||
//发件地址
|
||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
|
||||
|
||||
|
||||
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||
|
||||
|
||||
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
var subjectCode = subjectVisit.Subject.Code;
|
||||
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
||||
var htmlBodyStr = string.Format(
|
||||
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||
trialInfo.ExperimentName, // 项目 {1}
|
||||
userinfo.FullName, // 用户名 {1}
|
||||
subjectCode, // 受试者 {2}
|
||||
subjectVisit.VisitName, // 访视 {3}
|
||||
dictionValue[0], // 核查状态 {4}
|
||||
_systemEmailConfig.SiteUrl // 链接 {5}
|
||||
);
|
||||
|
||||
return (topicStr, htmlBodyStr);
|
||||
};
|
||||
|
||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
|
||||
|
||||
context.Message.IsPd ? EmailBusinessScenario.PDVerification_UnderDRForPMOrAPM : EmailBusinessScenario.EligibilityVerification_UnderDRForPMOrAPM,
|
||||
|
||||
messageToSend, emailConfigFunc);
|
||||
|
||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -392,90 +234,13 @@ public class PMRepliedCheckChallengeEventConsumer : IConsumer<PMRepliedCheckChal
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// 通知PM 进行一致性核查 (018,030)
|
||||
/// 通知PM 进行一致性核查
|
||||
/// </summary>
|
||||
public class CheckStateChangedToAuditEventConsumer(
|
||||
IRepository<User> _userRepository,
|
||||
IRepository<TrialUser> _trialUseRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<QCChallenge> _qCChallengeRepository,
|
||||
IRepository<QCChallengeDialog> _qCChallengeDialogRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<CheckStateChangedToAuditEvent>
|
||||
public class CheckStateChangedToAuditEventConsumer : IConsumer<CheckStateChangedToAuditEvent>
|
||||
{
|
||||
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||
public async Task Consume(ConsumeContext<CheckStateChangedToAuditEvent> context)
|
||||
public Task Consume(ConsumeContext<CheckStateChangedToAuditEvent> context)
|
||||
{
|
||||
Console.WriteLine("发送(018,030) 【通知PM 进行一致性核查】邮件!!!");
|
||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||
|
||||
var subjectVisitId = context.Message.SubjectVisitId;
|
||||
|
||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
|
||||
|
||||
var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
|
||||
|
||||
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
|
||||
|
||||
|
||||
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
|
||||
|
||||
|
||||
|
||||
|
||||
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
|
||||
{
|
||||
|
||||
DictionaryRepository = _dictionaryRepository,
|
||||
IsEn_US = isEn_US,
|
||||
DictionaryList = new List<DictionaryDto>()
|
||||
{
|
||||
new DictionaryDto (){DictionaryCode= "CheckState",EnumValue=subjectVisit.CheckState.GetEnumInt(), }, //审核状态
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
foreach (var userinfo in userinfoList)
|
||||
{
|
||||
var messageToSend = new MimeMessage();
|
||||
//发件地址
|
||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
|
||||
|
||||
|
||||
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||
|
||||
|
||||
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
var subjectCode = subjectVisit.Subject.Code;
|
||||
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
||||
var htmlBodyStr = string.Format(
|
||||
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||
trialInfo.ExperimentName, // 项目 {1}
|
||||
userinfo.FullName, // 用户名 {1}
|
||||
subjectCode, // 受试者 {2}
|
||||
subjectVisit.VisitName, // 访视 {3}
|
||||
dictionValue[0], // 核查状态 {4}
|
||||
_systemEmailConfig.SiteUrl // 链接 {5}
|
||||
);
|
||||
|
||||
return (topicStr, htmlBodyStr);
|
||||
};
|
||||
|
||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
|
||||
|
||||
context.Message.IsPd ? EmailBusinessScenario.PDVerification_DR : EmailBusinessScenario.EligibilityVerification_DR,
|
||||
|
||||
messageToSend, emailConfigFunc);
|
||||
|
||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -465,9 +465,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public string ExportResultStr { get; set; } = "[]";
|
||||
|
||||
public List<ExportResult> ExportResult { get; set; }
|
||||
|
||||
[Comment("图片数量")]
|
||||
public int? ImageCount { get; set; }
|
||||
}
|
||||
|
||||
///<summary> ReadingTableQuestionSystemAddOrEdit 列表查询参数模型</summary>
|
||||
|
|
@ -584,8 +581,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public List<ExportResult> ExportResult { get; set; }
|
||||
|
||||
[Comment("图片数量")]
|
||||
public int? ImageCount { get; set; }
|
||||
|
||||
public List<string> ParentTriggerValueList { get; set; } = new List<string>();
|
||||
public List<string> RelevanceValueList { get; set; } = new List<string>();
|
||||
|
||||
|
|
|
|||
|
|
@ -8,14 +8,13 @@ namespace IRaCIS.Core.Domain.Share
|
|||
//不可用
|
||||
None = 0,
|
||||
|
||||
//待核查
|
||||
ToCheck = 9,
|
||||
|
||||
|
||||
//核查中
|
||||
CVIng = 10,
|
||||
|
||||
// 通过CV,等待转发 核查通过
|
||||
// 通过CV,等待转发
|
||||
CVPassed = 11,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,9 +87,6 @@ public class ReadingTableQuestionSystem : BaseAddAuditEntity
|
|||
[Comment("最大问题数")]
|
||||
public int? MaxRowCount { get; set; }
|
||||
|
||||
[Comment("图片数量")]
|
||||
public int? ImageCount { get; set; }
|
||||
|
||||
[Comment("数据表名称")]
|
||||
public string DataTableName { get; set; } = string.Empty;
|
||||
|
||||
|
|
|
|||
|
|
@ -93,9 +93,6 @@ public class ReadingTableQuestionTrial : BaseAddAuditEntity
|
|||
public int ShowQuestion { get; set; }
|
||||
public int? MaxRowCount { get; set; }
|
||||
|
||||
[Comment("图片数量")]
|
||||
public int? ImageCount { get; set; }
|
||||
|
||||
public string DataTableName { get; set; } = string.Empty;
|
||||
|
||||
public string DataTableColumn { get; set; } = string.Empty;
|
||||
|
|
|
|||
|
|
@ -57,9 +57,6 @@ public class QCRepliedQCChallengeEvent : DomainEvent
|
|||
/// </summary>
|
||||
public class CRCRepliedCheckChallengeEvent : DomainEvent
|
||||
{
|
||||
|
||||
public bool IsPd { get; set; }
|
||||
|
||||
public Guid CheckChallengeDialogId { get; set; }
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
|
@ -84,9 +81,6 @@ public class PMRepliedCheckChallengeEvent : DomainEvent
|
|||
/// </summary>
|
||||
public class CheckStateChangedToAuditEvent : DomainEvent
|
||||
{
|
||||
|
||||
public bool IsPd { get; set; }
|
||||
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public static class DBContext_Ext
|
|||
if (originCheckState == CheckStateEnum.None && subjectVisit.CheckState == CheckStateEnum.ToCheck
|
||||
)
|
||||
{
|
||||
subjectVisit.AddDomainEvent(new CheckStateChangedToAuditEvent() { IsPd = subjectVisit.PDState == PDStateEnum.PDProgress, SubjectVisitId = subjectVisit.Id });
|
||||
subjectVisit.AddDomainEvent(new CheckStateChangedToAuditEvent() { SubjectVisitId = subjectVisit.Id });
|
||||
}
|
||||
|
||||
if (originCurrentActionUserId == null && subjectVisit.CurrentActionUserId != null)
|
||||
|
|
@ -149,7 +149,7 @@ public static class DBContext_Ext
|
|||
//CRC 针对质控质疑进行回复
|
||||
if (entry.State == EntityState.Added && checkChallengeDialog.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator)
|
||||
{
|
||||
checkChallengeDialog.AddDomainEvent(new CRCRepliedCheckChallengeEvent() { IsPd = findSubjectVisit.PDState == PDStateEnum.PDProgress, CheckChallengeDialogId = checkChallengeDialog.Id, SubjectVisitId = findSubjectVisit.Id, TrialId = findSubjectVisit.TrialId });
|
||||
checkChallengeDialog.AddDomainEvent(new CRCRepliedCheckChallengeEvent() { CheckChallengeDialogId = checkChallengeDialog.Id, SubjectVisitId = findSubjectVisit.Id, TrialId = findSubjectVisit.TrialId });
|
||||
}
|
||||
else if (entry.State == EntityState.Added && checkChallengeDialog.UserTypeEnum == UserTypeEnum.ProjectManager)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue