From 02a4fdd78cef9c7d2a26bfb9aa187179cf0baac3 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 25 二月 2026 17:44:26 +0800
Subject: [PATCH] 1

---
 Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal                                |    0 
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs                                                     |   81 +++++-
 Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db                               |    0 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.AssemblyInfo.cs         |    2 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs                                  |   17 +
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs                                                              |    5 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.AssemblyInfo.cs       |    2 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs                                              |   44 ++-
 Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db                               |    0 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.AssemblyInfo.cs |    2 
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_LogController.cs                                              |    6 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs                                           |  121 ++------
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs                                               |    2 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs                                                        |    8 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json                                                                     |   53 ++--
 Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db                                    |    0 
 Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db                                    |    0 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/obj/Debug/net6.0/WIDESEAWCS_IProcessService.AssemblyInfo.cs                 |    2 
 Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal                                |    0 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/BaseCommunicator.cs                                                            |    2 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessService/obj/Debug/net6.0/WIDESEAWCS_ProcessService.AssemblyInfo.cs                   |    2 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/QuartzNet/JobFactory.cs                                                           |    7 
 Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm                                |    0 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.AssemblyInfo.cs   |    2 
 Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal                           |    0 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs                                  |   95 +-----
 Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm                                |    0 
 Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal                           |    0 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs                                                                           |   35 ++
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs                                        |  212 ++++++++--------
 Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm                           |    0 
 Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm                           |    0 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.AssemblyInfo.cs                                 |    2 
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs                                                          |   18 +
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs                                                                   |    6 
 35 files changed, 393 insertions(+), 333 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db
index 8665ec7..610093d 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
index e8658c0..07d4b7a 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
index 00ef893..f1d7356 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
index 0268e68..0a56648 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
index 26ca3df..52252df 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
index 9a4843e..069eb54 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
+++ b/Code Management/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
Binary files differ
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/BaseCommunicator.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/BaseCommunicator.cs
index 2d53b02..755ac95 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/BaseCommunicator.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/BaseCommunicator.cs
@@ -39,6 +39,8 @@
         /// 璁惧鍚嶇О
         /// </summary>
         public abstract string Name { get; }
+        public abstract string IpAddress { get; }
+        public abstract int Port { get; }
 
         /// <summary>  
         /// 鑾峰彇褰撳墠閫氳鍣ㄦ槸鍚﹀凡杩炴帴鍒癙LC銆�  
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs
index 13fd3cc..3b3daa6 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Communicator/Siemens/SiemensS7Communicator.cs
@@ -81,6 +81,8 @@
         /// <summary>
         /// PLC鍚嶇О
         /// </summary>
+        public override string IpAddress => _ipAddress;
+        public override int Port => _port;
         public override string Name => _name;
 
         public override ILogNet LogNet => _logNet;
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs
index f226d5e..71f891f 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs
@@ -7,6 +7,7 @@
 using System.Security.Policy;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEAWCS_Core.LogHelper;
 
 namespace WIDESEAWCS_Core.Helper
 {
@@ -78,11 +79,13 @@
                     }
                 }
                 string result = string.Empty;
+                QuartzLogger.WriteLogToFile($"MOMAPI鎺ュ彛", $"璇锋眰鍦板潃锛氥�恵serviceAddress}銆�,璇锋眰鏃堕棿銆恵DateTime.Now}銆戣姹傚弬鏁般�恵JsonConvert.SerializeObject(requestJson)}銆憑Environment.NewLine}{Environment.NewLine}");
+
                 using (HttpContent httpContent = new StringContent(requestJson))
                 {
                     httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                     using HttpClient httpClient = new HttpClient();
-                    httpClient.Timeout = new TimeSpan(0, 0, 120);
+                    httpClient.Timeout = new TimeSpan(0, 0, 360);
 
                     if (headers != null)
                     {
@@ -91,6 +94,7 @@
                     }
                     result = await httpClient.PostAsync(serviceAddress, httpContent).Result.Content.ReadAsStringAsync();
                 }
+                QuartzLogger.WriteLogToFile($"MOMAPI鎺ュ彛", $"璇锋眰鍦板潃锛氥�恵serviceAddress}銆�,杩斿洖鏃堕棿銆恵DateTime.Now}銆戣繑鍥炲弬鏁般�恵JsonConvert.SerializeObject(result)}銆憑Environment.NewLine}{Environment.NewLine}");
                 return result;
             }
             catch (Exception e)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs
