From 2ef99428f9be29ec299029782edb97baef88e126 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 18 三月 2026 14:19:20 +0800
Subject: [PATCH] feat: 完成WCS/WMS任务链路与设备调度改造

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
index 729e360..d71d17d 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
@@ -17,7 +17,7 @@
 
 #endregion << 鐗� 鏈� 娉� 閲� >>
 
-using AutoMapper;
+using MapsterMapper;
 using Microsoft.Extensions.Configuration;
 using Quartz;
 using SqlSugar;
@@ -87,6 +87,9 @@
                                 return;
                             }
 
+                            if(command.WCS_ACK == 1)
+                                conveyorLine.SetValue(ConveyorLineDBNameNew.WCS_ACK, 0, childDeviceCode);
+
                             #region 妫�鏌ョ壒瀹氫綅缃槸鍚︽湁鎵樼洏
 
                             var checkPalletPositions = App.Configuration.GetSection("CheckPalletPositions")
@@ -120,7 +123,7 @@
 
                             if (command.PLC_STB != 1) return;//PLC_STB=1鏃舵墠澶勭悊浠诲姟
 
-                            if (command.Barcode.IsNullOrEmpty())
+                            if (command.Barcode.IsNullOrEmpty() || command.Barcode.Replace("\0", "") == "")
                             {
                                 //鏃犳墭鐩樺彿鏃�
                                 _conveyorLineDispatch.RequestOutbound(conveyorLine, command, childDeviceCode);
@@ -130,14 +133,14 @@
                             if (command.TaskNo > 0)
                             {
                                 Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNo, childDeviceCode);
-                                if (task.IsNullOrEmpty())
+                                if (!task.IsNullOrEmpty())
                                 {
-                                    _conveyorLineDispatch.RequestInbound(conveyorLine, command, childDeviceCode);
+                                    // 澶勭悊浠诲姟鐘舵��
+                                    ProcessTaskState(conveyorLine, command, task, childDeviceCode);
+                                    //_conveyorLineDispatch.RequestInbound(conveyorLine, command, childDeviceCode);
                                     return;
                                 }
 
-                                // 澶勭悊浠诲姟鐘舵��
-                                ProcessTaskState(conveyorLine, command, task, childDeviceCode);
                             }
                         }
                         catch (Exception innerEx)
@@ -169,7 +172,7 @@
             const int InFinish = (int)TaskInStatusEnum.InFinish;
             const int OutFinish = (int)TaskOutStatusEnum.OutFinish;
 
-            int state = task.TaskState;
+            int state = task.TaskStatus;
             bool isTargetAddress = task.TargetAddress == childDeviceCode;
 
             // 澶勭悊鐘舵�侀�昏緫
@@ -199,4 +202,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}

--
Gitblit v1.9.3