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

This commit is contained in:
he
2024-10-17 15:45:48 +08:00
16 changed files with 120 additions and 39 deletions
@@ -1,9 +1,11 @@
using Hangfire;
using Hangfire.Storage;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.MassTransit.Consumer;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using MassTransit;
using MassTransit.Mediator;
using MassTransit.Scheduling;
using Microsoft.Extensions.Logging;
@@ -18,7 +20,8 @@ namespace IRaCIS.Core.Application.Service.BackGroundJob
public class IRaCISCHangfireJob(ILogger<IRaCISCHangfireJob> _logger,
IRepository<Internationalization> _internationalizationRepository,
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
IMessageScheduler _IMessageScheduler
IMessageScheduler _iMessageScheduler,
IBus _bus
) : IIRaCISHangfireJob
{
public static string JsonFileFolder = Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources);
@@ -28,19 +31,7 @@ namespace IRaCIS.Core.Application.Service.BackGroundJob
{
_logger.LogInformation("项目启动 hangfire 任务初始化 执行开始~");
//初始化国际化
//查询数据库的数据
var toJsonList = await _internationalizationRepository.Where(t => t.InternationalizationType == 1).Select(t => new IRCGlobalInfoDTO()
{
Code = t.Code,
Value = t.Value,
ValueCN = t.ValueCN,
Description = t.Description
}).ToListAsync();
await InternationalizationHelper.BatchAddJsonKeyValueAsync(toJsonList);
//创建邮件定时任务
await InitSysAndTrialCronJobAsync();
@@ -80,7 +71,9 @@ namespace IRaCIS.Core.Application.Service.BackGroundJob
break;
}
//var schedulerEndpoint = await _bus.GetSendEndpoint(new Uri("queue:hangfire"));
//await schedulerEndpoint.ScheduleRecurringSend<QCImageQuestionSchedule>(new Uri("queue:mt-message-queue"), new QCImageQuestionSchedule() { ScheduleId = jobId, CronExpression = "0 0/1 * 1/1 * ? *" }, new PollExternalSystem { });
//await schedulerEndpoint.ScheduleRecurringSend<QCImageQuestionSchedule>(new Uri("queue:hangfire"), new QCImageQuestionSchedule() { ScheduleId = jobId + jobId, CronExpression = "0 0/1 * 1/1 * ? *" }, new PollExternalSystem { });
HangfireJobHelper.AddOrUpdateTrialCronJob(jobId, task.TrialId, task.BusinessScenarioEnum, task.EmailCron);
@@ -88,7 +81,7 @@ namespace IRaCIS.Core.Application.Service.BackGroundJob
}
public class PollExternalSystem { }
}
@@ -12902,14 +12902,14 @@
加急的医学反馈任务 通知MIM
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.UrgentMedicalReviewAddedEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.User},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.UrgentMedicalReviewAddedEventConsumer.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.User},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
<summary>
加急的医学反馈任务 通知MIM
</summary>
</member>
<member name="M:IRaCIS.Core.Application.MassTransit.Consumer.UrgentMedicalReviewAddedEventConsumer.Consume(MassTransit.ConsumeContext{IRaCIS.Core.Domain.UrgentMedicalReviewAddedEvent})">
<summary>
加急的医学反馈任务 通知MIM
加急的医学反馈任务 通知MIM (026,027)
</summary>
<param name="context"></param>
<returns></returns>
@@ -12985,6 +12985,11 @@
通知PM 进行一致性核查
</summary>
</member>
<member name="T:IRaCIS.Core.Application.MassTransit.Consumer.QCClaimTaskEventConsumer">
<summary>
QC 领取了质控任务
</summary>
</member>
<member name="T:IRaCIS.Core.Application.MassTransit.Consumer.MasstransitTestConsumer">
<summary>
meditor send 的时候,请求流会先到消费者,返回后才会执行后续代码
@@ -83,3 +83,13 @@ public class CheckStateChangedToAuditEventConsumer : IConsumer<CheckStateChanged
}
}
/// <summary>
/// QC 领取了质控任务
/// </summary>
public class QCClaimTaskEventConsumer : IConsumer<QCClaimTaskEvent>
{
public Task Consume(ConsumeContext<QCClaimTaskEvent> context)
{
throw new NotImplementedException();
}
}
@@ -70,7 +70,7 @@ public class TestMasstransitService : BaseService
await _mediatorScoped.Publish(new MasstransiTestCommand { value = "message at " + DateTime.Now.ToString() });
//await _scheduler.SchedulePublish(DateTime.Now.AddSeconds(10), new MasstransitHangfireTest() { value = "message at " + DateTime.Now.ToString() });
await _scheduler.SchedulePublish(DateTime.Now.AddSeconds(10), new MasstransiTestCommand() { value = "message at " + DateTime.Now.ToString() });
return ResponseOutput.Ok();
}
@@ -1,4 +1,5 @@
using MassTransit;
using IRaCIS.Core.Application.MassTransit.Command;
using MassTransit;
using MassTransit.Scheduling;
using System;
using System.Collections.Generic;
@@ -22,9 +23,9 @@ public abstract class IRCRecurringSchedule :
public string TimeZoneId { get; protected set; }
public DateTimeOffset StartTime { get; protected set; }
public DateTimeOffset? EndTime { get; protected set; }
public string ScheduleId { get; private set; }
public string ScheduleId { get; set; }
public string ScheduleGroup { get; private set; }
public string CronExpression { get; protected set; }
public string CronExpression { get; set; }
public string Description { get; protected set; }
}
@@ -53,4 +54,15 @@ public class ImageQCSchedule : IRCRecurringSchedule
}
public class QCImageQuestionScheduleConsumer : IConsumer<QCImageQuestionSchedule>
{
public Task Consume(ConsumeContext<QCImageQuestionSchedule> context)
{
Console.WriteLine(DateTime.Now);
return Task.CompletedTask;
}
}
@@ -184,6 +184,9 @@ namespace IRaCIS.Core.Application.ViewModel
public string EmailHtmlContent { get; set; } = string.Empty;
public string EmailHtmlContentCN { get; set; } = string.Empty;
public int? EmailDelaySeconds { get; set; }
}
@@ -206,7 +209,6 @@ namespace IRaCIS.Core.Application.ViewModel
public string FromEmail { get; set; } = string.Empty;
public List<Guid> BlackUserIdList { get; set; }
}