From 26be25a7cd604e2bf18c785954141e6fc0690c9d Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Mon, 7 Aug 2023 14:15:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SettleAccount.Application/Entities/BQ/JobHostdService.cs | 4 ++++ .../SettleAccount.Application/Entities/BQ/VmiAppService.cs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs index 69fe330a..456e1942 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs @@ -7,9 +7,11 @@ using System.Net; using System.Threading; using System.Threading.Tasks; using Cronos; +using Microsoft.AspNetCore.SignalR; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using SettleAccount.Job.SignalR; using Volo.Abp.Application.Services; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; @@ -86,6 +88,7 @@ public class JobHostdService : BackgroundService, IApplicationService if (!jobItem.IsRunning) { jobLogId = this.JobItemStart(job.Id); + scope.ServiceProvider.GetRequiredService>().Clients.All.ServerToClient("JobItem", "refresh", ""); if (jobLogId.HasValue) { try @@ -100,6 +103,7 @@ public class JobHostdService : BackgroundService, IApplicationService Console.WriteLine(ex.ToString()); this.JobItemFaild(job.Id, jobLogId.Value, ex); } + scope.ServiceProvider.GetRequiredService>().Clients.All.ServerToClient("JobItem", "refresh", ""); } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs index f9931c25..fcf43679 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs @@ -128,7 +128,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran [DisableValidation] public virtual Task Invoke(IServiceProvider serviceProvider) { - this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", ""); + //this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", ""); Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/files/vmi")); var date = DateTime.Now.ToString("yyyyMMddHH"); var connectionString = $"Data Source=wwwroot/files/vmi/{date}.db"; @@ -166,7 +166,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran throw; } } - this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", ""); + //this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", ""); return Task.CompletedTask; }