From c87b8242cbf5843b611f77640b89b14a7f61dbc3 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期四, 16 一月 2025 10:15:53 +0800
Subject: [PATCH] 添加程序使用有效期

---
 /dev/null                                                                                                    |    0 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj                                          |    2 +-
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs                                        |    1 +
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj                    |    2 +-
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs                                                      |    1 +
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs                                                      |    1 +
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/06dccb41-87b3-48ce-b00c-0fc37ecc3657.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs                                      |   16 ++++++++++++++++
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/44fbbe1e-6bf2-4799-85ed-f204f13fc099.vsidx |    0 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj                                          |    2 +-
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs                                                               |    5 +++++
 11 files changed, 27 insertions(+), 3 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/06dccb41-87b3-48ce-b00c-0fc37ecc3657.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/06dccb41-87b3-48ce-b00c-0fc37ecc3657.vsidx"
new file mode 100644
index 0000000..515e194
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/06dccb41-87b3-48ce-b00c-0fc37ecc3657.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9a9ae583-4231-47b4-b5bf-94e21e462e94.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9a9ae583-4231-47b4-b5bf-94e21e462e94.vsidx"
deleted file mode 100644
index 407f834..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9a9ae583-4231-47b4-b5bf-94e21e462e94.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj"
index 71f573d..c3531d3 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/WIDESEAWCS_BasicInfoService.csproj"
@@ -7,7 +7,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.4" />
+    <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.5" />
   </ItemGroup>
 
   <ItemGroup>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj"
index c6d82b8..23dc941 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/WIDESEAWCS_Model.csproj"
@@ -8,7 +8,7 @@
 
 	<ItemGroup>
 		<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
-		<PackageReference Include="WIDESEAWCS_Core" Version="1.0.12" />
+		<PackageReference Include="WIDESEAWCS_Core" Version="1.0.13" />
 	</ItemGroup>
 
 	<ItemGroup>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs"
index b5d6c5e..4b51fd2 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs"
@@ -38,6 +38,7 @@
 }); ;
 builder.ConfigureApplication();
 
+App.ExpDateTime = DateTime.Parse("2025-03-31 00:00:00");
 
 // 2、配置服务
 builder.Services.AddSingleton(new AppSettings(builder.Configuration));//注册
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj"
index 67721bb..9be2027 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/WIDESEAWCS_Tasks.csproj"
@@ -13,7 +13,7 @@
 	</ItemGroup>
 
 	<ItemGroup>
-	  <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.4" />
+	  <PackageReference Include="WIDESEAWCS_QuartzJob" Version="3.0.5" />
 	</ItemGroup>
 
 	<ItemGroup>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
index d548a01..7e89bd0 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
@@ -85,6 +85,7 @@
         {
             try
             {
+                Console.WriteLine(DateTime.Now);
                 CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
                 if (commonStackerCrane != null)
                 {
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/44fbbe1e-6bf2-4799-85ed-f204f13fc099.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/44fbbe1e-6bf2-4799-85ed-f204f13fc099.vsidx"
new file mode 100644
index 0000000..3942689
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/44fbbe1e-6bf2-4799-85ed-f204f13fc099.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/ec7cf4a8-d49d-49ce-bf3c-1956e1538ec8.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/ec7cf4a8-d49d-49ce-bf3c-1956e1538ec8.vsidx"
deleted file mode 100644
index b2a496b..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/ec7cf4a8-d49d-49ce-bf3c-1956e1538ec8.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs"
index a6b0317..f15e9c1 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/App.cs"
@@ -37,6 +37,11 @@
             set => _isRun = IsBuild = value;
         }
 
+        /// <summary>
+        /// 鏈夋晥鏈�
+        /// </summary>
+        public static DateTime? ExpDateTime = null;
+
         /// <summary>搴旂敤鏈夋晥绋嬪簭闆�</summary>
         public static readonly IEnumerable<Assembly> Assemblies = RuntimeExtension.GetAllAssemblies();
 
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs"
index 90d7b6e..6d29a17 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs"
@@ -5,6 +5,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Net;
 using System.Text;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
@@ -31,6 +32,21 @@
         //todo
         public async Task InvokeAsync(HttpContext context)
         {
+            if (App.ExpDateTime != null && (DateTime.Now - App.ExpDateTime.GetValueOrDefault()).TotalSeconds > 0)
+            {
+                context.Response.StatusCode = HttpStatusCode.InternalServerError.ObjToInt();
+                context.Response.ContentType = "application/json";
+
+                var json = new WebResponseContent();
+
+                json.Message = HttpStatusCode.InternalServerError.ToString();//閿欒淇℃伅
+                json.Code = 500;//500寮傚父 
+
+                StreamWriter streamWriter = new StreamWriter(context.Response.Body);
+                await streamWriter.WriteAsync(json.Serialize());
+                return;
+            }
+
             // 杩囨护锛屽彧鏈夋帴鍙�
             if (context.Request.Path.Value?.Contains("api") ?? false)
             {
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
index 87d1375..21796d4 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
@@ -35,6 +35,7 @@
 }); ;
 builder.ConfigureApplication();
 
+App.ExpDateTime = DateTime.Parse("2025-03-31 00:00:00");
 
 // 2、配置服务
 builder.Services.AddSingleton(new AppSettings(builder.Configuration));//注册

--
Gitblit v1.9.3