From 65bffa26b74d499f45b6585dca4e9989794874ba Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Mon, 9 Jun 2025 17:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9A=E6=97=B6=E5=8F=91?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IRaCIS.Core.Application.xml | 6 ++++++ .../Recurring/TrialDocumentConsumer.cs | 4 ++-- .../Service/Document/TrialDocumentService.cs | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 0f3c251e9..4ccbe8882 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -17418,6 +17418,12 @@ + + + 测试定时发送 + + + Setting 界面的 项目所有文档列表 diff --git a/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs b/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs index f6e36f723..fdf30e753 100644 --- a/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs +++ b/IRaCIS.Core.Application/MassTransit/Recurring/TrialDocumentConsumer.cs @@ -81,7 +81,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring ConfirmTime = confirm.ConfirmTime, RealName = trialUser.IdentityUser.FullName, UserName = trialUser.IdentityUser.UserName, - + UserCreateTime= trialUser.CreateTime, IdentityUserTypeList = trialUser.TrialUserRoleList.Select(t => t.UserRole.UserTypeRole.UserTypeShortName).ToList(), DocNeedSignUserTypeList = trialDoc.NeedConfirmedUserTypeList.Select(t => t.UserTypeRole.UserTypeShortName).ToList(), @@ -89,7 +89,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring var datalist = await trialDocQuery.IgnoreQueryFilters().Where(t => t.IsDeleted == false && t.ConfirmTime == null) .ToListAsync(); datalist = datalist.Where(x => x.SuggestFinishTime != null && x.SuggestFinishTime.Value.Date == DateTime.Now.Date) - .Where(x => x.IsNeedSendEmial).ToList(); + .ToList(); var confirmUserIdList = datalist.Select(t => t.ConfirmUserId).Distinct().ToList(); var userinfoList = await _identityUserRepository.Where(x => confirmUserIdList.Contains(x.Id)).ToListAsync(); diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index 1ec64abef..87cca2508 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -118,6 +118,24 @@ namespace IRaCIS.Core.Application.Services return ResponseOutput.Result(true); } + /// + /// 测试定时发送 + /// + /// + public async Task TestPush() + { + Task.Run(async () => + { + // 创建独立作用域 + using (var scope = serviceScopeFactory.CreateScope()) + { + // 从新作用域解析服务 + var mediator = scope.ServiceProvider.GetRequiredService(); + await mediator.Publish(new TrialDocumentErverDayEvent { }); + } + }); + return ResponseOutput.Result(true); + } /// /// Setting 界面的 项目所有文档列表