wanshenmean
2026-03-18 2ef99428f9be29ec299029782edb97baef88e126
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;
@@ -81,6 +81,15 @@
                        {
                            ConveyorLineTaskCommandNew command = conveyorLine.ReadCustomer<ConveyorLineTaskCommandNew>(childDeviceCode);
                            if (command == null)
                            {
                                return;
                            }
                            if(command.WCS_ACK == 1)
                                conveyorLine.SetValue(ConveyorLineDBNameNew.WCS_ACK, 0, childDeviceCode);
                            #region 检查特定位置是否有托盘
                            var checkPalletPositions = App.Configuration.GetSection("CheckPalletPositions")
@@ -112,12 +121,9 @@
                            #endregion
                            if (command == null || command.PLC_STB != 1)
                            {
                                return;
                            }
                            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);
@@ -127,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)
@@ -166,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;
            // 处理状态逻辑
@@ -196,4 +202,4 @@
            }
        }
    }
}
}