From 9efae261f479e4b370a5c2f7be1da5e0a8f00903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AD=A3=E6=98=93?= Date: Fri, 24 Jan 2025 13:09:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=BC=A0=E9=80=92=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E6=9C=89=E5=8F=98=E6=9B=B4=E5=88=99=E4=B8=BB?= =?UTF-8?q?=E5=8A=A8=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DOAN.ServiceCore/DoanBackgroundService.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/DOAN.ServiceCore/DoanBackgroundService.cs b/DOAN.ServiceCore/DoanBackgroundService.cs index 0e90ccf..07171a2 100644 --- a/DOAN.ServiceCore/DoanBackgroundService.cs +++ b/DOAN.ServiceCore/DoanBackgroundService.cs @@ -154,6 +154,9 @@ namespace DOAN.ServiceCore if (updateStoragelocationList.Any()) { await DbScoped.SugarScope.CopyNew().Updateable(updateStoragelocationList).ExecuteCommandAsync(); + // 发送库存变更Socket通知 + string changeMessage = "库存变动"; + await notificationHubContext.Clients.All.SendAsync("PBL_storagelocation_change", changeMessage); } // 插入库存变更日志 @@ -161,11 +164,6 @@ namespace DOAN.ServiceCore { await DbScoped.SugarScope.CopyNew().Insertable(inventoryLogs).ExecuteCommandAsync(); } - - // 发送Socket通知 - string changeMessage = "库存变动"; - await notificationHubContext.Clients.All.SendAsync("PBL_storagelocation_change", changeMessage); - // 添加延迟以避免频繁查询 await Task.Delay(200, stoppingToken); }