wanshenmean
3 天以前 7278264f027d62664a0209699d0f66a22fd06a8e
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
@@ -14,6 +14,7 @@
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.Service;
using ManualInboundTaskHandler = WIDESEAWCS_Tasks.ConveyorLineNewJob.ManualInbound.ManualInboundTaskHandler;
namespace WIDESEAWCS_Tasks
{
@@ -166,6 +167,7 @@
                                continue;
                            }
                            #region 检测是否需要空托盘
                            // ========== 检查特定位置是否有托盘 ==========
                            // 从配置中读取需要检查托盘的位置列表
@@ -205,13 +207,31 @@
                                }
                            }
                            #endregion
                            // ========== 检查 PLC_STB 标志 ==========
                            // 只有当 PLC_STB 为 1 时才处理任务
                            if (command.PLC_STB != 1)
                            {
                                // 如果 WCS_ACK 为 1,先清除(表示处理过上一次请求)
                                if (command.WCS_ACK == 1)
                                    conveyorLine.SetValue(ConveyorLineDBNameNew.WCS_ACK, 0, childDeviceCode);
                                    conveyorLine.SetValue(ConveyorLineDBNameNew.WCS_ACK, (short)0, childDeviceCode);
                                // 处理手动入库任务(起点为线体点位的任务)
                                try
                                {
                                    var task = _taskService.QueryManualInboundTask(childDeviceCode);
                                    if (task != null)
                                    {
                                        var handler = new ManualInboundTaskHandler(_taskService);
                                        handler.WriteTaskToPlc(conveyorLine, childDeviceCode, task);
                                    }
                                }
                                catch (Exception ex)
                                {
                                    _logger.LogError(ex, "处理手动入库任务异常");
                                    QuartzLogger.Error($"处理手动入库任务异常: {ex.Message}", "CommonConveyorLineNewJob", ex);
                                }
                                continue;
                            }