From 6e380a6002fb7675f8795d8c223801cf6ec67347 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <1247017146@qq.com>
Date: 星期三, 26 三月 2025 09:22:21 +0800
Subject: [PATCH] 修改化成实框与空框去静置逻辑

---
 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 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 8a99dbb..914c7c6 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;
@@ -388,7 +390,6 @@
             #endregion
         }
 
-
         /// <summary>
         /// 鎴愬寲鍏ラ潤缃�
         /// </summary>
@@ -419,7 +420,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)
@@ -433,13 +434,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)
                 {
@@ -470,12 +471,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
                 {
@@ -519,6 +527,11 @@
                     }
                     else
                     {
+                        var Task = await _taskService.RequestWMSTask(command.Barcode, childDeviceCode);
+                        if (Task.Status)
+                        {
+                            ExecuteConveyorLineTask(conveyorLine, command, ProtocalDetailValue, childDeviceCode);
+                        }
                         ConsoleHelper.WriteWarningLine("浜屽皝缂撳瓨浣嶅凡婊�");
                         return;
                     }
@@ -537,7 +550,7 @@
                 {
                     conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, "1000", childDeviceCode);
 
-                    var log = $"銆恵conveyorLine._deviceName}銆戜换鍔″彿锛氥�恵task.TaskNum}銆�,鎵樼洏鏉$爜锛氥�恵task.PalletCode}銆戝凡鍒拌揪銆恵childDeviceCode}銆戣姹傛壂鐮佸叆搴�(瀹炵洏),涓嬩竴鐩爣鍦板潃銆恵1000}銆�";
+                    var log = $"銆恵conveyorLine._deviceName}銆戜换鍔″彿锛氥�恵task.TaskNum}銆�,鎵樼洏鏉$爜锛氥�恵task.PalletCode}銆戝凡鍒拌揪銆恵childDeviceCode}銆戣姹傛壂鐮佸叆搴�(瀹炵洏or绌虹洏),涓嬩竴鐩爣鍦板潃銆恵1000}銆�";
                     ConsoleHelper.WriteWarningLine(log);
 
                     _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });

--
Gitblit v1.9.3