From 51922d7093b9c8f52417bfdd0fe9aa087d1fb5be Mon Sep 17 00:00:00 2001
From: xiazhengtongxue <133085197+xiazhengtongxue@users.noreply.github.com>
Date: 星期五, 01 五月 2026 18:31:01 +0800
Subject: [PATCH] feat: 优化仓库仪表盘界面并添加电池和空托盘统计功能

---
 Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
index e5332e1..43e60a1 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
@@ -36,6 +36,7 @@
     hostingContext.Configuration.ConfigureApplication();
     config.Sources.Clear();
     config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
+    config.AddJsonFile("outbound_time_config.json", optional: true, reloadOnChange: true);
 });
 
 builder.Host.UseSerilog((context, services, loggerConfiguration) =>
@@ -75,12 +76,15 @@
 builder.Services.AddSingleton<RoundRobinService>();
 builder.Services.Configure<AutoOutboundTaskOptions>(
     builder.Configuration.GetSection("AutoOutboundTask"));
+builder.Services.Configure<OutboundTimeConfigOptions>(
+    builder.Configuration.GetSection(OutboundTimeConfigOptions.SectionName));
 builder.Services.AddMemoryCacheSetup(); // 缂撳瓨鏈嶅姟
 builder.Services.AddWebSocketSetup();
 builder.Services.AddSqlsugarSetup(); // SqlSugar 鏁版嵁搴撻厤缃�
 builder.Services.AddDbSetup(); // Db 鏁版嵁搴撻厤缃�
 builder.Services.AddInitializationHostServiceSetup(); // 搴旂敤绋嬪簭鍒濆鍖栨湇鍔℃敞鍐�
 builder.Services.AddHostedService<AutoOutboundTaskBackgroundService>();  // 鍚姩鑷姩鍑哄簱浠诲姟鍚庡彴鏈嶅姟
+builder.Services.AddHostedService<StockMonitorBackgroundService>();  // 鍚姩搴撳瓨鐩戞帶鍚庡彴鏈嶅姟
 // builder.Services.AddHostedService<PermissionDataHostService>(); // 鏉冮檺鏁版嵁鏈嶅姟
 builder.Services.AddAutoMapperSetup();
 
@@ -98,6 +102,8 @@
     options.Filters.Add(typeof(ApiAuthorizeFilter));
     options.Filters.Add(typeof(ActionExecuteFilter));
 });
+
+builder.Services.AddSignalR();
 
 builder.Services.AddScoped<HttpClientHelper>();
 
@@ -174,4 +180,6 @@
 
 app.MapControllers();
 
+app.MapHub<WIDESEA_WMSServer.Hubs.StockHub>("/stockHub");
+
 app.Run();

--
Gitblit v1.9.3