From 37acb8358f5602a9013ee29c04a45e33483c2329 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 09 四月 2026 15:21:40 +0800
Subject: [PATCH] fix: 修复PLC字符串解析和任务处理逻辑

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
index d4d915d..3c5271a 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
@@ -4,6 +4,7 @@
 using Newtonsoft.Json;
 using Quartz;
 using SqlSugar;
+using System.Text;
 using System.Text.Json;
 using WIDESEA_Core;
 using WIDESEAWCS_Common.TaskEnum;
@@ -157,7 +158,7 @@
                             {
                                 _logger.LogDebug("Execute锛氬瓙璁惧 {ChildDeviceCode} 鍛戒护涓虹┖锛岃烦杩�", childDeviceCode);
                                 QuartzLogger.Debug($"瀛愯澶� {childDeviceCode} 鍛戒护涓虹┖锛岃烦杩�", conveyorLine.DeviceCode);
-                                return Task.CompletedTask;
+                                continue;
                             }
 
                             // 濡傛灉 WCS_ACK 涓� 1锛屽厛娓呴櫎锛堣〃绀哄鐞嗚繃涓婁竴娆¤姹傦級
@@ -173,7 +174,7 @@
                             if (checkPalletPositions.Any(x => x.Code == childDeviceCode))
                             {
                                 // 妫�鏌ヨ緭閫佺嚎鐘舵�侊紙鏄惁鏈夋墭鐩橈級
-                                if (command.CV_State == 1)
+                                if (command.CV_State == 2)
                                 {
                                     // 妫�鏌ヨ浣嶇疆鏄惁宸叉湁浠诲姟
                                     var existingTask = _taskService.Db.Queryable<Dt_Task>().First(x => x.TargetAddress == childDeviceCode);
@@ -206,8 +207,6 @@
                             // 鍙湁褰� PLC_STB 涓� 1 鏃舵墠澶勭悊浠诲姟
                             if (command.PLC_STB != 1)
                             {
-                                //_logger.LogDebug("Execute锛氬瓙璁惧 {ChildDeviceCode} PLC_STB 涓嶄负1锛岃烦杩�", childDeviceCode);
-                                //QuartzLogger.Debug($"瀛愯澶� {childDeviceCode} PLC_STB 涓嶄负1锛岃烦杩�", conveyorLine.DeviceCode);
                                 return Task.CompletedTask;
                             }
 
@@ -222,7 +221,7 @@
                             }
 
                             // ========== 澶勭悊宸叉湁浠诲姟鍙风殑鎯呭喌 ==========
-                            if (command.TaskNo > 0)
+                            if (command.TaskNo > 0 && !command.Barcode.IsNullOrEmpty())
                             {
                                 // 鏌ヨ姝e湪鎵ц鐨勪换鍔�
                                 Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNo, childDeviceCode);

--
Gitblit v1.9.3