wanshenmean
7 天以前 37acb8358f5602a9013ee29c04a45e33483c2329
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())
                            {
                                // 查询正在执行的任务
                                Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNo, childDeviceCode);