合并
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
b33aca3230
|
@ -14087,6 +14087,26 @@
|
||||||
接口请求参考文档:https://www.koudingke.cn/docs/zh-Hans/net-lib-docs/latest/RestSharp/Usage/Usage
|
接口请求参考文档:https://www.koudingke.cn/docs/zh-Hans/net-lib-docs/latest/RestSharp/Usage/Usage
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(IRaCIS.Core.Domain.Models.EmailNoticeConfig,MimeKit.MimeMessage,System.Func{System.ValueTuple{System.String,System.String},System.ValueTuple{System.String,System.String}})">
|
||||||
|
<summary>
|
||||||
|
系统默认邮件 + 项目默认邮件 (不用添加到项目邮件配置中,才发送)
|
||||||
|
</summary>
|
||||||
|
<param name="configInfo"></param>
|
||||||
|
<param name="messageToSend"></param>
|
||||||
|
<param name="emailFunc"></param>
|
||||||
|
<returns></returns>
|
||||||
|
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig,MimeKit.MimeMessage,System.Func{System.ValueTuple{System.String,System.String},System.ValueTuple{System.String,System.String}})">
|
||||||
|
<summary>
|
||||||
|
项目手动邮件 (需要添加到项目邮件配置中,才发送)
|
||||||
|
</summary>
|
||||||
|
<param name="configInfo"></param>
|
||||||
|
<param name="messageToSend"></param>
|
||||||
|
<param name="emailFunc"></param>
|
||||||
|
<returns></returns>
|
||||||
|
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CommonEmailHelper.TranslationDictionary(IRaCIS.Core.Application.MassTransit.Consumer.TranslationDictionaryDto)">
|
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.CommonEmailHelper.TranslationDictionary(IRaCIS.Core.Application.MassTransit.Consumer.TranslationDictionaryDto)">
|
||||||
<summary>
|
<summary>
|
||||||
翻译字典
|
翻译字典
|
||||||
|
@ -14199,7 +14219,7 @@
|
||||||
处理SPM审批阅片人筛选事件
|
处理SPM审批阅片人筛选事件
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer.SendReviewerSelectionEmail(IRaCIS.Core.Domain.Models.EmailNoticeConfig,IRaCIS.Core.Domain.Share.EmailBusinessScenario,System.Guid,System.Collections.Generic.List{System.Guid})">
|
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.ImageConsumer.SendReviewerSelectionEmail(IRaCIS.Core.Domain.Models.EmailNoticeConfig,System.Guid,System.Collections.Generic.List{System.Guid})">
|
||||||
<summary>
|
<summary>
|
||||||
发送阅片人筛选相关邮件的通用方法
|
发送阅片人筛选相关邮件的通用方法
|
||||||
</summary>
|
</summary>
|
||||||
|
|
|
@ -14,20 +14,20 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer;
|
||||||
|
|
||||||
public static class CommonEmailHelper
|
public static class CommonEmailHelper
|
||||||
{
|
{
|
||||||
public static async Task<EmailNoticeConfig> GetEmailSubejctAndHtmlInfoAndBuildAsync(IRepository<EmailNoticeConfig> _emailNoticeConfigrepository, EmailBusinessScenario scenario, MimeMessage messageToSend,
|
|
||||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailFunc)
|
/// <summary>
|
||||||
|
/// 系统默认邮件 + 项目默认邮件 (不用添加到项目邮件配置中,才发送)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="configInfo"></param>
|
||||||
|
/// <param name="messageToSend"></param>
|
||||||
|
/// <param name="emailFunc"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
|
public static async Task<EmailNoticeConfig> GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailNoticeConfig configInfo, MimeMessage messageToSend,
|
||||||
|
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailFunc)
|
||||||
{
|
{
|
||||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||||
|
|
||||||
var configInfo = await _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
if (configInfo == null)
|
|
||||||
{
|
|
||||||
//"系统未找到当前场景邮件配置信息,请联系运维人员核查"
|
|
||||||
throw new BusinessValidationFailedException(I18n.T("CommonEmail_NotFoundConfig"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var (topicStr, htmlBodyStr) = isEn_US ? (configInfo.EmailTopic, configInfo.EmailHtmlContent) : (configInfo.EmailTopicCN, configInfo.EmailHtmlContentCN);
|
var (topicStr, htmlBodyStr) = isEn_US ? (configInfo.EmailTopic, configInfo.EmailHtmlContent) : (configInfo.EmailTopicCN, configInfo.EmailHtmlContentCN);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -54,7 +54,15 @@ public static class CommonEmailHelper
|
||||||
return configInfo;
|
return configInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<TrialEmailNoticeConfig> GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(TrialEmailNoticeConfig configInfo, EmailBusinessScenario scenario, MimeMessage messageToSend,
|
/// <summary>
|
||||||
|
/// 项目手动邮件 (需要添加到项目邮件配置中,才发送)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="configInfo"></param>
|
||||||
|
/// <param name="messageToSend"></param>
|
||||||
|
/// <param name="emailFunc"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
|
public static async Task<TrialEmailNoticeConfig> GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(TrialEmailNoticeConfig configInfo, MimeMessage messageToSend,
|
||||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailFunc)
|
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailFunc)
|
||||||
{
|
{
|
||||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||||
|
|
|
@ -99,13 +99,13 @@ public class ImageConsumer(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var trialEmailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable).FirstOrDefault();
|
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
|
||||||
|
|
||||||
if (trialEmailConfig != null)
|
if (emailConfig != null)
|
||||||
{
|
{
|
||||||
var inDto = new SendImageReuploadEmailInDto
|
var inDto = new SendImageReuploadEmailInDto
|
||||||
{
|
{
|
||||||
EmailNoticeConfig = trialEmailConfig,
|
EmailNoticeConfig = emailConfig,
|
||||||
Scenario = scenario,
|
Scenario = scenario,
|
||||||
SubjectVisit = subjectVisit,
|
SubjectVisit = subjectVisit,
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
|
@ -143,17 +143,17 @@ public class ImageConsumer(
|
||||||
return; // 其他状态不发送邮件
|
return; // 其他状态不发送邮件
|
||||||
}
|
}
|
||||||
|
|
||||||
var trialEmailConfig = _emailNoticeConfigrepository.Where(t =>t.BusinessScenarioEnum == scenario && t.IsEnable).FirstOrDefault();
|
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
|
||||||
|
|
||||||
if (trialEmailConfig != null)
|
if (emailConfig != null)
|
||||||
{
|
{
|
||||||
var inDto = new SendImageReuploadEmailInDto
|
var inDto = new SendImageReuploadEmailInDto
|
||||||
{
|
{
|
||||||
EmailNoticeConfig = trialEmailConfig,
|
EmailNoticeConfig = emailConfig,
|
||||||
Scenario = scenario,
|
Scenario = scenario,
|
||||||
SubjectVisit = subjectVisit,
|
SubjectVisit = subjectVisit,
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
RequestBackStateEnum= context.Message.RequestBackState,
|
RequestBackStateEnum = context.Message.RequestBackState,
|
||||||
};
|
};
|
||||||
await SendImageReuploadEmail(inDto);
|
await SendImageReuploadEmail(inDto);
|
||||||
}
|
}
|
||||||
|
@ -185,13 +185,13 @@ public class ImageConsumer(
|
||||||
return; // 其他状态不发送邮件
|
return; // 其他状态不发送邮件
|
||||||
}
|
}
|
||||||
|
|
||||||
var trialEmailConfig = _emailNoticeConfigrepository.Where(t =>t.BusinessScenarioEnum == scenario && t.IsEnable).FirstOrDefault();
|
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
|
||||||
|
|
||||||
if (trialEmailConfig != null)
|
if (emailConfig != null)
|
||||||
{
|
{
|
||||||
var inDto = new SendImageReuploadEmailInDto
|
var inDto = new SendImageReuploadEmailInDto
|
||||||
{
|
{
|
||||||
EmailNoticeConfig = trialEmailConfig,
|
EmailNoticeConfig = emailConfig,
|
||||||
Scenario = scenario,
|
Scenario = scenario,
|
||||||
SubjectVisit = subjectVisit,
|
SubjectVisit = subjectVisit,
|
||||||
TrialId = trialId
|
TrialId = trialId
|
||||||
|
@ -210,13 +210,13 @@ public class ImageConsumer(
|
||||||
|
|
||||||
var visitTaskId = context.Message.VisitTaskId;
|
var visitTaskId = context.Message.VisitTaskId;
|
||||||
// 获取VisitTask关联的SubjectVisit
|
// 获取VisitTask关联的SubjectVisit
|
||||||
var visitTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x=>x.SourceSubjectVisit).FirstNotNullAsync();
|
var visitTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.SourceSubjectVisit).FirstNotNullAsync();
|
||||||
var subjectVisit = new SubjectVisit() { };
|
var subjectVisit = new SubjectVisit() { };
|
||||||
if (visitTask.SourceSubjectVisitId != null)
|
if (visitTask.SourceSubjectVisitId != null)
|
||||||
{
|
{
|
||||||
subjectVisit = visitTask.SourceSubjectVisit;
|
subjectVisit = visitTask.SourceSubjectVisit;
|
||||||
}
|
}
|
||||||
else if(visitTask.SouceReadModuleId!=null)
|
else if (visitTask.SouceReadModuleId != null)
|
||||||
{
|
{
|
||||||
var readModule = await _readModuleRepository.Where(x => x.Id == visitTask.SouceReadModuleId).Include(x => x.SubjectVisit).FirstOrDefaultAsync();
|
var readModule = await _readModuleRepository.Where(x => x.Id == visitTask.SouceReadModuleId).Include(x => x.SubjectVisit).FirstOrDefaultAsync();
|
||||||
subjectVisit = readModule.SubjectVisit;
|
subjectVisit = readModule.SubjectVisit;
|
||||||
|
@ -238,13 +238,14 @@ public class ImageConsumer(
|
||||||
default:
|
default:
|
||||||
return; // 其他状态不发送邮件
|
return; // 其他状态不发送邮件
|
||||||
}
|
}
|
||||||
var trialEmailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable).FirstOrDefault();
|
|
||||||
|
|
||||||
if (trialEmailConfig != null)
|
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
|
||||||
|
|
||||||
|
if (emailConfig != null)
|
||||||
{
|
{
|
||||||
var inDto = new SendImageReuploadEmailInDto
|
var inDto = new SendImageReuploadEmailInDto
|
||||||
{
|
{
|
||||||
EmailNoticeConfig = trialEmailConfig,
|
EmailNoticeConfig = emailConfig,
|
||||||
Scenario = scenario,
|
Scenario = scenario,
|
||||||
SubjectVisit = subjectVisit,
|
SubjectVisit = subjectVisit,
|
||||||
TrialId = trialId
|
TrialId = trialId
|
||||||
|
@ -272,15 +273,15 @@ public class ImageConsumer(
|
||||||
List<UserRole> ccUserList = new List<UserRole>();
|
List<UserRole> ccUserList = new List<UserRole>();
|
||||||
|
|
||||||
var emailNoticeUserList = await _emailNoticeUserTypeRepository.Where(x => x.EmailNoticeConfigId == inDto.EmailNoticeConfig.Id).ToListAsync();
|
var emailNoticeUserList = await _emailNoticeUserTypeRepository.Where(x => x.EmailNoticeConfigId == inDto.EmailNoticeConfig.Id).ToListAsync();
|
||||||
var userTypeEnum= emailNoticeUserList.Select(x => x.UserType).ToList();
|
var userTypeEnum = emailNoticeUserList.Select(x => x.UserType).ToList();
|
||||||
if (inDto.UserTypes != null)
|
if (inDto.UserTypes != null)
|
||||||
{
|
{
|
||||||
userTypeEnum = inDto.UserTypes;
|
userTypeEnum = inDto.UserTypes;
|
||||||
}
|
}
|
||||||
var crcUserList =new List<UserRole>(){ };
|
var crcUserList = new List<UserRole>() { };
|
||||||
if (userTypeEnum.Contains(UserTypeEnum.ClinicalResearchCoordinator))
|
if (userTypeEnum.Contains(UserTypeEnum.ClinicalResearchCoordinator))
|
||||||
{
|
{
|
||||||
crcUserList=await _trialSiteRepository.Where(x=>x.Id== inDto.SubjectVisit.TrialSiteId).SelectMany(x=>x.CRCUserList.Select(y => y.UserRole)).ToListAsync();
|
crcUserList = await _trialSiteRepository.Where(x => x.Id == inDto.SubjectVisit.TrialSiteId).SelectMany(x => x.CRCUserList.Select(y => y.UserRole)).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inDto.UserTypes == null)
|
if (inDto.UserTypes == null)
|
||||||
|
@ -307,7 +308,7 @@ public class ImageConsumer(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var ccList = emailNoticeUserList.Where(x => x.EmailUserType == EmailUserType.Copy && x.UserType != UserTypeEnum.ClinicalResearchCoordinator).Select(x => x.UserType).ToList();
|
var ccList = emailNoticeUserList.Where(x => x.EmailUserType == EmailUserType.Copy && x.UserType != UserTypeEnum.ClinicalResearchCoordinator).Select(x => x.UserType).ToList();
|
||||||
|
|
||||||
ccUserList = trialUser.Where(x => ccList.Contains(x.UserTypeEnum)).ToList();
|
ccUserList = trialUser.Where(x => ccList.Contains(x.UserTypeEnum)).ToList();
|
||||||
|
|
||||||
|
@ -375,7 +376,7 @@ public class ImageConsumer(
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, inDto.Scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(inDto.EmailNoticeConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -404,11 +405,11 @@ public class ImageConsumer(
|
||||||
// 设置邮件场景
|
// 设置邮件场景
|
||||||
var scenario = EmailBusinessScenario.ReviewerSelection_PMApplyApproving; // 69
|
var scenario = EmailBusinessScenario.ReviewerSelection_PMApplyApproving; // 69
|
||||||
|
|
||||||
var trialEmailConfig = _emailNoticeConfigrepository.Where(t =>t.BusinessScenarioEnum == scenario && t.IsEnable).FirstOrDefault();
|
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
|
||||||
|
|
||||||
if (trialEmailConfig != null)
|
if (emailConfig != null)
|
||||||
{
|
{
|
||||||
await SendReviewerSelectionEmail(trialEmailConfig, scenario, trialId, enrollIdList);
|
await SendReviewerSelectionEmail(emailConfig, trialId, enrollIdList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,18 +436,18 @@ public class ImageConsumer(
|
||||||
// 设置邮件场景
|
// 设置邮件场景
|
||||||
var scenario = EmailBusinessScenario.ReviewerSelection_SPMCPMApproval; // 70
|
var scenario = EmailBusinessScenario.ReviewerSelection_SPMCPMApproval; // 70
|
||||||
|
|
||||||
var trialEmailConfig = _emailNoticeConfigrepository.Where(t =>t.BusinessScenarioEnum == scenario && t.IsEnable).FirstOrDefault();
|
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsEnable && t.IsAutoSend).FirstOrDefault();
|
||||||
|
|
||||||
if (trialEmailConfig != null)
|
if (emailConfig != null)
|
||||||
{
|
{
|
||||||
await SendReviewerSelectionEmail(trialEmailConfig, scenario, trialId, enrollIdList);
|
await SendReviewerSelectionEmail(emailConfig, trialId, enrollIdList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 发送阅片人筛选相关邮件的通用方法
|
/// 发送阅片人筛选相关邮件的通用方法
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private async Task SendReviewerSelectionEmail(EmailNoticeConfig emailNoticeConfig, EmailBusinessScenario scenario, Guid trialId, List<Guid> enrollIdList)
|
private async Task SendReviewerSelectionEmail(EmailNoticeConfig emailNoticeConfig, Guid trialId, List<Guid> enrollIdList)
|
||||||
{
|
{
|
||||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||||
|
|
||||||
|
@ -454,7 +455,7 @@ public class ImageConsumer(
|
||||||
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
|
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
|
||||||
|
|
||||||
// 根据不同场景获取不同角色的用户
|
// 根据不同场景获取不同角色的用户
|
||||||
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == trialId &&!x.TrialUser.IsDeleted).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
|
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == trialId && !x.TrialUser.IsDeleted).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
|
||||||
|
|
||||||
// 根据场景确定收件人
|
// 根据场景确定收件人
|
||||||
List<UserRole> toUserList = new List<UserRole>();
|
List<UserRole> toUserList = new List<UserRole>();
|
||||||
|
@ -508,7 +509,7 @@ public class ImageConsumer(
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailNoticeConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class UrgentMedicalReviewAddedEventConsumer(
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ public class UrgentIRRepliedMedicalReviewConsumer(
|
||||||
|
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -352,7 +352,7 @@ public class UrgentMIMRepliedMedicalReviewConsumer(
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -461,7 +461,7 @@ public class UrgentIRApplyedReReadingConsumer(
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class UserSiteSurveySubmitedEventConsumer(
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -191,19 +191,19 @@ public class SiteSurveySPMSubmitedEventConsumer(
|
||||||
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
|
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
|
||||||
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||||
toUserName,
|
toUserName,
|
||||||
siteInfo.TrialSiteCode,
|
siteInfo.TrialSiteCode, //中心编号
|
||||||
siteInfo.TrialSiteAliasName,
|
siteInfo.TrialSiteAliasName,//中心名称
|
||||||
|
|
||||||
siteSurveyInfo.UserName,
|
siteSurveyInfo.UserName, //联系人
|
||||||
siteSurveyInfo.Email,
|
siteSurveyInfo.Email, //联系邮箱
|
||||||
siteSurveyInfo.Phone,
|
siteSurveyInfo.Phone, //联系电话
|
||||||
_systemEmailConfig.SiteUrl
|
_systemEmailConfig.SiteUrl
|
||||||
);
|
);
|
||||||
|
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ public class SiteSurverRejectedEventConsumer(
|
||||||
|
|
||||||
var trialSiteSurveyId = context.Message.TrialSiteSurveyId;
|
var trialSiteSurveyId = context.Message.TrialSiteSurveyId;
|
||||||
|
|
||||||
var siteSurveyInfo = _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId).FirstOrDefault().IfNullThrowException();
|
var siteSurveyInfo = _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId ,ignoreQueryFilters:true).FirstOrDefault().IfNullThrowException();
|
||||||
|
|
||||||
var trialId = siteSurveyInfo.TrialId;
|
var trialId = siteSurveyInfo.TrialId;
|
||||||
|
|
||||||
|
@ -304,19 +304,20 @@ public class SiteSurverRejectedEventConsumer(
|
||||||
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||||
toUserName,
|
toUserName,
|
||||||
trialInfo.TrialCode,
|
trialInfo.TrialCode,
|
||||||
trialInfo.ResearchProgramNo,
|
trialInfo.ResearchProgramNo,
|
||||||
trialInfo.ExperimentName,
|
trialInfo.ExperimentName,
|
||||||
siteInfo.TrialSiteCode,
|
|
||||||
siteInfo.TrialSiteAliasName,
|
siteInfo.TrialSiteCode, //中心编号
|
||||||
siteSurveyInfo.LatestBackReason,
|
siteInfo.TrialSiteAliasName,//中心名称
|
||||||
_systemEmailConfig.SiteUrl,
|
siteSurveyInfo.LatestBackReason, //驳回原因
|
||||||
|
_systemEmailConfig.SiteUrl, //链接
|
||||||
(siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit ? "inline - block" : "none")
|
(siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit ? "inline - block" : "none")
|
||||||
);
|
);
|
||||||
|
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ public class CRCRepliedQCChallengeEventConsumer(
|
||||||
|
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -337,7 +337,7 @@ public class QCRepliedQCChallengeEventConsumer(
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -437,7 +437,7 @@ public class CRCRepliedCheckChallengeEventConsumer(
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -547,7 +547,7 @@ public class PMRepliedCheckChallengeEventConsumer(
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -646,7 +646,7 @@ public class CheckStateChangedToAuditEventConsumer(
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
@ -755,7 +755,7 @@ public class QCClaimTaskEventConsumer(
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, scenario, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetTrialEmailSubejctAndHtmlInfoAndBuildAsync(trialEmailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
|
|
||||||
|
|
|
@ -71,14 +71,14 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
||||||
IsNeedSendEmial = identityUser.IsZhiZhun || (!identityUser.IsZhiZhun && sysDoc.DocUserSignType == DocUserSignType.InnerAndOuter),
|
IsNeedSendEmial = identityUser.IsZhiZhun || (!identityUser.IsZhiZhun && sysDoc.DocUserSignType == DocUserSignType.InnerAndOuter),
|
||||||
FullFilePath = sysDoc.Path
|
FullFilePath = sysDoc.Path
|
||||||
};
|
};
|
||||||
var datalist = await systemDocQuery.IgnoreQueryFilters().Where(t => t.IsDeleted==false && t.ConfirmTime == null)
|
var datalist = await systemDocQuery.IgnoreQueryFilters().Where(t => t.IsDeleted == false && t.ConfirmTime == null)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
datalist = datalist.Where(x => x.SuggestFinishTime != null && x.SuggestFinishTime.Value.Date == DateTime.Now.Date)
|
datalist = datalist.Where(x => x.SuggestFinishTime != null && x.SuggestFinishTime.Value.Date == DateTime.Now.Date)
|
||||||
.Where(x => x.IsNeedSendEmial).ToList();
|
.Where(x => x.IsNeedSendEmial).ToList();
|
||||||
var confirmUserIdList = datalist.Select(t => t.ConfirmUserId).Distinct().ToList();
|
var confirmUserIdList = datalist.Select(t => t.ConfirmUserId).Distinct().ToList();
|
||||||
var userinfoList = await _identityUserRepository.Where(x => confirmUserIdList.Contains(x.Id)).ToListAsync();
|
var userinfoList = await _identityUserRepository.Where(x => confirmUserIdList.Contains(x.Id)).ToListAsync();
|
||||||
|
|
||||||
Console.WriteLine("发送定时过期提醒:人员数量"+ userinfoList.Count);
|
Console.WriteLine("发送定时过期提醒:人员数量" + userinfoList.Count);
|
||||||
int index = 1;
|
int index = 1;
|
||||||
foreach (var userinfo in userinfoList)
|
foreach (var userinfo in userinfoList)
|
||||||
{
|
{
|
||||||
|
@ -107,19 +107,24 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
|
var scenario = EmailBusinessScenario.GeneralTraining_ExpirationNotification;
|
||||||
|
|
||||||
EmailBusinessScenario.GeneralTraining_ExpirationNotification,
|
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
|
||||||
|
|
||||||
|
if (emailConfig != null)
|
||||||
|
{
|
||||||
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
|
}
|
||||||
|
|
||||||
messageToSend, emailConfigFunc);
|
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -149,7 +154,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
||||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||||
var systemDocQuery =
|
var systemDocQuery =
|
||||||
from sysDoc in _systemDocumentRepository.AsQueryable(false).Where(x => context.Message.Ids.Contains(x.Id))
|
from sysDoc in _systemDocumentRepository.AsQueryable(false).Where(x => context.Message.Ids.Contains(x.Id))
|
||||||
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.Status == UserStateEnum.Enable&& t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
|
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.Status == UserStateEnum.Enable && t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
|
||||||
select new UnionDocumentWithConfirmInfoView()
|
select new UnionDocumentWithConfirmInfoView()
|
||||||
{
|
{
|
||||||
IsSystemDoc = true,
|
IsSystemDoc = true,
|
||||||
|
@ -165,23 +170,23 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
||||||
|
|
||||||
RealName = identityUser.FullName,
|
RealName = identityUser.FullName,
|
||||||
UserName = identityUser.UserName,
|
UserName = identityUser.UserName,
|
||||||
IsNeedSendEmial= identityUser.IsZhiZhun || (!identityUser.IsZhiZhun&& sysDoc.DocUserSignType== DocUserSignType.InnerAndOuter),
|
IsNeedSendEmial = identityUser.IsZhiZhun || (!identityUser.IsZhiZhun && sysDoc.DocUserSignType == DocUserSignType.InnerAndOuter),
|
||||||
|
|
||||||
|
|
||||||
FullFilePath = sysDoc.Path
|
FullFilePath = sysDoc.Path
|
||||||
};
|
};
|
||||||
var datalist = await systemDocQuery.IgnoreQueryFilters().Where(x=>x.IsNeedSendEmial).ToListAsync();
|
var datalist = await systemDocQuery.IgnoreQueryFilters().Where(x => x.IsNeedSendEmial).ToListAsync();
|
||||||
|
|
||||||
var confirmUserIdList = datalist.Select(t => t.ConfirmUserId).Distinct().ToList();
|
var confirmUserIdList = datalist.Select(t => t.ConfirmUserId).Distinct().ToList();
|
||||||
var userinfoList = await _identityUserRepository.Where(x => confirmUserIdList.Contains(x.Id)).ToListAsync();
|
var userinfoList = await _identityUserRepository.Where(x => confirmUserIdList.Contains(x.Id)).ToListAsync();
|
||||||
int index= 1;
|
int index = 1;
|
||||||
foreach (var userinfo in userinfoList)
|
foreach (var userinfo in userinfoList)
|
||||||
{
|
{
|
||||||
string msg = $"{index}生效通知,邮箱:{userinfo.EMail},姓名{userinfo.UserName},";
|
string msg = $"{index}生效通知,邮箱:{userinfo.EMail},姓名{userinfo.UserName},";
|
||||||
index++;
|
index++;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||||
|
@ -203,14 +208,19 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
|
var scenario = EmailBusinessScenario.GeneralTraining_EffectiveNotification;
|
||||||
|
|
||||||
EmailBusinessScenario.GeneralTraining_EffectiveNotification,
|
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
|
||||||
|
|
||||||
|
if (emailConfig != null)
|
||||||
|
{
|
||||||
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
|
msg += "发送成功";
|
||||||
|
}
|
||||||
|
|
||||||
messageToSend, emailConfigFunc);
|
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
|
||||||
msg += "发送成功";
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments;
|
using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments;
|
||||||
|
using DocumentFormat.OpenXml.Spreadsheet;
|
||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Application.Interfaces;
|
using IRaCIS.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
@ -231,9 +232,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<(DoctorSummarize,bool)> AddOrUpdateGneralSituation(SummarizeInfoDto inDto)
|
public async Task<(DoctorSummarize, bool)> AddOrUpdateGneralSituation(SummarizeInfoDto inDto)
|
||||||
{
|
{
|
||||||
if (inDto.TrialId != null&&inDto.Id==null)
|
if (inDto.TrialId != null && inDto.Id == null)
|
||||||
{
|
{
|
||||||
var systemCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == null).CountAsync();
|
var systemCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == null).CountAsync();
|
||||||
if (systemCount == 0)
|
if (systemCount == 0)
|
||||||
|
@ -242,7 +243,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var dictionery = await _dictionaryRepository.Where(x => x.Parent.Code == "Indication" && x.Code == trialinfo.IndicationEnum.ToString()).FirstNotNullAsync();
|
var dictionery = await _dictionaryRepository.Where(x => x.Parent.Code == "Indication" && x.Code == trialinfo.IndicationEnum.ToString()).FirstNotNullAsync();
|
||||||
inDto.IndicationEn = dictionery.Value;
|
inDto.IndicationEn = dictionery.Value;
|
||||||
inDto.Indication = dictionery.ValueCN;
|
inDto.Indication = dictionery.ValueCN;
|
||||||
var system= inDto.Clone();
|
var system = inDto.Clone();
|
||||||
system.TrialId = null;
|
system.TrialId = null;
|
||||||
system.IsMain = true;
|
system.IsMain = true;
|
||||||
await _doctorSummarizeRepository.InsertOrUpdateAsync(system, true);
|
await _doctorSummarizeRepository.InsertOrUpdateAsync(system, true);
|
||||||
|
@ -255,7 +256,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
if (systemCount == 0)
|
if (systemCount == 0)
|
||||||
{
|
{
|
||||||
inDto.IsMain = true;
|
inDto.IsMain = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (inDto.Indication.IsNullOrEmpty() && inDto.IndicationEn.IsNullOrEmpty())
|
if (inDto.Indication.IsNullOrEmpty() && inDto.IndicationEn.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
|
@ -263,19 +264,19 @@ namespace IRaCIS.Core.Application.Service
|
||||||
inDto.IndicationEn = "Default";
|
inDto.IndicationEn = "Default";
|
||||||
}
|
}
|
||||||
var exists = await _doctorSummarizeRepository
|
var exists = await _doctorSummarizeRepository
|
||||||
.Where(x=> x.IndicationEn!=string.Empty && x.Indication!=string.Empty)
|
.Where(x => x.IndicationEn != string.Empty && x.Indication != string.Empty)
|
||||||
.Where( x => x.IndicationEn == inDto.IndicationEn|| x.Indication == inDto.Indication)
|
.Where(x => x.IndicationEn == inDto.IndicationEn || x.Indication == inDto.Indication)
|
||||||
|
|
||||||
.AnyAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null&&x.Id!=inDto.Id);
|
.AnyAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null && x.Id != inDto.Id);
|
||||||
if (exists)
|
if (exists)
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["DoctorSummarize_repeat"]);
|
throw new BusinessValidationFailedException(_localizer["DoctorSummarize_repeat"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (inDto.TrialId != null && inDto.SaveSummarizeInfoType!= SaveSummarizeInfo.SaveSelf)
|
|
||||||
|
if (inDto.TrialId != null && inDto.SaveSummarizeInfoType != SaveSummarizeInfo.SaveSelf)
|
||||||
{
|
{
|
||||||
switch (inDto.SaveSummarizeInfoType)
|
switch (inDto.SaveSummarizeInfoType)
|
||||||
{
|
{
|
||||||
|
@ -313,16 +314,16 @@ namespace IRaCIS.Core.Application.Service
|
||||||
if (inDto.TrialId == null && inDto.IsMain)
|
if (inDto.TrialId == null && inDto.IsMain)
|
||||||
{
|
{
|
||||||
|
|
||||||
await _doctorSummarizeRepository.BatchUpdateNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null,
|
await _doctorSummarizeRepository.BatchUpdateNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null,
|
||||||
x => new DoctorSummarize()
|
x => new DoctorSummarize()
|
||||||
{
|
{
|
||||||
IsMain = false
|
IsMain = false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(inDto, true);
|
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(inDto, true);
|
||||||
return (entity,true);
|
return (entity, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -333,7 +334,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<bool> DeleteSummarizeInfo(DeleteSummarizeInfoInDto inDto)
|
public async Task<bool> DeleteSummarizeInfo(DeleteSummarizeInfoInDto inDto)
|
||||||
{
|
{
|
||||||
var result = await _doctorSummarizeRepository.DeleteFromQueryAsync(x=>x.Id==inDto.Id);
|
var result = await _doctorSummarizeRepository.DeleteFromQueryAsync(x => x.Id == inDto.Id);
|
||||||
return await _doctorSummarizeRepository.SaveChangesAsync();
|
return await _doctorSummarizeRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,7 +346,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<UpdateGneralSituationDto> GetSummarizeInfo(GetSummarizeInfoInDto inDto)
|
public async Task<UpdateGneralSituationDto> GetSummarizeInfo(GetSummarizeInfoInDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (inDto.TrialId != null)
|
if (inDto.TrialId != null)
|
||||||
{
|
{
|
||||||
var doctorInfo = await trialExperienceService.GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
|
var doctorInfo = await trialExperienceService.GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
|
||||||
|
@ -357,8 +358,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
var result = await _doctorSummarizeRepository.Where(t => t.DoctorId == inDto.DoctorId && t.TrialId == inDto.TrialId)
|
var result = await _doctorSummarizeRepository.Where(t => t.DoctorId == inDto.DoctorId && t.TrialId == inDto.TrialId)
|
||||||
.ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
return new UpdateGneralSituationDto() {
|
return new UpdateGneralSituationDto()
|
||||||
SummarizeList= result
|
{
|
||||||
|
SummarizeList = result
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -378,30 +380,36 @@ namespace IRaCIS.Core.Application.Service
|
||||||
messageToSend.To.Add(new MailboxAddress(String.Empty, item));
|
messageToSend.To.Add(new MailboxAddress(String.Empty, item));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||||
{
|
{
|
||||||
;
|
;
|
||||||
var topicStr = string.Format(input.topicStr,string.Empty);
|
var topicStr = string.Format(input.topicStr, string.Empty);
|
||||||
var htmlBodyStr = string.Format(
|
var htmlBodyStr = string.Format(
|
||||||
|
|
||||||
|
|
||||||
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||||
_systemEmailConfig.SiteUrl.Replace("login",string.Empty)+inDto.Url
|
_systemEmailConfig.SiteUrl.Replace("login", string.Empty) + inDto.Url
|
||||||
);
|
);
|
||||||
|
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
|
|
||||||
|
|
||||||
EmailBusinessScenario.Reviewer_CV_Collection,
|
var scenario = EmailBusinessScenario.Reviewer_CV_Collection;
|
||||||
|
|
||||||
|
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
|
||||||
|
|
||||||
|
if (emailConfig != null)
|
||||||
|
{
|
||||||
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(emailConfig, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
|
}
|
||||||
|
|
||||||
messageToSend, emailConfigFunc);
|
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -491,7 +499,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var doctorBasicInfo = (await _doctorRepository.Where(t => t.Id == doctorId)
|
var doctorBasicInfo = (await _doctorRepository.Where(t => t.Id == doctorId)
|
||||||
.ProjectTo<DoctorBasicInfoDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
.ProjectTo<DoctorBasicInfoDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
doctorBasicInfo.IsHaveAccount =await _userRoleRepository.AnyAsync(x => x.DoctorId == doctorId);
|
doctorBasicInfo.IsHaveAccount = await _userRoleRepository.AnyAsync(x => x.DoctorId == doctorId);
|
||||||
return doctorBasicInfo;
|
return doctorBasicInfo;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -589,7 +589,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (sv.RequestBackState == RequestBackStateEnum.NotRequest || sv.RequestBackState == RequestBackStateEnum.PM_NotAgree)
|
if (sv.RequestBackState != RequestBackStateEnum.CRC_RequestBack)
|
||||||
{
|
{
|
||||||
sv.RequestBackState = RequestBackStateEnum.CRC_RequestBack;
|
sv.RequestBackState = RequestBackStateEnum.CRC_RequestBack;
|
||||||
|
|
||||||
|
@ -663,16 +663,14 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_CannotRollback"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_CannotRollback"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//sv.CheckChallengeState = (int)CheckChanllengeTypeEnum.None;
|
sv.RequestBackState = RequestBackStateEnum.PM_AgressBack;
|
||||||
//sv.CheckState = CheckStateEnum.None;
|
|
||||||
//sv.ChallengeState = (int)ChallengeStateEnum.No;
|
|
||||||
|
|
||||||
sv.AuditState = AuditStateEnum.None;
|
sv.AuditState = AuditStateEnum.None;
|
||||||
sv.SubmitState = SubmitStateEnum.ToSubmit;
|
sv.SubmitState = SubmitStateEnum.ToSubmit;
|
||||||
sv.ReadingStatus = ReadingStatusEnum.ImageNotSubmit;
|
sv.ReadingStatus = ReadingStatusEnum.ImageNotSubmit;
|
||||||
|
|
||||||
//回退后,回退状态恢复
|
//回退后,回退状态恢复
|
||||||
sv.RequestBackState = RequestBackStateEnum.NotRequest;
|
|
||||||
sv.IsCheckBack = true;
|
sv.IsCheckBack = true;
|
||||||
sv.CheckBackTime = DateTime.Now;
|
sv.CheckBackTime = DateTime.Now;
|
||||||
sv.CheckState = CheckStateEnum.None;
|
sv.CheckState = CheckStateEnum.None;
|
||||||
|
@ -1013,7 +1011,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
{
|
{
|
||||||
|
|
||||||
var studyId = updateModalityCommand.Id;
|
var studyId = updateModalityCommand.Id;
|
||||||
var study = (await _dicomStudyRepository.FirstOrDefaultAsync(t => t.Id == studyId,true)).IfNullThrowException();
|
var study = (await _dicomStudyRepository.FirstOrDefaultAsync(t => t.Id == studyId, true)).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
study.BodyPartForEdit = updateModalityCommand.BodyPart;
|
study.BodyPartForEdit = updateModalityCommand.BodyPart;
|
||||||
|
@ -1085,7 +1083,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
//---CRC已经提交,不允许删除。
|
//---CRC已经提交,不允许删除。
|
||||||
return ResponseOutput.NotOk(_localizer["QCOperation_CrcNoDelete"]);
|
return ResponseOutput.NotOk(_localizer["QCOperation_CrcNoDelete"]);
|
||||||
}
|
}
|
||||||
var waitDeleteStudyList = await _dicomStudyRepository.Where(x => ids.Contains(x.Id),false,true).ToListAsync();
|
var waitDeleteStudyList = await _dicomStudyRepository.Where(x => ids.Contains(x.Id), false, true).ToListAsync();
|
||||||
|
|
||||||
foreach (var study in waitDeleteStudyList)
|
foreach (var study in waitDeleteStudyList)
|
||||||
{
|
{
|
||||||
|
|
|
@ -459,7 +459,7 @@ public static class DBContext_Ext
|
||||||
}
|
}
|
||||||
if (pmApplyEnrollIdList.Count > 0)
|
if (pmApplyEnrollIdList.Count > 0)
|
||||||
{
|
{
|
||||||
lastEnroll.AddDomainEvent(new ReviewerPMApplyEvent() { TrialId = lastEnroll.TrialId, EnrollIdList = spmApproveEnrollIdList });
|
lastEnroll.AddDomainEvent(new ReviewerPMApplyEvent() { TrialId = lastEnroll.TrialId, EnrollIdList = pmApplyEnrollIdList });
|
||||||
|
|
||||||
eventStoreList.AddRange(GetStoreEvents(lastEnroll.DomainEvents));
|
eventStoreList.AddRange(GetStoreEvents(lastEnroll.DomainEvents));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue