From 9190b1eabf080af4e0d4d76d6e4ef127a12b1074 Mon Sep 17 00:00:00 2001
From: 肖洋 <cathay_xy@163.com>
Date: 星期二, 10 十二月 2024 15:44:29 +0800
Subject: [PATCH] 12312312

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs  |    6 +++---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/ProcessParameters/Platform.cs      |   10 ++++++++++
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs         |   11 ++++++-----
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs        |    2 +-
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs            |    2 +-
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/RequestTaskDto.cs                        |    2 +-
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs |    2 +-
 7 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/ProcessParameters/Platform.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/ProcessParameters/Platform.cs
index 7055892..a4ebcc0 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/ProcessParameters/Platform.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/ProcessParameters/Platform.cs
@@ -90,5 +90,15 @@
         [ExporterHeader(DisplayName = "绔欏彴鐘舵��")]
         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "绔欏彴鐘舵��")]
         public string Status { get; set; } = "Active";
+
+
+        /// <summary>
+        /// 鐢熶骇浜х嚎
+        /// </summary>
+        [ImporterHeader(Name = "鐢熶骇浜х嚎")]
+        [ExporterHeader(DisplayName = "鐢熶骇浜х嚎")]
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鐢熶骇浜х嚎")]
+        public string ProductionLine { get; set; }
+        
     }
 }
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
index 3d35a4a..ade5a33 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -417,7 +417,7 @@
                     taskOutboundTypeEnum = TaskOutboundTypeEnum.OutTray;
                 else
                     taskOutboundTypeEnum = TaskOutboundTypeEnum.Outbound;
