From 9b567a8304c3d202ddd1f716cb63c2a4535b6417 Mon Sep 17 00:00:00 2001
From: 肖洋 <cathay_xy@163.com>
Date: 星期一, 09 十二月 2024 22:47:06 +0800
Subject: [PATCH] 高温出库堆垛机完成给线体写入托盘号

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
index a92dfca..4ea6b5c 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
@@ -14,6 +14,7 @@
 using HslCommunication;
 using WIDESEAWCS_DTO.WMS;
 using WIDESEAWCS_Common;
+using Masuit.Tools;
 
 namespace WIDESEAWCS_Tasks
 {
@@ -157,17 +158,17 @@
                     ConveyorLineOutFinish(conveyorLine, command, childDeviceCode);
                     break;
                 case 6:
-                    CreateAndSendEmptyTrayTask(conveyorLine,command, childDeviceCode);
+                    CreateAndSendEmptyTrayTask(conveyorLine, command, childDeviceCode);
                     break;
                 case 1:
-                    if (stationManager.stationArea.Contains("GW"))
-                    {
-                        var taskGW = _taskRepository.QueryFirst(x => x.TargetAddress == childDeviceCode && (x.TaskState == (int)TaskOutStatusEnum.OutFinish|| x.TaskState == (int)TaskOutStatusEnum.OutPending));
-                        if (taskGW != null)
-                        {
-                            command.ConveyorLineBarcode = taskGW.PalletCode;
-                        }
-                    }
+                    //if (stationManager.stationArea.Contains("GW"))
+                    //{
+                    //    var taskGW = _taskRepository.QueryFirst(x => x.TargetAddress == childDeviceCode && (x.TaskState == (int)TaskOutStatusEnum.OutFinish || x.TaskState == (int)TaskOutStatusEnum.OutPending));
+                    //    if (taskGW != null)
+                    //    {
+                    //        command.ConveyorLineBarcode = taskGW.PalletCode;
+                    //    }
+                    //}
                     RequestWmsTask(conveyorLine, command, childDeviceCode);
                     break;
             }
@@ -281,9 +282,10 @@
         /// </summary>
         private async void RequestWmsTask(CommonConveyorLine_GW conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
         {
-            var taskGW = _taskRepository.QueryFirst(x => x.TargetAddress == childDeviceCode && (x.TaskState == (int)TaskOutStatusEnum.OutFinish || x.TaskState == (int)TaskOutStatusEnum.OutPending));
-            if (taskGW != null)
-                _taskRepository.DeleteData(taskGW);
+            //var taskGW = _taskRepository.QueryFirst(x => x.TargetAddress == childDeviceCode && (x.TaskState == (int)TaskOutStatusEnum.OutFinish || x.TaskState == (int)TaskOutStatusEnum.OutPending));
+            //if (taskGW != null)
+            //    _taskRepository.DeleteData(taskGW);
+            if (command.ConveyorLineBarcode.IsNullOrEmpty()) return;
             var content = await _taskService.RequestWMSTask(command.ConveyorLineBarcode, childDeviceCode);
             if (content.Status)
             {
@@ -303,7 +305,8 @@
             else
             {
                 WriteInfo(conveyorLine.DeviceName, content.Message);
-                _taskRepository.AddData(taskGW);
+                ConsoleHelper.WriteErrorLine($"銆恵conveyorLine.DeviceName}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戣姹傜偣浣嶏細銆恵childDeviceCode}銆戝紓甯镐俊鎭�恵content.Message}銆�");
+                //_taskRepository.AddData(taskGW);
             }
         }
     }

--
Gitblit v1.9.3