Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
c959a47fa6
|
@ -67,7 +67,7 @@ public class HangfireHostService(IRecurringMessageScheduler _recurringMessageSch
|
||||||
//利用主键作为任务Id
|
//利用主键作为任务Id
|
||||||
var jobId = $"{task.Id}_({task.BusinessScenarioEnum})";
|
var jobId = $"{task.Id}_({task.BusinessScenarioEnum})";
|
||||||
|
|
||||||
HangfireJobHelper.AddOrUpdateSystemCronJob(jobId, task.BusinessScenarioEnum, task.EmailCron);
|
HangfireJobHelper.AddOrUpdateTimingCronJob(jobId, task.BusinessScenarioEnum, task.EmailCron);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -83,18 +83,20 @@ namespace IRaCIS.Core.Application.Helper
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddOrUpdateSystemCronJob(string jobId, EmailBusinessScenario businessScenario, string emailCron)
|
public static void AddOrUpdateTimingCronJob(string jobId, EmailBusinessScenario businessScenario, string emailCron)
|
||||||
{
|
{
|
||||||
switch (businessScenario)
|
switch (businessScenario)
|
||||||
{
|
{
|
||||||
|
|
||||||
case EmailBusinessScenario.GeneralTraining_ExpirationNotification:
|
case EmailBusinessScenario.GeneralTraining_ExpirationNotification:
|
||||||
|
|
||||||
HangfireJobHelper.RemoveCronJob(jobId + "System");
|
|
||||||
HangfireJobHelper.RemoveCronJob(jobId + "Trial");
|
HangfireJobHelper.AddOrUpdateCronJob<IMediator>(jobId, t => t.Send(new SystemDocumentErverDayEvent() { }, default), emailCron);
|
||||||
Console.WriteLine("添加发邮件过期提醒任务");
|
break;
|
||||||
HangfireJobHelper.AddOrUpdateCronJob<IMediator>(jobId+"System", t => t.Send(new SystemDocumentErverDayEvent() { }, default), emailCron);
|
case EmailBusinessScenario.TrialTraining_ExpirationNotification:
|
||||||
HangfireJobHelper.AddOrUpdateCronJob<IMediator>(jobId+"Trial", t => t.Send(new TrialDocumentErverDayEvent() { }, default), emailCron);
|
|
||||||
|
Console.WriteLine("更新项目到期job");
|
||||||
|
HangfireJobHelper.AddOrUpdateCronJob<IMediator>(jobId, t => t.Send(new TrialDocumentErverDayEvent() { }, default), emailCron);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -122,7 +122,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
var scenario = EmailBusinessScenario.GeneralTraining_ExpirationNotification;
|
var scenario = EmailBusinessScenario.TrialTraining_ExpirationNotification;
|
||||||
|
|
||||||
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
|
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
var scenario = EmailBusinessScenario.GeneralTraining_EffectiveNotification;
|
var scenario = EmailBusinessScenario.TrialTraining_EffectiveNotification;
|
||||||
|
|
||||||
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
|
var emailConfig = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == scenario && t.IsAutoSend && t.IsEnable).FirstOrDefault();
|
||||||
|
|
||||||
|
|
|
@ -186,14 +186,16 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (entity.EmailCron != string.Empty)
|
if (addOrEditEmailNoticeConfig.EmailCron != string.Empty)
|
||||||
{
|
{
|
||||||
var jobId = $"{entity.Id}_({entity.BusinessScenarioEnum})";
|
var jobId = $"{entity.Id}_({addOrEditEmailNoticeConfig.BusinessScenarioEnum})";
|
||||||
|
|
||||||
|
HangfireJobHelper.RemoveCronJob(jobId);
|
||||||
|
|
||||||
//有的job 可能编辑控制直接不发,需要移除已存在的
|
//有的job 可能编辑控制直接不发,需要移除已存在的
|
||||||
if (entity.IsAutoSend && entity.IsEnable)
|
if (entity.IsAutoSend && entity.IsEnable)
|
||||||
{
|
{
|
||||||
HangfireJobHelper.AddOrUpdateSystemCronJob(jobId, entity.BusinessScenarioEnum, entity.EmailCron);
|
HangfireJobHelper.AddOrUpdateTimingCronJob(jobId, addOrEditEmailNoticeConfig.BusinessScenarioEnum, addOrEditEmailNoticeConfig.EmailCron);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -312,8 +312,15 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ReviewerSelection_SPMCPMApproval = 70,
|
ReviewerSelection_SPMCPMApproval = 70,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目培训 - 生效通知
|
||||||
|
/// </summary>
|
||||||
|
TrialTraining_EffectiveNotification = 71,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目培训 - 到期通知
|
||||||
|
/// </summary>
|
||||||
|
TrialTraining_ExpirationNotification = 72,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,29 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 翻译单位
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="answerType">答案类型</param>
|
||||||
|
/// <param name="unit">单位</param>
|
||||||
|
/// <param name="customUnit">自定义单位</param>
|
||||||
|
/// <param name="unitDataList">单位字典</param>
|
||||||
|
/// <param name="answer">答案</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string Translationunit(string answerType, ValueUnit? unit, string customUnit, List<UnitData> unitDataList,string? answer)
|
||||||
|
{
|
||||||
|
if (answerType == "upload")
|
||||||
|
{
|
||||||
|
return "❄❅❆❇❈❉❊";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unit == ValueUnit.Custom)
|
||||||
|
{
|
||||||
|
return answer + customUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
return answer + unitDataList.Where(y => y.Unit == unit).Select(x => x.UnitName).FirstIsNullReturnEmpty();
|
||||||
|
}
|
||||||
public string GetEntityAuditOpt(EntityEntry entityEntry)
|
public string GetEntityAuditOpt(EntityEntry entityEntry)
|
||||||
{
|
{
|
||||||
if (entityEntry.State == EntityState.Added)
|
if (entityEntry.State == EntityState.Added)
|
||||||
|
@ -3026,6 +3048,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
QuestionId = t.Id,
|
QuestionId = t.Id,
|
||||||
t.DictionaryCode,
|
t.DictionaryCode,
|
||||||
t.Unit,
|
t.Unit,
|
||||||
|
t.CustomUnit,
|
||||||
t.ShowOrder,
|
t.ShowOrder,
|
||||||
AnswerType = t.Type,
|
AnswerType = t.Type,
|
||||||
}).OrderBy(t => t.ShowOrder).ToListAsync();
|
}).OrderBy(t => t.ShowOrder).ToListAsync();
|
||||||
|
@ -3073,7 +3096,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
//如果问题类型是附件 特殊处理 方便前端解析
|
//如果问题类型是附件 特殊处理 方便前端解析
|
||||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer,
|
Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
|
||||||
u.QuestionName,
|
u.QuestionName,
|
||||||
u.QuestionEnName,
|
u.QuestionEnName,
|
||||||
u.DictionaryCode,
|
u.DictionaryCode,
|
||||||
|
@ -3104,8 +3127,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
(t, u) =>
|
(t, u) =>
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty()
|
Answer = Translationunit(u.AnswerType, u.Unit,u.CustomUnit, unitDataList, t.Answer),
|
||||||
,
|
|
||||||
u.DictionaryCode,
|
u.DictionaryCode,
|
||||||
u.QuestionName,
|
u.QuestionName,
|
||||||
u.QuestionEnName,
|
u.QuestionEnName,
|
||||||
|
@ -3233,7 +3255,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
//如果问题类型是附件 特殊处理 方便前端解析
|
//如果问题类型是附件 特殊处理 方便前端解析
|
||||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty(),
|
Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
|
||||||
//t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/,
|
//t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/,
|
||||||
u.QuestionName,
|
u.QuestionName,
|
||||||
u.QuestionEnName,
|
u.QuestionEnName,
|
||||||
|
|
Loading…
Reference in New Issue