From f4f475fd3c0e066ad82cdc61707f0e8e19583a02 Mon Sep 17 00:00:00 2001 From: Rodney Chen <rodney.chen@hotmail.com> Date: 星期四, 25 七月 2024 14:51:43 +0800 Subject: [PATCH] 进入工序时要增加判断过站是否按流程设置,增加非法过站防呆 增加生产不良记录用于记录发现的不良的管理 工序节点跟节点设置增加是否允许不良品进站的字段 --- Tiger.Api/ApiWebHostService.cs | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/Tiger.Api/ApiWebHostService.cs b/Tiger.Api/ApiWebHostService.cs index 3bead49..be53ff7 100644 --- a/Tiger.Api/ApiWebHostService.cs +++ b/Tiger.Api/ApiWebHostService.cs @@ -6,9 +6,26 @@ using System.Threading.Tasks; using Rhea.Common; using Tiger.IBusiness; +using System.ServiceProcess; namespace Tiger.Api { + public static class WebHostServiceExtensions + { + public static void RunAsApiService(this IWebHost host) + { + try + { + var webHostService = new ApiWebHostService(host); + ServiceBase.Run(webHostService); + } + catch (System.Exception ex) + { + Logger.Console.Fatal(ex, "Windows Services Exception"); + } + } + } + internal class ApiWebHostService : WebHostService { public ApiWebHostService(IWebHost host) : base(host) @@ -39,7 +56,7 @@ DI.Resolve<IServicesBus>().StopServices(); //鍏抽棴DB缂撳瓨鑷姩鏇存柊 DI.Resolve<IDbCacheBus>().StopAutoUpdate(); - MQTTHelper.MQTTConn?.Close(); + //MQTTHelper.MQTTConn?.Close(); base.OnStopping(); } catch (System.Exception ex) -- Gitblit v1.9.3