-                await CheckAndCreateTask(taskOutboundTypeEnum, childDeviceCode, index, platform.Stacker);
+                await CheckAndCreateTask(taskOutboundTypeEnum, childDeviceCode, index, platform.Stacker, platform);
             }
             catch (Exception)
             {
@@ -427,7 +427,7 @@
         /// <summary>
         /// 妫�鏌ヤ换鍔″苟鍒涘缓鏂颁换鍔�
         /// </summary>
-        private async Task CheckAndCreateTask(TaskOutboundTypeEnum taskType, string childDeviceCode, int index, string roadWay, List<string> roadways = null)
+        private async Task CheckAndCreateTask(TaskOutboundTypeEnum taskType, string childDeviceCode, int index, string roadWay, Platform platform)
         {
             var tasks = _taskRepository.QueryData(x => x.TaskType == (int)taskType && x.TargetAddress == childDeviceCode);
             if (tasks.Count < index)
@@ -448,7 +448,7 @@
                 var wmsIpAddress = wmsBase + requestTrayOutTask;
 
 
-                var result = await HttpHelper.PostAsync(wmsIpAddress, new { position = childDeviceCode, tag = (int)taskType, areaCdoe = roadWay, roadways = roadways }.ToJsonString());
+                var result = await HttpHelper.PostAsync(wmsIpAddress, new { position = childDeviceCode, tag = (int)taskType, areaCdoe = roadWay, platform.ProductionLine }.ToJsonString());
                 //var result = await HttpHelper.PostAsync("http://localhost:5000/api/Task/RequestTrayOutTaskAsync", dynamic.ToJsonString());
 
                 WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/RequestTaskDto.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/RequestTaskDto.cs
index 49ce3ee..9b90299 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/RequestTaskDto.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/RequestTaskDto.cs
@@ -34,5 +34,5 @@
     public string Position { get; set; }
     public int Tag { get; set; }
     public string AreaCdoe { get; set; }
-    public List<string> Roadways { get; set; }
+    public string ProductionLine { get; set; }
 }
\ No newline at end of file
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs
index 2b4bd9a..ade833c 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs
@@ -165,7 +165,7 @@
     /// <param name="areaCode">鍖哄煙缂栫爜</param>
     /// <param name="roadways">宸烽亾鍒楄〃</param>
     /// <returns>杩斿洖缁撴灉闆�</returns>
-    Task<WebResponseContent> RequestTrayOutTaskAsync(string position, int tag, string areaCode, List<string> roadways);
+    Task<WebResponseContent> RequestTrayOutTaskAsync(string position, int tag, string areaCode, string productionLine);
 
 
     /// <summary>
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 e8a35a4..9e9e3ef 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
@@ -978,15 +978,15 @@
     /// <param name="areaCode">鍖哄煙缂栫爜</param>
     /// <param name="roadways">宸烽亾缂栫爜闆嗗悎</param>
     /// <returns>杩斿洖缁撴灉闆�</returns>
-    public async Task<WebResponseContent> RequestTrayOutTaskAsync(string position, int tag, string areaCode, List<string> roadways)
+    public async Task<WebResponseContent> RequestTrayOutTaskAsync(string position, int tag, string areaCode, string productionLine)
     {
         WebResponseContent content = new WebResponseContent();
         try
         {
             // 鏍规嵁鎵樼洏绫诲瀷鏌ヨ搴撳瓨淇℃伅
             DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound
-                ? QueryStockInfoForRealTrayAsync(areaCode, roadways).Result
-                : QueryStockInfoForEmptyTrayAsync(areaCode, roadways).Result;
+                ? QueryStockInfoForRealTrayAsync(areaCode, productionLine).Result
+                : QueryStockInfoForEmptyTrayAsync(areaCode).Result;
 
             if (stockInfo == null)
             {
@@ -1033,7 +1033,7 @@
     /// <summary>
     /// 鏌ヨ瀹炵洏搴撳瓨淇℃伅
     /// </summary>
-    private async Task<DtStockInfo> QueryStockInfoForRealTrayAsync(string areaCode, List<string> roadways)
+    private async Task<DtStockInfo> QueryStockInfoForRealTrayAsync(string areaCode, string productionLine)
     {
         var area = await _areaInfoRepository.QueryFirstAsync(x => x.AreaCode == areaCode);
 
@@ -1041,6 +1041,7 @@
             .Includes(x => x.LocationInfo) // 棰勫姞杞絃ocationInfo
             .Includes(x => x.StockInfoDetails) // 棰勫姞杞絊tockInfoDetails
             .Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull == true) // 杩囨护鏉′欢
+            .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
             .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 杩囨护鏉′欢
             .OrderBy(x => x.OutboundTime) // 鎺掑簭
             .FirstAsync(); // 鑾峰彇绗竴涓厓绱�
@@ -1054,7 +1055,7 @@
     /// <summary>
     /// 鏌ヨ绌虹洏搴撳瓨淇℃伅
     /// </summary>
-    private async Task<DtStockInfo> QueryStockInfoForEmptyTrayAsync(string areaCode, List<string> roadways)
+    private async Task<DtStockInfo> QueryStockInfoForEmptyTrayAsync(string areaCode)
     {
         var area = await _areaInfoRepository.QueryFirstAsync(x => x.AreaCode == areaCode);
 
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
index 37693a9..a4c8c40 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -993,7 +993,7 @@
 
                 var location = locations.OrderBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).FirstOrDefault();
 
-                var stockInfo = await QueryStockInfoForEmptyTrayAsync("CWSC1", new List<string>());
+                var stockInfo = await QueryStockInfoForEmptyTrayAsync("CWSC1");
 
                 if (stockInfo != null)
                 {
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs
index 1eaba1b..8aee765 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskController.cs
@@ -108,7 +108,7 @@
     [HttpPost, AllowAnonymous, Route("RequestTrayOutTaskAsync")]
     public async Task<WebResponseContent> RequestTrayOutTaskAsync([FromBody] RequestOutTaskDto request)
     {
-        return await Service.RequestTrayOutTaskAsync(request.Position, request.Tag, request.AreaCdoe, request.Roadways);
+        return await Service.RequestTrayOutTaskAsync(request.Position, request.Tag, request.AreaCdoe, request.ProductionLine);
     }
 
     /// <summary>

--
Gitblit v1.9.3