From 2cc749ec598c39f9172f9b989979f6218ec256b1 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <1247017146@qq.com>
Date: 星期四, 27 三月 2025 11:06:24 +0800
Subject: [PATCH] 1

---
 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs |   34 ++++++++++++++++++++++++++--------
 1 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
index 01d61c4..3b8909c 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
@@ -1,6 +1,8 @@
 锘縰sing HslCommunication;
 using Mapster;
 using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
+using Microsoft.CodeAnalysis;
+using Microsoft.VisualBasic;
 using Newtonsoft.Json;
 using System.Text.RegularExpressions;
 using System.Threading.Tasks;
@@ -171,7 +173,7 @@
                         RoadWay = childDeviceCode,
                         SourceAddress = childDeviceCode,
                         TargetAddress = isTrue,
-                        TaskState = (int)TaskOutStatusEnum.OutNew,
+                        TaskState = (int)TaskOutStatusEnum.SC_OutFinish,
                         Id = 0,
                         TaskType = (int)TaskOutboundTypeEnum.TrayInToOut,
                         ProductionLine = result.ProductionLine,
@@ -400,7 +402,6 @@
             #endregion
         }
 
-
         /// <summary>
         /// 鎴愬寲鍏ラ潤缃�
         /// </summary>
@@ -413,7 +414,12 @@
         /// <exception cref="InvalidOperationException"></exception>
         private async Task JZRequestInBound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue, Dt_StationManager stationManager)
         {
+
+            ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
+
             ResultTrayCellsStatus resultTrayCellsStatus = GetResultTrayCellsStatus(command, stationManager);
+
+
             //todo鍒ゆ柇鏄惁涓虹┖妗�
             var serialNosError = resultTrayCellsStatus.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList();
             if (serialNosError.Count > 0)
@@ -431,7 +437,7 @@
                 ConsoleHelper.WriteSuccessLine($"MOM鏁版嵁寮傚父,閫佽嚦浜屽皝銆恵resultTrayCellsStatus.ProductionLine}銆戝紓甯稿彛銆恵Convert.ToInt32(platform.Capacity)}銆�");
                 return;
             }
-            if (resultTrayCellsStatus.SerialNos.Count < 0)
+            if (resultTrayCellsStatus.SerialNos.Count == 0)
             {
                 var Traycontent = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode);
                 if (Traycontent.Status)
@@ -445,13 +451,13 @@
             {
                 var configz = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
                 var wmsbase = configz.Where(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE).FirstOrDefault()?.ConfigValue;
-                var address = configz.Where(x => x.ConfigKey == SysConfigKeyConst.GetJZStockInfo).FirstOrDefault()?.ConfigValue;
+                var address = configz.Where(x => x.ConfigKey == SysConfigKeyConst.QueryStockInfoForRealTrayJZAsync).FirstOrDefault()?.ConfigValue;
                 if (wmsbase == null || address == null)
                 {
                     throw new InvalidOperationException("WMS IP 鏈厤缃�");
                 }
                 var wmsIpAddrss = wmsbase + address;
-                var result = await HttpHelper.PostAsync(wmsIpAddrss);
+                var result = await HttpHelper.PostAsync(wmsIpAddrss, new { ProductLine = resultTrayCellsStatus.ProductionLine }.ToJsonString());
                 var StockInfocontent = JsonConvert.DeserializeObject<WebResponseContent>(result);
                 if (StockInfocontent.Status)
                 {
@@ -482,12 +488,19 @@
                         }
                         else
                         {
-                            ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
+                            var Task = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode);
+                            if (Task.Status)
+                            {
+                                ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
+                            }
                             return;
                         }
                     }
                     else
+                    {
                         WriteInfo(conveyorLine.DeviceName, Taskcontent.Message);
+                        return;
+                    }
                 }
                 else
                 {
@@ -531,6 +544,11 @@
                     }
                     else
                     {
+                        var Task = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode);
+                        if (Task.Status)
+                        {
+                            ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
+                        }
                         ConsoleHelper.WriteWarningLine("浜屽皝缂撳瓨浣嶅凡婊�");
                         return;
                     }
@@ -538,7 +556,7 @@
                 }
             }
         }
-
+        #region
         //public void ExecuteConveyorLineTask(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, int ProtocalDetailValue ,string childDeviceCode)
         //{
         //    var task = _taskService.QueryBarCodeConveyorLineTask(command.Barcode, childDeviceCode);
@@ -595,7 +613,7 @@
         //        }
         //    }
         //}
-
+        #endregion
         /// <summary>
         /// 鎵ц杈撻�佺嚎浠诲姟
         /// </summary>

--
Gitblit v1.9.3