wanshenmean
2026-02-28 c3de7bb2097aa347a1f92c2f640d18753aff633a
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
@@ -73,7 +73,7 @@
                        try
                        {
                            ConveyorLineTaskCommandNew command = conveyorLine.ReadCustomer<ConveyorLineTaskCommandNew>(childDeviceCode);
                            if (command == null || command.PLC_STB == 0)
                            if (command == null || command.PLC_STB != 1)
                            {
                                return;
                            }
@@ -85,15 +85,19 @@
                                return;
                            }
                            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNo, childDeviceCode);
                            if (task.IsNullOrEmpty())
                            if (command.TaskNo > 0)
                            {
                                _conveyorLineDispatch.RequestInbound(conveyorLine, command, childDeviceCode);
                                return;
                                Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNo, childDeviceCode);
                                if (task.IsNullOrEmpty())
                                {
                                    _conveyorLineDispatch.RequestInbound(conveyorLine, command, childDeviceCode);
                                    return;
                                }
                                // 处理任务状态
                                ProcessTaskState(conveyorLine, command, task, childDeviceCode);
                            }
                            // 处理任务状态
                            ProcessTaskState(conveyorLine, command, task, childDeviceCode);
                        }
                        catch (Exception innerEx)
                        {
@@ -132,10 +136,10 @@
            switch (state)
            {
                case InExecuting:
                    if (isTargetAddress)
                        _conveyorLineDispatch.ConveyorLineInFinish(conveyorLine, command, childDeviceCode);
                    else
                        _conveyorLineDispatch.RequestInNextAddress(conveyorLine, command, childDeviceCode);
                    //if (isTargetAddress)
                    //    _conveyorLineDispatch.ConveyorLineInFinish(conveyorLine, command, childDeviceCode);
                    //else
                    _conveyorLineDispatch.RequestInNextAddress(conveyorLine, command, childDeviceCode);
                    break;
                case OutExecuting:
@@ -155,6 +159,6 @@
            }
        }
    }
}