index 0f2909e..e4fd22c 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs
@@ -41,6 +41,9 @@
                 string responseParam = string.Empty;
                 try
                 {
+                    string? apiIgnore = AppSettings.GetValue("ApiLogIgnore")?.ToString();
+                    string[] ignoreUrls = !string.IsNullOrEmpty(apiIgnore) ? apiIgnore.Split(",") : new string[] { "get" };
+
                     (context.RequestServices.GetService(typeof(RequestLogModel)) as RequestLogModel).RequestDate = DateTime.Now;
                     try
                     {
@@ -63,8 +66,11 @@
 
                     ms.Position = 0;
                     await ms.CopyToAsync(originalBody);
-                    if (!(context.Request.Path.Value?.Contains("Get") ?? false))
+
+                    if (!ignoreUrls.Any(x => context.Request.Path.Value?.ToLower().Contains(x.ToLower()) ?? false))
+                    {
                         Logger.Add(requestParam, responseParam);
+                    }
                 }
                 catch (Exception ex)
                 {
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/obj/Debug/net6.0/WIDESEAWCS_IProcessService.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/obj/Debug/net6.0/WIDESEAWCS_IProcessService.AssemblyInfo.cs
index 235b710..332402f 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/obj/Debug/net6.0/WIDESEAWCS_IProcessService.AssemblyInfo.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_IProcessService/obj/Debug/net6.0/WIDESEAWCS_IProcessService.AssemblyInfo.cs
@@ -14,7 +14,7 @@
 [assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_IProcessService")]
 [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
 [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
 [assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_IProcessService")]
 [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_IProcessService")]
 [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.AssemblyInfo.cs
index f354aab..0b5cc99 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.AssemblyInfo.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyRepository.AssemblyInfo.cs
@@ -14,7 +14,7 @@
 [assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_ITaskInfo_HtyRepository")]
 [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
 [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
 [assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_ITaskInfo_HtyRepository")]
 [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_ITaskInfo_HtyRepository")]
 [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.AssemblyInfo.cs
index e961873..f250dbf 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.AssemblyInfo.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_ITaskInfo_HtyService.AssemblyInfo.cs
@@ -14,7 +14,7 @@
 [assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_ITaskInfo_HtyService")]
 [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
 [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
 [assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_ITaskInfo_HtyService")]
 [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_ITaskInfo_HtyService")]
 [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessService/obj/Debug/net6.0/WIDESEAWCS_ProcessService.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessService/obj/Debug/net6.0/WIDESEAWCS_ProcessService.AssemblyInfo.cs
index b707b17..ef9d7a9 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessService/obj/Debug/net6.0/WIDESEAWCS_ProcessService.AssemblyInfo.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_ProcessService/obj/Debug/net6.0/WIDESEAWCS_ProcessService.AssemblyInfo.cs
@@ -14,7 +14,7 @@
 [assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_ProcessService")]
 [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
 [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
 [assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_ProcessService")]
 [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_ProcessService")]
 [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/QuartzNet/JobFactory.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/QuartzNet/JobFactory.cs
index ba049e8..725f60a 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/QuartzNet/JobFactory.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/QuartzNet/JobFactory.cs
@@ -16,13 +16,18 @@
 #endregion << 鐗� 鏈� 娉� 閲� >>
 
 using Microsoft.Extensions.DependencyInjection;
-using Quartz.Spi;
+using Newtonsoft.Json;
 using Quartz;
+using Quartz.Spi;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Reflection.Metadata;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_Core.LogHelper;
+//using static Microsoft.CodeAnalysis.CSharp.SyntaxTokenParser;
 
 namespace WIDESEAWCS_QuartzJob
 {
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
index 2d7637b..daec327 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/Service/RouterService.cs
@@ -2,12 +2,14 @@
 using SqlSugar;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.BaseServices;
 using WIDESEAWCS_Core.Enums;
+using WIDESEAWCS_Core.LogHelper;
 using WIDESEAWCS_DTO.BasicInfo;
 using WIDESEAWCS_QuartzJob.Models;
 using WIDESEAWCS_QuartzJob.Repository;
@@ -82,7 +84,13 @@
         {
             // 鐢ㄤ簬璁板綍宸茬粡璁块棶杩囩殑璧风偣鍜岀粓鐐圭粍鍚堬紝閬垮厤閲嶅璁块棶杩涘叆姝诲惊鐜�
             HashSet<string> visitedRoutes = new HashSet<string>();
-            return QueryNextRoutesInternal(startPosi, endPosi, visitedRoutes);
+            var stopwatch = Stopwatch.StartNew();
+            var rasult = QueryNextRoutesInternal(startPosi, endPosi, visitedRoutes);
+            
+            stopwatch.Stop();
+            var elapsed = stopwatch.ElapsedMilliseconds;
+            QuartzLogger.WriteLogToFile("璺敱鏌ヨ", $"鏃堕暱{elapsed},璧风偣锛歿startPosi},缁堢偣{endPosi}");
+            return rasult;
         }
 
         private List<Dt_Router> QueryNextRoutesInternal(string startPosi, string endPosi, HashSet<string> visitedRoutes)
@@ -125,10 +133,10 @@
                         }
                     }
                 }
-                else
-                {
-                    throw new Exception($"璇ヨ矾寰勬湭閰嶇疆鎴栭厤缃敊璇�,璇锋鏌ヨ澶囪矾鐢变俊鎭�,璧风偣:銆恵startPosi}銆�,缁堢偣:銆恵endPosi}銆�");
-                }
+                //else
+                //{
+                //    throw new Exception($"璇ヨ矾寰勬湭閰嶇疆鎴栭厤缃敊璇�,璇锋鏌ヨ澶囪矾鐢变俊鎭�,璧风偣:銆恵startPosi}銆�,缁堢偣:銆恵endPosi}銆�");
+                //}
             }
             catch (Exception ex)
             {
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
index b1dba4c..66084e4 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
@@ -13,6 +13,7 @@
 using WIDESEAWCS_Core.Extensions;
 using WIDESEAWCS_Core.Filter;
 using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_Core.LogHelper;
 using WIDESEAWCS_Core.Middlewares;
 using WIDESEAWCS_QuartzJob.QuartzExtensions;
 using WIDESEAWCS_QuartzJob.Seed;
@@ -22,6 +23,40 @@
 
 var builder = WebApplication.CreateBuilder(args);
 
+int workerThreads = Environment.ProcessorCount * 8;
+int completionThreads = Environment.ProcessorCount;
+ThreadPool.SetMaxThreads(workerThreads, completionThreads);
+
+AppDomain.CurrentDomain.FirstChanceException += (sender, e) =>
+{
+    bool flag = e.Exception.TargetSite?.DeclaringType?.Namespace?.StartsWith("WIDESEA") == true;
+
+    if (e.Exception is not OperationCanceledException && flag)
+    {
+        string folderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Log\\Exception");
+        Exception ex = e.Exception;
+        StringBuilder builder = new StringBuilder();
+        builder.Append("错误信息:");
+        builder.Append(ex.Message);
+        builder.Append(Environment.NewLine);
+        builder.Append("错误源:");
+        builder.Append(ex.Source);
+        builder.Append(Environment.NewLine);
+        builder.Append("错误堆栈:");
+        builder.Append(ex.StackTrace);
+        builder.Append(Environment.NewLine);
+        builder.Append("错误类型:");
+        builder.Append(ex.GetType().ToString());
+        builder.Append(Environment.NewLine);
+        builder.Append("错误方法:");
+        builder.Append(ex.TargetSite?.ToString());
+        builder.Append(Environment.NewLine);
+        builder.Append(Environment.NewLine);
+
+        QuartzLogger.WriteLogToFile($"Error_全局错误", builder.ToString());
+    }
+};
+
 if (!HslCommunication.Authorization.SetAuthorizationCode("95f1611d-633c-46ea-b03a-38ede1629f74"))
 {
     ConsoleHelper.WriteErrorLine("授权失败!当前程序只能使用24小时!");
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
index 03758d1..422fdd6 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json
@@ -1,28 +1,29 @@
 {
-    "urls": "http://*:9290", //web鏈嶅姟绔彛锛屽鏋滅敤IIS閮ㄧ讲锛屾妸杩欎釜鍘绘帀
-    "Logging": {
-        "LogLevel": {
-            "Default": "Information",
-            "Microsoft.AspNetCore": "Warning"
-        }
-    },
-    "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType",
-    "AllowedHosts": "*",
-    "ConnectionStringsEncryption": false,
-    "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
-    //杩炴帴瀛楃涓�
-    //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WCSDBB2F;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
-    "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
-    //璺ㄥ煙
-    "Cors": {
-        "PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О
-        "EnableAllIPs": true, //褰撲负true鏃讹紝寮�鏀炬墍鏈塈P鍧囧彲璁块棶銆�
-        // 鏀寔澶氫釜鍩熷悕绔彛锛屾敞鎰忕鍙e彿鍚庝笉瑕佸甫/鏂滄潌锛氭瘮濡俵ocalhost:8000/锛屾槸閿欑殑
-        // 娉ㄦ剰锛宧ttp://127.0.0.1:1818 鍜� http://localhost:1818 鏄笉涓�鏍风殑
-        "IPs": "http://127.0.0.1:8080,http://localhost:8080,http://127.0.0.1:8081,http://localhost:8081"
-    },
-    "ApiName": "WIDESEA",
-    "ExpMinutes": 120,
-    "QuartzJobAutoStart": true,
-    "LogDeubgEnable": true
+  "urls": "http://*:9291", //web鏈嶅姟绔彛锛屽鏋滅敤IIS閮ㄧ讲锛屾妸杩欎釜鍘绘帀
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft.AspNetCore": "Warning"
+    }
+  },
+  "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType",
+  "AllowedHosts": "*",
+  "ConnectionStringsEncryption": false,
+  "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
+  //杩炴帴瀛楃涓�
+  //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WCSDBB2F;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+  "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+  //璺ㄥ煙
+  "Cors": {
+    "PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О
+    "EnableAllIPs": true, //褰撲负true鏃讹紝寮�鏀炬墍鏈塈P鍧囧彲璁块棶銆�
+    // 鏀寔澶氫釜鍩熷悕绔彛锛屾敞鎰忕鍙e彿鍚庝笉瑕佸甫/鏂滄潌锛氭瘮濡俵ocalhost:8000/锛屾槸閿欑殑
+    // 娉ㄦ剰锛宧ttp://127.0.0.1:1818 鍜� http://localhost:1818 鏄笉涓�鏍风殑
+    "IPs": "http://127.0.0.1:8080,http://localhost:8080,http://127.0.0.1:8081,http://localhost:8081"
+  },
+  "ApiLogIgnore": "get,query,download,upload,template",
+  "ApiName": "WIDESEA",
+  "ExpMinutes": 120,
+  "QuartzJobAutoStart": true,
+  "LogDeubgEnable": true
 }
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.AssemblyInfo.cs
index fedfef6..2f2bba0 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.AssemblyInfo.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_SignalR/obj/Debug/net6.0/WIDESEAWCS_SignalR.AssemblyInfo.cs
@@ -14,7 +14,7 @@
 [assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_SignalR")]
 [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
 [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
 [assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_SignalR")]
 [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_SignalR")]
 [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
index 14d13d7..0bb0701 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -156,6 +156,11 @@
                                 // 璁剧疆涓嬩竴涓湴鍧�涓虹涓�涓瓙浣嶇疆
                                 task.NextAddress = routers.FirstOrDefault().ChildPosi;
                             }
+                            else
+                            {
+                                QuartzLogger.WriteLogToFile("璺敱鏌ユ壘寮傚父", $"璧风偣锛歿item.SourceAddress},缁堢偣锛歿item.TargetAddress},浠诲姟鍙凤細{item.TaskNum}");
+                                return content.Error("鏈壘鍒拌矾鐢遍厤缃�");
+                            }
                         }
                         else
                         {
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.AssemblyInfo.cs
index 6437426..c6f15db 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.AssemblyInfo.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyRepository/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyRepository.AssemblyInfo.cs
@@ -14,7 +14,7 @@
 [assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_TaskInfo_HtyRepository")]
 [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
 [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
 [assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_TaskInfo_HtyRepository")]
 [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_TaskInfo_HtyRepository")]
 [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.AssemblyInfo.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.AssemblyInfo.cs
index e2018d4..b4c6f25 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.AssemblyInfo.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfo_HtyService/obj/Debug/net6.0/WIDESEAWCS_TaskInfo_HtyService.AssemblyInfo.cs
@@ -14,7 +14,7 @@
 [assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEAWCS_TaskInfo_HtyService")]
 [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
 [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bfa85418f2da7b0f3570d7e44b203727c637b729")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+29aa484d06b2d4839536034bb1033d0e60334ec2")]
 [assembly: System.Reflection.AssemblyProductAttribute("WIDESEAWCS_TaskInfo_HtyService")]
 [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEAWCS_TaskInfo_HtyService")]
 [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs
index 987db4f..2d4d0fc 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CWTask/RequestInbound.cs
@@ -47,94 +47,46 @@
         /// </summary>
         private void HandleNewTask(CommonConveyorLine_CW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
         {
-            Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
-
-            if (stationManager == null)
+            try
             {
-                // Handle the case where stationManager is not found, if necessary
-                Console.WriteLine($"鏈壘鍒皗childDeviceCode}绔欏彴");
-                return;
-            }
 
-            // 鏍规嵁绔欑被鍨嬫墽琛岀浉搴旂殑鏂规硶
-            switch (stationManager.stationType)
-            {
-                case 8:
-                case 9:
-                case 11:
-                case 12:
-                    var task = _taskService.QueryExecutingTaskByBarcode(command.ConveyorLineBarcode, childDeviceCode);
-                    if (task != null)
-                    {
+                Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
+
+                if (stationManager == null)
+                {
+                    // Handle the case where stationManager is not found, if necessary
+                    Console.WriteLine($"鏈壘鍒皗childDeviceCode}绔欏彴");
+                    return;
+                }
+
+                // 鏍规嵁绔欑被鍨嬫墽琛岀浉搴旂殑鏂规硶
+                switch (stationManager.stationType)
+                {
+                    case 8:
+                    case 9:
+                    case 11:
+                    case 12:
+                        var task = _taskService.QueryExecutingTaskByBarcode(command.ConveyorLineBarcode, childDeviceCode);
+                        if (task != null)
+                        {
+                            ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode);
+                        }
+                        break;
+                    case 1:
+                    case 6:
+                    case 10:
                         ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode);
-                    }
-                    break;
-                case 1:
-                case 6:
-                case 10:
-                    ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode);
-                    break;
-                    //case 16:
-                    //    ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode);
-                    //    break;
+                        break;
+                        //case 16:
+                        //    ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode);
+                        //    break;
+                }
+
             }
-
-            #region
-            //Dt_StationManager stationManager = _stationManagerRepository.QueryFirst(x => x.stationPLC == conveyorLine.DeviceCode && x.stationChildCode == childDeviceCode);
-
-            //if (stationManager.stationType == 8)
-            //{
-            //    var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
-            //    if (task != null)
-            //    {
-            //        RequestInNextAddress(conveyorLine, command, childDeviceCode);
-            //    }
-            //}
-            //else if (stationManager.stationType == 9)
-            //{
-            //    var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
-            //    if (task != null)
-            //    {
-            //        ConveyorLineInFinish(conveyorLine, command, childDeviceCode);
-            //    }
-            //}
-            //else if (stationManager.stationType == 1)
-            //{
-            //    if (stationManager.stationArea.Contains("GW"))
-            //    {
-            //        var taskGW = _taskRepository.QueryFirst(x => x.TargetAddress == childDeviceCode && x.TaskState == (int)TaskOutStatusEnum.OutFinish);
-            //        if (taskGW != null)
-            //        {
-            //            command.ConveyorLineBarcode = taskGW.PalletCode;
-            //        }
-            //    }
-            //    RequestWmsTask(conveyorLine, command, childDeviceCode);
-            //}
-            //else if (stationManager.stationType == 10)
-            //{
-            //    var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
-            //    if (task != null)
-            //    {
-            //        RequestOutbound(conveyorLine, command, childDeviceCode);
-            //    }
-            //}
-            //else if (stationManager.stationType == 11)
-            //{
-            //    var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
-            //    if (task != null)
-            //    {
-            //        RequestOutNextAddress(conveyorLine, command, childDeviceCode);
-            //    }
-            //}
-            //else if (stationManager.stationType == 12)
-            //{
-            //    var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
-            //    if (task != null)
-            //    {
-            //        ConveyorLineOutFinish(conveyorLine, command, childDeviceCode);
-            //    }
-            //}
-            #endregion
+            catch (Exception ex)
+            {
+                WriteInfo("HandleNewTask", $"銆恵ex.Message}銆�");
+            }
         }
 
         private void ExecuteStationAction(Dt_StationManager stationManager, CommonConveyorLine_CW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
@@ -168,7 +120,6 @@
                     AbNormalStationBZTask(conveyorLine, command, childDeviceCode);
                     break;
                 case 1:
-
                     RequestWmsTask(conveyorLine, command, childDeviceCode, stationManager);
                     break;
             }
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs
index dca1ac8..0e755ba 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_CW/CommonConveyorLine_CWJob.cs
@@ -28,12 +28,16 @@
 using SqlSugar;
 using System.ComponentModel.Design;
 using System.Reflection;
+using System.Reflection.Metadata;
+using System.Threading;
 using WIDESEAWCS_BasicInfoRepository;
 using WIDESEAWCS_Common;
 using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_Communicator;
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.Helper;
 using WIDESEAWCS_Core.HttpContextUser;
+using WIDESEAWCS_Core.LogHelper;
 using WIDESEAWCS_DTO.MOM;
 using WIDESEAWCS_DTO.TaskInfo;
 using WIDESEAWCS_IProcessRepository;
@@ -47,6 +51,7 @@
 using WIDESEAWCS_QuartzJob.Service;
 using WIDESEAWCS_SignalR;
 using WIDESEAWCS_Tasks.ConveyorLineJob;
+using static Quartz.Logging.OperationName;
 using ICacheService = WIDESEAWCS_Core.Caches.ICacheService;
 using Platform = WIDESEAWCS_Model.Models.Platform;
 
@@ -69,7 +74,7 @@
         private readonly IDeviceInfoRepository _deviceInfoRepository;
         private static List<string>? userTokenIds;
         private static List<int>? userIds;
-        private static List<string> childCodeList = new List<string>();
+        private static DateTime? lastUpdateTime;
 
         public CommonConveyorLine_CWJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService, IDt_needBarcodeRepository needBarcodeRepository, IDeviceInfoRepository deviceInfoRepository)
         {
@@ -94,99 +99,109 @@
                 CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)context.JobDetail.JobDataMap.Get("JobParams");
                 if (conveyorLine != null)
                 {
-                    #region 绔欏彴鏂瑰紡
-
-                    //List<Dt_StationManager> stationManagers = _stationManagerService.GetAllStationByDeviceCode(conveyorLine.DeviceCode);
-
-                    //foreach (var station in stationManagers)
-                    //{
-                    //    ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(station.stationChildCode);
-
-                    //    DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand_After.InteractiveSignal) && x.ProtocalDetailValue == command.InteractiveSignal.ToString());
-                    //    if (deviceProtocolDetails != null)
-                    //    {
-                    //        MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType);
-                    //        if (method != null)
-                    //        {
-                    //            method.Invoke(this, new object[] { conveyorLine, command, station });
-                    //        }
-                    //    }
-                    //}
-
-                    #endregion 绔欏彴鏂瑰紡
-
                     #region 璺敱鏂瑰紡
                     List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
 
-                    if (conveyorLine.DeviceCode == "1024")
+                    var chunks = childDeviceCodes.Chunk(10);
+
+                    //if (conveyorLine.DeviceCode == "1024")
+                    //{
+                    //    childDeviceCodes.Add("4000");
+                    //}
+
+                    //var options = new ParallelOptions
+                    //{
+                    //    MaxDegreeOfParallelism = 10
+                    //    //MaxDegreeOfParallelism = Environment.ProcessorCount
+                    //};
+
+                    //{
+                    //    SiemensS7 siemensS7 = new SiemensS7(conveyorLine.Communicator.IpAddress, conveyorLine.Communicator.Port, conveyorLine.DeviceName);
+                    //    siemensS7.Connect();
+                    //    tasks.Add(Task.Run(() =>
+                    //    {
+
+                    //    }));
+                    //}
+                    //Parallel.For(0, childDeviceCodes.Count, options, i =>
+                    //Parallel.ForEach(childDeviceCodes, options, childDeviceCode =>
+                    var tasks = new List<Task>();
+                    
+                    foreach (var item in chunks)
                     {
-                        childDeviceCodes.Add("4000");
-                    }
-
-                    foreach (string childDeviceCode in childDeviceCodes)
-                    {
-                        
-                        ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
-
-                        if (command == null) continue;
-                        //if (command.InteractiveSignal == 0 && command.HasPallet != 1) continue;
-                        if (command.ConveyorLineBarcode.Trim().Contains("\0")) command.ConveyorLineBarcode = "";
-                        
-                        DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand_After.InteractiveSignal) && x.ProtocalDetailValue == command.InteractiveSignal.ToString());
-                        if (deviceProtocolDetails != null)
+                        tasks.Add(Task.Run(() =>
                         {
-                            MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType);
-                            if (method != null)
+                            foreach (string childDeviceCode in item)
                             {
-                                method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode });
-                            }
-                        }
+                                ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(childDeviceCode);
 
-                        if (childDeviceCode == "1670" || childDeviceCode == "1666" || childDeviceCode == "1548" || childDeviceCode == "1448")
-                        {
-                            Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
-                            if (platform != null)
-                            {
-                                if (command.HasPallet != 1)
+                                if (command != null)
                                 {
-                                    MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
-                                    if (method != null)
+                                    if (command.ConveyorLineBarcode.Trim().Contains("\0")) command.ConveyorLineBarcode = "";
+
+                                    DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand_After.InteractiveSignal) && x.ProtocalDetailValue == command.InteractiveSignal.ToString());
+                                    if (deviceProtocolDetails != null)
                                     {
-                                        int count = 1;
-                                        method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
+                                        MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType);
+                                        if (method != null)
+                                        {
+                                            method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode });
+                                        }
                                     }
+
+                                    if (childDeviceCode == "1670" || childDeviceCode == "1666" || childDeviceCode == "1548" || childDeviceCode == "1448")
+                                    {
+                                        if (lastUpdateTime > DateTime.Now.AddMinutes(1))
+                                        {
+                                            lastUpdateTime = DateTime.Now;
+                                            Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
+                                            if (platform != null)
+                                            {
+                                                if (command.HasPallet != 1)
+                                                {
+                                                    MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
+                                                    if (method != null)
+                                                    {
+                                                        int count = 1;
+                                                        method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
+                                                    }
+                                                }
+                                            }
+                                        }
+                                    }
+
+                                    #region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
+
+                                    var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken");
+                                    if (tokenInfos != null || tokenInfos.Any())
+                                    {
+
+                                        var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList();
+                                        var userIds = tokenInfos?.Select(x => x.UserId).ToList();
+
+                                        object obj = new
+                                        {
+                                            childDeviceCode,
+                                            commandAfter = command,
+                                        };
+                                        _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj });
+
+                                    }
+                                    #endregion 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
                                 }
+
+
                             }
-                        }
-
-
-                        #region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
-
-                        var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken");
-                        if (tokenInfos == null || !tokenInfos.Any())
-                        {
-                            continue;
-                        }
-                        var userTokenIds = tokenInfos?.Select(x => x.Token_ID).ToList();
-                        var userIds = tokenInfos?.Select(x => x.UserId).ToList();
-
-                        object obj = new
-                        {
-                            childDeviceCode,
-                            commandAfter = command,
-                        };
-                        _noticeService.LineData(userIds?.FirstOrDefault(), userTokenIds, new { conveyorLine.DeviceName, data = obj });
-
-                        #endregion 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
-
+                        }));
                     }
+                    //Task.WaitAll(tasks.ToArray());
 
                     #endregion 璺敱鏂瑰紡
                 }
             }
             catch (Exception ex)
             {
-                Console.Out.WriteLine(nameof(CommonConveyorLine_CWJob) + ":" + DateTime.Now + ":" + ex.ToString(),ex.StackTrace);
+                Console.Out.WriteLine(nameof(CommonConveyorLine_CWJob) + ":" + DateTime.Now + ":" + ex.ToString(), ex.StackTrace);
             }
             finally
             {
@@ -209,7 +224,6 @@
                 var log = $"鏃堕棿锛氥�恵DateTime.Now}銆戙�恵conveyorLine.DeviceName}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戜换鍔″彿锛氥�恵command.ConveyorLineTaskNum}銆戣澶囩紪鐮侊細銆恵childDeviceCode}銆�";
                 ConsoleHelper.WriteSuccessLine(log);
 
-                //_noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
                 WriteInfo(conveyorLine.DeviceName, log);
 
                 if (childDeviceCode == "4000")
@@ -225,15 +239,15 @@
                 }
                 else
                 {
-                    if (childDeviceCode == "1039")
-                    {
-                        var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
-                        if (GWTask.Count >= 2 && childDeviceCode == "1039" && task.Roadway.Contains("GWSC2"))
-                        {
-                            ConsoleHelper.WriteErrorLine($"鏃堕棿锛氥�恵DateTime.Now}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戦珮娓╀簩宸插瓨鍦ㄣ�恵GWTask.Count}銆戜釜浠诲姟澶т簬2涓换鍔′笉鍙笅鍙�");
-                            return;
-                        }
-                    }
+                    //if (childDeviceCode == "1039")
+                    //{
+                    //    var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
+                    //    if (GWTask.Count >= 2 && childDeviceCode == "1039" && task.Roadway.Contains("GWSC2"))
+                    //    {
+                    //        ConsoleHelper.WriteErrorLine($"鏃堕棿锛氥�恵DateTime.Now}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戦珮娓╀簩宸插瓨鍦ㄣ�恵GWTask.Count}銆戜釜浠诲姟澶т簬2涓换鍔′笉鍙笅鍙�");
+                    //        return;
+                    //    }
+                    //}
 
                     ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
 
@@ -282,15 +296,6 @@
                     }
                 }
             }
-            //else
-            //{
-            //    //褰撳墠鍦板潃璇锋眰 瀵绘壘褰撳墠鍦板潃鐨勬墭鐩樺彿 浠诲姟鍙风殑浠诲姟锛屽瀛樺湪浠诲姟鍒欓噸鏂板啀娆″啓鍏ユ柊鐩爣鍦板潃
-            //    Dt_Task currentTask = _taskService.QueryExecutingCurrentConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode);
-            //    if (currentTask != null)
-            //    {
-            //        conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(currentTask.TargetAddress), childDeviceCode);
-            //    }
-            //}
         }
 
         /// <summary>
@@ -412,12 +417,9 @@
                 // 鎷兼帴瀹屾暣鐨凪OM鎺ュ彛鍦板潃锛堝熀纭�IP + 鎺ュ彛璺緞锛�
                 var MOMIpAddress = wmsBase + ipAddress;
 
-                // 5. 璋冪敤MOM鎺ュ彛锛圥OST寮傛璇锋眰锛屽悓姝ョ瓑寰呯粨鏋滐級
+                WriteInfo("鍏ョ珯鏍¢獙", $"銆恵childDeviceCode}銆戝叆绔欐牎楠岃姹傚弬鏁般�恵trayCells.Serialize()}銆�");
                 var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.Serialize()).Result;
 
-                // 璁板綍鎺ュ彛璋冪敤鏃ュ織锛堣姹傚弬鏁般�佽繑鍥炲弬鏁帮級锛屼究浜庨棶棰樻帓鏌�
-                WriteInfo("鍏ョ珯鏍¢獙", $"銆恵childDeviceCode}銆戝叆绔欐牎楠岃姹傚弬鏁般�恵trayCells.Serialize()}銆�");
-                WriteInfo("鍏ョ珯鏍¢獙", "");
                 WriteInfo("鍏ョ珯鏍¢獙", $"銆恵childDeviceCode}銆戝叆绔欐牎楠岃繑鍥炲弬鏁般�恵result}銆�");
 
                 // 6. 瑙f瀽MOM鎺ュ彛杩斿洖缁撴灉涓哄疄浣撳璞�
@@ -519,7 +521,11 @@
                     content = _taskService.UpdateTaskStatusToNext(task);
                 }
                 var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == childDeviceCode && x.stationArea == "Call" && x.stationType == 12);
-                CommonConveyorLine_BZ? commonConveyorBZ=Storage.Devices.FirstOrDefault(x=>x.DeviceCode==station.stationPLC) as CommonConveyorLine_BZ;
+                if (station == null)
+                {
+                    return;
+                }
+                CommonConveyorLine_BZ? commonConveyorBZ = Storage.Devices.FirstOrDefault(x => x.DeviceCode == station.stationPLC) as CommonConveyorLine_BZ;
                 if (commonConveyorBZ != null)
                 {
                     ConveyorLineTaskCommand_After readSignal = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(station.stationLocation);
@@ -633,14 +639,11 @@
                 }
                 var wmsIpAddress = wmsBase + requestTrayOutTask;
 
-                
+
                 List<string> strings = platform.Location.Split(',').ToList();
 
-                WriteInfo("璋冨害鎵ц鏃堕棿璁板綍", "銆愯皟鍙朩MS鍑哄簱鎺ュ彛寮�濮嬫椂闂达細銆�" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
-
                 var result = await HttpHelper.PostAsync(wmsIpAddress, new { Position = childDeviceCode, Tag = (int)taskType, AreaCdoe = platform.Stacker, AreaCdoes = strings, platform.ProductionLine }.Serialize());
-
-                WriteInfo("璋冨害鎵ц鏃堕棿璁板綍", "銆愯皟鍙朩MS鍑哄簱鎺ュ彛缁撴潫鏃堕棿锛氥��" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
+                WriteInfo("OCV璇锋眰杩斿洖鍙傛暟", $"鏃堕棿锛氥�恵DateTime.Now}銆戣姹傜偣浣嶃�恵childDeviceCode}銆戣繑鍥炲弬鏁般�恵JsonConvert.SerializeObject(result)}銆�");
 
                 WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
 
@@ -662,6 +665,7 @@
         public WebResponseContent CreateAndSendTask(WMSTaskDTO taskDTO)
         {
             var content = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
+
             if (content.Status)
             {
                 Console.WriteLine($"{taskDTO.TaskType}鍛煎彨鎴愬姛");
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs
index 993d276..d8df41f 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs
@@ -94,30 +94,14 @@
                 CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)context.JobDetail.JobDataMap.Get("JobParams");
                 if (conveyorLine != null)
                 {
-                    #region 绔欏彴鏂瑰紡
-
-                    //List<Dt_StationManager> stationManagers = _stationManagerService.GetAllStationByDeviceCode(conveyorLine.DeviceCode);
-
-                    //foreach (var station in stationManagers)
-                    //{
-                    //    ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(station.stationChildCode);
-
-                    //    DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand_After.InteractiveSignal) && x.ProtocalDetailValue == command.InteractiveSignal.ToString());
-                    //    if (deviceProtocolDetails != null)
-                    //    {
-                    //        MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType);
-                    //        if (method != null)
-                    //        {
-                    //            method.Invoke(this, new object[] { conveyorLine, command, station });
-                    //        }
-                    //    }
-                    //}
-
-                    #endregion 绔欏彴鏂瑰紡
-
                     #region 璺敱鏂瑰紡
                     List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
-                    
+
+                    if (conveyorLine.DeviceCode == "1024")
+                    {
+                        childDeviceCodes.Add("4000");
+                    }
+
                     foreach (string childDeviceCode in childDeviceCodes)
                     {
                         
@@ -137,22 +121,22 @@
                             }
                         }
 
-                        if (childDeviceCode == "1670" || childDeviceCode == "1666" || childDeviceCode == "1548" || childDeviceCode == "1448")
-                        {
-                            Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
-                            if (platform != null)
-                            {
-                                if (command.HasPallet != 1)
-                                {
-                                    MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
-                                    if (method != null)
-                                    {
-                                        int count = 1;
-                                        method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
-                                    }
-                                }
-                            }
-                        }
+                        //if (childDeviceCode == "1670" || childDeviceCode == "1666" || childDeviceCode == "1548" || childDeviceCode == "1448")
+                        //{
+                        //    Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
+                        //    if (platform != null)
+                        //    {
+                        //        if (command.HasPallet != 1)
+                        //        {
+                        //            MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
+                        //            if (method != null)
+                        //            {
+                        //                int count = 1;
+                        //                method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
+                        //            }
+                        //        }
+                        //    }
+                        //}
 
 
                         #region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
@@ -205,7 +189,6 @@
                 var log = $"鏃堕棿锛氥�恵DateTime.Now}銆戙�恵conveyorLine.DeviceName}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戜换鍔″彿锛氥�恵command.ConveyorLineTaskNum}銆戣澶囩紪鐮侊細銆恵childDeviceCode}銆�";
                 ConsoleHelper.WriteSuccessLine(log);
 
-                //_noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
                 WriteInfo(conveyorLine.DeviceName, log);
 
                 if (task == null)
@@ -214,16 +197,6 @@
                 }
                 else
                 {
-                    if (childDeviceCode == "1039")
-                    {
-                        var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
-                        if (GWTask.Count >= 2 && childDeviceCode == "1039" && task.Roadway.Contains("GWSC2"))
-                        {
-                            ConsoleHelper.WriteErrorLine($"鏃堕棿锛氥�恵DateTime.Now}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戦珮娓╀簩宸插瓨鍦ㄣ�恵GWTask.Count}銆戜釜浠诲姟澶т簬2涓换鍔′笉鍙笅鍙�");
-                            return;
-                        }
-                    }
-
                     ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
 
                     bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
@@ -261,7 +234,6 @@
                 if (newTask != null)
                 {
                     ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
-                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
 
                     bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                     if (sendFlag)
@@ -271,15 +243,6 @@
                     }
                 }
             }
-            //else
-            //{
-            //    //褰撳墠鍦板潃璇锋眰 瀵绘壘褰撳墠鍦板潃鐨勬墭鐩樺彿 浠诲姟鍙风殑浠诲姟锛屽瀛樺湪浠诲姟鍒欓噸鏂板啀娆″啓鍏ユ柊鐩爣鍦板潃
-            //    Dt_Task currentTask = _taskService.QueryExecutingCurrentConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode);
-            //    if (currentTask != null)
-            //    {
-            //        conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(currentTask.TargetAddress), childDeviceCode);
-            //    }
-            //}
         }
 
         /// <summary>
@@ -365,9 +328,9 @@
                 };
 
                 var MOMIpAddress = wmsBase + ipAddress;
-
-                var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.Serialize()).Result;
                 WriteInfo("鍏ョ珯鏍¢獙", $"銆恵childDeviceCode}銆戝叆绔欐牎楠岃姹傚弬鏁般�恵trayCells.Serialize()}銆�");
+                var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.Serialize()).Result;
+                
                 WriteInfo("鍏ョ珯鏍¢獙", "");
                 WriteInfo("鍏ョ珯鏍¢獙", $"銆恵childDeviceCode}銆戝叆绔欐牎楠岃繑鍥炲弬鏁般�恵result}銆�");
                 ResultTrayCellsStatus result1 = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(result);
@@ -377,7 +340,6 @@
                     if (newTask != null)
                     {
                         ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
-                        //conveyorLine.SendCommand(taskCommand, childDeviceCode);
 
                         bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                         if (sendFlag)
@@ -391,7 +353,6 @@
                 {
                     ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                     taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode);
-                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
 
                     bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                     if (sendFlag)
@@ -414,9 +375,7 @@
             var log = $"鏃堕棿锛氥�恵DateTime.Now}銆戙�恵conveyorLine.DeviceName}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戜换鍔″彿锛氥�恵command.ConveyorLineTaskNum}銆戣澶囩紪鐮侊細銆恵childDeviceCode}銆�";
             ConsoleHelper.WriteSuccessLine(log);
 
-            //_noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
             WriteInfo(conveyorLine.DeviceName, log);
-
 
             var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode);
             if (task != null)
@@ -445,7 +404,6 @@
                     }
                 }
 
-                //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                 bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                 if (sendFlag)
                 {
@@ -571,11 +529,8 @@
                 
                 List<string> strings = platform.Location.Split(',').ToList();
 
-                WriteInfo("璋冨害鎵ц鏃堕棿璁板綍", "銆愯皟鍙朩MS鍑哄簱鎺ュ彛寮�濮嬫椂闂达細銆�" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
-
                 var result = await HttpHelper.PostAsync(wmsIpAddress, new { Position = childDeviceCode, Tag = (int)taskType, AreaCdoe = platform.Stacker, AreaCdoes = strings, platform.ProductionLine }.Serialize());
-
-                WriteInfo("璋冨害鎵ц鏃堕棿璁板綍", "銆愯皟鍙朩MS鍑哄簱鎺ュ彛缁撴潫鏃堕棿锛氥��" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
+                WriteInfo("OCV璇锋眰杩斿洖鍙傛暟", $"鏃堕棿锛氥�恵DateTime.Now}銆戣姹傜偣浣嶃�恵childDeviceCode}銆戣繑鍥炲弬鏁般�恵JsonConvert.SerializeObject(result)}銆�");
 
                 WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
 
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
index 5b511f2..4109752 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -178,16 +178,23 @@
                         IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC);
                         if (device != null)
                         {
-                            CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
-                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(4000), stationinfo.stationChildCode);
-                            Thread.Sleep(100);
-                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
+                            if (device.DeviceCode == "1024" || device.DeviceCode == "1023")
+                            {
+                                CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)device;
+                                conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(4000), stationinfo.stationChildCode);
+                                Thread.Sleep(100);
+                                conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
+                            }
+                            else
+                            {
+                                CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
+                                conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(4000), stationinfo.stationChildCode);
+                                Thread.Sleep(100);
+                                conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
+                            }
                         }
                         WriteInfo(commonStackerCrane.DeviceName, $"銆愭墜鍔ㄥ嚭搴撹褰曘�戜换鍔″彿銆恵e.TaskNum}銆戞墭鐩樺彿銆恵task.PalletCode}銆�");
                     }
-
-
-
 
                     if (commonStackerCrane.DeviceCode.Contains("GW") && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                     {
@@ -281,7 +288,7 @@
                     _noticeService.Logs(userTokenIds, new { commonStackerCrane.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
                     WriteInfo(commonStackerCrane.DeviceName, log);
 
-                    task = FindAnotherOutboundTask(commonStackerCrane.DeviceCode, task.TaskId);
+                    task = FindAnotherOutboundTask(commonStackerCrane.DeviceCode, task);
 
                     if (task == null)
                     {
@@ -319,10 +326,21 @@
                         device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode);
                         if (device != null)
                         {
-                            CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
-                            if (conveyorLine.IsOccupied(task.NextAddress))//鍑哄簱绔欏彴鏈鍗犵敤
+                            if (device.DeviceCode == "1024" || device.DeviceCode == "1023")
                             {
-                                return task;
+                                CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)device;
+                                if (conveyorLine.IsOccupied(task.NextAddress))//鍑哄簱绔欏彴鏈鍗犵敤
+                                {
+                                    return task;
+                                }
+                            }
+                            else
+                            {
+                                CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
+                                if (conveyorLine.IsOccupied(task.NextAddress))//鍑哄簱绔欏彴鏈鍗犵敤
+                                {
+                                    return task;
+                                }
                             }
                         }
                         else
@@ -395,11 +413,11 @@
         /// <param name="deviceCode">璁惧浠g爜</param>
         /// <param name="excludedTaskId">瑕佹帓闄ょ殑浠诲姟ID</param>
         /// <returns></returns>
-        private Dt_Task? FindAnotherOutboundTask(string deviceCode, int excludedTaskId)
+        private Dt_Task? FindAnotherOutboundTask(string deviceCode, Dt_Task task)
         {
             // 鍏堣幏鍙栨墍鏈夌鍚堟潯浠讹紙鎺掗櫎鎸囧畾浠诲姟ID锛夌殑鍑哄簱浠诲姟鍒楄〃
             var allOutboundTasks = _taskService.QueryAllOutboundTasks(deviceCode);
-            var availableTasks = allOutboundTasks?.Where(t => excludedTaskId != t.TaskId && t.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup).ToList();
+            var availableTasks = allOutboundTasks?.Where(t => t.TargetAddress != task.TargetAddress && t.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup).ToList();
 
             if (availableTasks == null || availableTasks.Count == 0)
             {
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs
index 018a456..a7ed647 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob_NewCW/CommonStackerCrane_NewCWJob.cs
@@ -319,10 +319,21 @@
                         device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode);
                         if (device != null)
                         {
-                            CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)device;
-                            if (conveyorLine.IsOccupied(task.NextAddress))//鍑哄簱绔欏彴鏈鍗犵敤
+                            if (device.DeviceCode == "1024" || device.DeviceCode == "1023")
                             {
-                                return task;
+                                CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)device;
+                                if (conveyorLine.IsOccupied(task.NextAddress))//鍑哄簱绔欏彴鏈鍗犵敤
+                                {
+                                    return task;
+                                }
+                            }
+                            else
+                            {
+                                CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
+                                if (conveyorLine.IsOccupied(task.NextAddress))//鍑哄簱绔欏彴鏈鍗犵敤
+                                {
+                                    return task;
+                                }
                             }
                         }
                         else
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db
index b332136..0b8d94c 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
index 23eebad..1346e5a 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-shm
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
index 7fffa2f..bc9bc66 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/CodeChunks.db-wal
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
index 30fe734..250e6e3 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
index 6411793..e17f42e 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-shm
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
index bc0caf3..615c1d6 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
+++ b/Code Management/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1569.27729/SemanticSymbols.db-wal
Binary files differ
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
index d203f3c..bce772b 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -1,4 +1,5 @@
-锘縰sing Mapster;
+锘縰sing AngleSharp.Io;
+using Mapster;
 using Masuit.Tools;
 using SixLabors.Fonts.Tables.AdvancedTypographic;
 using SqlSugar;
@@ -10,6 +11,7 @@
 using WIDESEA_DTO.WMS;
 using WIDESEA_IServices;
 using WIDESEA_IStoragIntegrationServices;
+using WIDESEA_Model.Models;
 using WIDESEAWCS_BasicInfoRepository;
 using WIDESEAWCS_QuartzJob.Models;
 
@@ -1028,6 +1030,8 @@
                 stockInfo.LocationInfo.LocationStatus = (int)LocationEnum.InStockDisable;
                 await _locationRepository.UpdateDataAsync(stockInfo.LocationInfo);
             }
+            if (position == "1670")
+                LogFactory.GetLog($"OCV{position}璇锋眰{productionLine}浠诲姟").Info(true, $"杩斿洖鍙傛暟{JsonConvert.SerializeObject(taskDTO)}");
 
             // 杩斿洖鎴愬姛鍝嶅簲
             return content.OK(data: taskDTO);
@@ -1066,16 +1070,28 @@
 
             var result = new DtStockInfo();
 
-            result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
+            var stockInfoList = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
                             .Includes(x => x.LocationInfo)
-                            .Includes(x => x.StockInfoDetails)
+                            //.Includes(x => x.StockInfoDetails)
                             .Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull)
                             .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
                             .WhereIF(!devices.IsNullOrEmpty(), x => devices.Contains(x.LocationInfo.RoadwayNo))
                             .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable)
-                            .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
+                            //.WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
                             .OrderBy(x => x.OutboundTime)
-                            .FirstAsync();
+                            .ToListAsync();
+            foreach (var stock in stockInfoList)
+            {
+                var hasMatchingDetail = await _stockInfoRepository.Db.Queryable<DtStockInfoDetail>()
+                    .Where(d => d.StockId == stock.Id && materielCodes.Contains(d.MaterielCode))
+                    .AnyAsync();
+
+                if (hasMatchingDetail)
+                {
+                    result = stock;
+                    break;
+                }
+            }
 
             if (result.IsNullOrEmpty())
                 ConsoleHelper.WriteErrorLine($"{area.AreaName}-{productionLine}鏌ヨ瀹炵洏搴撳瓨淇℃伅澶辫触:鏈壘鍒扮鍚堟潯浠剁殑鏁版嵁");
@@ -1123,21 +1139,43 @@
                 .Where(x => x.DeviceCode.Contains("CWSC"))
                 .ToList().Select(x => x.DeviceCode).ToList();
 
+            //var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
+            //    .Where(x => areaCodes.Contains(x.AreaCode) && x.OutboundTime < DateTime.Now && x.IsFull == true) // 杩囨护鏉′欢
+            //    .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
+            //    .Includes(x => x.LocationInfo)
+            //    .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo))
+            //    .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && areaId.Contains(x.LocationInfo.AreaId) && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢
+            //    .Includes(x => x.StockInfoDetails)
+            //    .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
+            //    .OrderBy(x => x.OutboundTime) // 鎺掑簭
+            //    .FirstAsync(); // 鑾峰彇绗竴涓厓绱�
+
+            DtStockInfo stockInfo = null;
             var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
                 .Where(x => areaCodes.Contains(x.AreaCode) && x.OutboundTime < DateTime.Now && x.IsFull == true) // 杩囨护鏉′欢
                 .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
                 .Includes(x => x.LocationInfo)
                 .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo))
                 .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && areaId.Contains(x.LocationInfo.AreaId) && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢
-                .Includes(x => x.StockInfoDetails)
-                .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
                 .OrderBy(x => x.OutboundTime) // 鎺掑簭
-                .FirstAsync(); // 鑾峰彇绗竴涓厓绱�
+                .ToListAsync();
 
-            if (result.IsNullOrEmpty())
+            foreach (var stock in result)
+            {
+                var hasMatchingDetail = await _stockInfoRepository.Db.Queryable<DtStockInfoDetail>()
+                    .Where(d => d.StockId == stock.Id && materielCodes.Contains(d.MaterielCode))
+                    .AnyAsync();
+
+                if (hasMatchingDetail)
+                {
+                    stockInfo = stock;
+                    break;
+                }
+            }
+            if (stockInfo.IsNullOrEmpty())
                 ConsoleHelper.WriteErrorLine($"{JsonConvert.SerializeObject(areaCodes)}-{productionLine}鏌ヨ甯告俯瀹炵洏搴撳瓨淇℃伅澶辫触:鏈壘鍒扮鍚堟潯浠剁殑鏁版嵁");
 
-            return result;
+            return stockInfo;
         }
         catch (Exception ex)
         {
@@ -1166,21 +1204,36 @@
                 .Where(x => stackers.Contains(x.DeviceCode))
                 .ToList().Select(x => x.DeviceCode).ToList();
 
+            DtStockInfo stockInfo = null;
+
             var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
                 .Where(x => x.ProductionLine == station.productLine)
                 .Where(x => x.AreaCode == areaCode && x.IsFull == false)
-                .Includes(x => x.StockInfoDetails)
-                .Where(x => x.StockInfoDetails.Any(y => y.MaterielCode == "绌烘墭鐩�"))
+                //.Includes(x => x.StockInfoDetails)
+                //.Where(x => x.StockInfoDetails.Any(y => y.MaterielCode == "绌烘墭鐩�"))
                 .Includes(x => x.LocationInfo)
                 .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo))
                 .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 杩囨护鏉′欢
                 .OrderBy(x => x.CreateDate) // 鎺掑簭
-                .FirstAsync(); // 杞崲涓哄垪琛�
+                .ToListAsync();
+
+            foreach (var stock in result)
+            {
+                var hasMatchingDetail = await _stockInfoRepository.Db.Queryable<DtStockInfoDetail>()
+                    .Where(d => d.StockId == stock.Id && d.MaterielCode == "绌烘墭鐩�")
+                    .AnyAsync();
+
+                if (hasMatchingDetail)
+                {
+                    stockInfo = stock;
+                    break;
+                }
+            }
 
             if (result.IsNullOrEmpty())
                 ConsoleHelper.WriteErrorLine($"{area}-{station.productLine}鏌ヨ绌虹洏搴撳瓨淇℃伅澶辫触:鏈壘鍒扮鍚堟潯浠剁殑鏁版嵁");
 
-            return result;
+            return stockInfo;
         }
         catch (Exception ex)
         {
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_LogController.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_LogController.cs
index 633a59c..52d89c7 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_LogController.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/System/Sys_LogController.cs
@@ -21,7 +21,7 @@
                 {
                     if (firstDirectoryInfos[i].Name != "Info")
                     {
-                        FileInfo[] nextFileInfos = firstDirectoryInfos[i].GetFiles();
+                        FileInfo[] nextFileInfos = firstDirectoryInfos[i].GetFiles().OrderByDescending(x => x.CreationTime).ToArray();
                         List<object> values = new List<object>();
                         for (int j = 0; j < nextFileInfos.Length; j++)
                         {
@@ -48,10 +48,10 @@
             {
                 List<FileInfo> files = new List<FileInfo>();
                 DirectoryInfo folder = new DirectoryInfo(AppContext.BaseDirectory + "\\Logs\\");
-                DirectoryInfo[] firstDirectoryInfos = folder.GetDirectories();
+                DirectoryInfo[] firstDirectoryInfos = folder.GetDirectories().OrderByDescending(x => x.CreationTime).ToArray();
                 for (int i = 0; i < firstDirectoryInfos.Length; i++)
                 {
-                    FileInfo[] nextFileInfos = firstDirectoryInfos[i].GetFiles();
+                    FileInfo[] nextFileInfos = firstDirectoryInfos[i].GetFiles().OrderByDescending(x => x.CreationTime).ToArray();
                     files.AddRange(nextFileInfos);
                 }
                 if (files.Count > 0)

--
Gitblit v1.9.3