From b2feeabc23454a2c9e161aa3b26d0edf938e55bd Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期二, 22 七月 2025 15:03:17 +0800
Subject: [PATCH] 增加超时设置,更新依赖注入和查询逻辑

---
 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile1.pubxml.user                                    |    2 +-
 CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/PublishProfiles/FolderProfile5.pubxml.user                                    |    2 +-
 CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs                                                         |   12 ++++++++++--
 CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_StoragIntegrationRepository.AssemblyInfo.cs   |    2 +-
 CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_IStoragIntegrationRepository.AssemblyInfo.cs |    2 +-
 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs                                                                       |    2 +-
 CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs                                                 |    8 ++++++++
 7 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs
index 91f38e6..f226d5e 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/HttpHelper.cs
@@ -82,7 +82,7 @@
                 {
                     httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                     using HttpClient httpClient = new HttpClient();
-                    httpClient.Timeout = new TimeSpan(0, 0, 60);
+                    httpClient.Timeout = new TimeSpan(0, 0, 120);
 
                     if (headers != null)
                     {
diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile1.pubxml.user b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile1.pubxml.user
index fccb5e1..1ca03de 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile1.pubxml.user
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile1.pubxml.user
@@ -5,7 +5,7 @@
 <Project>
   <PropertyGroup>
     <_PublishTargetUrl>E:\GET\BaiBuSanLouNew\CodeManagement\WCS\WIDESEAWCS_Server\WIDESEAWCS_Server\bin\Release\net6.0\publish\</_PublishTargetUrl>
-    <History>True|2025-07-17T06:23:12.9364562Z||;True|2025-07-17T08:22:09.8047880+02:00||;True|2025-07-16T10:00:37.8280989+02:00||;True|2025-07-15T04:52:26.8635009+02:00||;True|2025-07-10T09:32:24.9502583+02:00||;True|2025-07-10T09:27:10.5295296+02:00||;True|2025-06-25T09:55:01.4687124+02:00||;True|2025-06-13T08:06:02.3387675+02:00||;True|2025-06-13T06:12:05.8571668+02:00||;True|2025-06-13T05:07:21.0883921+02:00||;True|2025-06-13T04:58:41.4512589+02:00||;True|2025-06-12T10:02:45.3477017+02:00||;True|2025-06-06T03:30:09.4409029+02:00||;True|2025-06-05T08:22:11.1558952+02:00||;True|2025-06-05T08:21:15.0801810+02:00||;</History>
+    <History>True|2025-07-22T06:47:26.2951049Z||;True|2025-07-22T14:45:26.2487877+08:00||;True|2025-07-17T14:23:12.9364562+08:00||;True|2025-07-17T14:22:09.8047880+08:00||;True|2025-07-16T16:00:37.8280989+08:00||;True|2025-07-15T10:52:26.8635009+08:00||;True|2025-07-10T15:32:24.9502583+08:00||;True|2025-07-10T15:27:10.5295296+08:00||;True|2025-06-25T15:55:01.4687124+08:00||;True|2025-06-13T14:06:02.3387675+08:00||;True|2025-06-13T12:12:05.8571668+08:00||;True|2025-06-13T11:07:21.0883921+08:00||;True|2025-06-13T10:58:41.4512589+08:00||;True|2025-06-12T16:02:45.3477017+08:00||;True|2025-06-06T09:30:09.4409029+08:00||;True|2025-06-05T14:22:11.1558952+08:00||;True|2025-06-05T14:21:15.0801810+08:00||;</History>
     <LastFailureDetails />
   </PropertyGroup>
 </Project>
\ No newline at end of file
diff --git a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_IStoragIntegrationRepository.AssemblyInfo.cs b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_IStoragIntegrationRepository.AssemblyInfo.cs
index b9818b0..0207c08 100644
--- a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_IStoragIntegrationRepository.AssemblyInfo.cs
+++ b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_IStoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_IStoragIntegrationRepository.AssemblyInfo.cs
@@ -14,7 +14,7 @@
 [assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEA_IStoragIntegrationRepository")]
 [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
 [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b06b33248bcc19f8ea6c574124d5c536b7fa6c49")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f1cad31b8247a57699c34067cfc0cd31cf0a91c8")]
 [assembly: System.Reflection.AssemblyProductAttribute("WIDESEA_IStoragIntegrationRepository")]
 [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEA_IStoragIntegrationRepository")]
 [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_StoragIntegrationRepository.AssemblyInfo.cs b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_StoragIntegrationRepository.AssemblyInfo.cs
index 4f90248..c5f47b8 100644
--- a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_StoragIntegrationRepository.AssemblyInfo.cs
+++ b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationRepository/obj/Debug/net6.0/WIDESEA_StoragIntegrationRepository.AssemblyInfo.cs
@@ -14,7 +14,7 @@
 [assembly: System.Reflection.AssemblyCompanyAttribute("WIDESEA_StoragIntegrationRepository")]
 [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
 [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b06b33248bcc19f8ea6c574124d5c536b7fa6c49")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f1cad31b8247a57699c34067cfc0cd31cf0a91c8")]
 [assembly: System.Reflection.AssemblyProductAttribute("WIDESEA_StoragIntegrationRepository")]
 [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEA_StoragIntegrationRepository")]
 [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
index 17fb6a1..c346b05 100644
--- a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
+++ b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -13,6 +13,7 @@
 using WIDESEA_IServices;
 using WIDESEA_IStoragIntegrationServices;
 using WIDESEA_Model.Models;
+using WIDESEA_Repository;
 using WIDESEAWCS_BasicInfoRepository;
 using WIDESEAWCS_QuartzJob.Models;
 
@@ -36,6 +37,7 @@
     private readonly IAgingInOrOutInputService _agingInOrOutInputService; //闈欑疆\闄堝寲
     private readonly IDt_StationManagerRepository _stationManagerRepository;
     private readonly ISys_ConfigService _configService;
+    private readonly IDt_ChangeoversRepository _dt_ChangeoversRepository;
     private readonly ISimpleCacheService _simpleCacheService;
 
     public Dt_TaskService(IDt_TaskRepository BaseDal,
@@ -55,6 +57,7 @@
                                 IStockInfoDetailRepository stockInfoDetailRepository,
                                 IDt_StationManagerRepository stationManagerRepository,
                                 ISys_ConfigService configService,
+                                IDt_ChangeoversRepository dt_ChangeoversRepository,
                                 ISimpleCacheService simpleCacheService) : base(BaseDal)
     {
         _unitOfWorkManage = unitOfWorkManage;
@@ -72,6 +75,7 @@
         _stockInfoDetailRepository = stockInfoDetailRepository;
         _stationManagerRepository = stationManagerRepository;
         _configService = configService;
+        _dt_ChangeoversRepository = dt_ChangeoversRepository;
         _simpleCacheService = simpleCacheService;
     }
 
@@ -983,7 +987,9 @@
                 return null;
             }
 
-            var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel");
+            //var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel");
+
+            var outBoundMateriel = _dt_ChangeoversRepository.QueryData(x => x.Status == "1").ToList();
             List<string>? materielCodes = outBoundMateriel.Count != 0
                 ? outBoundMateriel.Where(x => x.ProductionLine == productionLine && x.ProcessCode == area.AreaCode)
                                   .Select(x => x.MaterielCode)
@@ -1036,7 +1042,9 @@
             //    materielCodes = outBoundMateriel.Where(x => x.ProductionLine == productionLine && x.ProcessCode == areaCodes[0]).Select(x => x.MaterielCode).ToList();
             //}
 
-            var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel");
+            //var outBoundMateriel = AppSettings.app<OutBoundMateriel>("OutBoundMateriel");
+
+            var outBoundMateriel = _dt_ChangeoversRepository.QueryData(x => x.Status == "1").ToList();
             List<string>? materielCodes = outBoundMateriel.Count != 0
                 ? outBoundMateriel.Where(x => x.ProductionLine == productionLine && x.ProcessCode == areaCodes[0])
                                   .Select(x => x.MaterielCode)
diff --git a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
index cf25ea1..01591d9 100644
--- a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
+++ b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -1051,6 +1051,13 @@
                 .Where(x => x.DeviceCode.Contains("CWSC")) // 杩囨护鏉′欢
                 .ToList().Select(x => x.DeviceCode).ToList();
 
+            var outBoundMateriel = _dt_ChangeoversRepository.QueryData(x => x.Status == "1").ToList();
+            List<string>? materielCodes = outBoundMateriel.Count != 0
+                ? outBoundMateriel.Where(x => x.ProductionLine == station.productLine && x.ProcessCode == "CWSC3")
+                                  .Select(x => x.MaterielCode)
+                                  .ToList()
+                : null;
+
             // 淇敼鍚庣殑鏌ヨ浠g爜
             var stockInfo = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
                                 .Includes(x => x.LocationInfo)
@@ -1061,6 +1068,7 @@
                                 .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock)
                                 // 澧炲姞瀵� LocationInfo 鐨勭┖鍊兼鏌�
                                 .WhereIF(!deviceCode.IsNullOrEmpty(), x => deviceCode.Contains(x.LocationInfo.RoadwayNo))
+                                .WhereIF(!materielCodes.IsNullOrEmpty(), x => x.StockInfoDetails.Any(y => materielCodes.Contains(y.MaterielCode)))
                                 .OrderBy(x => x.OutboundTime)
                                 .FirstAsync();
 
diff --git a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/PublishProfiles/FolderProfile5.pubxml.user b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/PublishProfiles/FolderProfile5.pubxml.user
index 858728d..fff9353 100644
--- a/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/PublishProfiles/FolderProfile5.pubxml.user
+++ b/CodeManagement/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/PublishProfiles/FolderProfile5.pubxml.user
@@ -3,7 +3,7 @@
 <Project>
   <PropertyGroup>
     <_PublishTargetUrl>E:\GET\BaiBuSanLouNew\CodeManagement\WMS\WIDESEA_WMSServer\WIDESEA_WMSServer\bin\Release\net6.0\publish\</_PublishTargetUrl>
-    <History>True|2025-07-17T06:59:27.7642425Z||;True|2025-07-17T08:42:25.7094059+02:00||;True|2025-07-17T08:31:28.4223230+02:00||;True|2025-07-17T08:23:34.2161924+02:00||;False|2025-07-17T08:21:22.7383057+02:00||;True|2025-07-10T09:25:14.5049507+02:00||;True|2025-06-12T08:58:26.2553540+02:00||;True|2025-06-10T11:37:57.0574377+02:00||;True|2025-06-10T06:47:36.7861916+02:00||;True|2025-06-10T06:27:18.6019205+02:00||;</History>
+    <History>True|2025-07-22T06:41:06.3096345Z||;True|2025-07-22T14:32:13.4421620+08:00||;True|2025-07-17T14:59:27.7642425+08:00||;True|2025-07-17T14:42:25.7094059+08:00||;True|2025-07-17T14:31:28.4223230+08:00||;True|2025-07-17T14:23:34.2161924+08:00||;False|2025-07-17T14:21:22.7383057+08:00||;True|2025-07-10T15:25:14.5049507+08:00||;True|2025-06-12T14:58:26.2553540+08:00||;True|2025-06-10T17:37:57.0574377+08:00||;True|2025-06-10T12:47:36.7861916+08:00||;True|2025-06-10T12:27:18.6019205+08:00||;</History>
     <LastFailureDetails />
   </PropertyGroup>
 </Project>
\ No newline at end of file

--
Gitblit v1.9.3