肖洋
2024-12-24 b24ef0d9a6a572529cf7e34a0fc8de4fa24bb9e7
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -157,6 +157,9 @@
        private Task ProcessDeviceAsync(CommonConveyorLine conveyorLine, string childDeviceCode)
        {
            try
            {
            // 读取任务命令和设备命令
            ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode);
            ConveyorLineTaskCommandWrite commandWrite = conveyorLine.ReadCustomer<ConveyorLineTaskCommandWrite>(childDeviceCode, "DeviceCommand");
@@ -252,6 +255,11 @@
                        }
                    }
                }
                }
            }
            catch (Exception ex)
            {
            }
            return Task.CompletedTask;
@@ -370,6 +378,9 @@
        /// <param name="ProtocalDetailValue">线体当前bool读取偏移地址</param>
        public void ConveyorLineInFinish(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue)
        {
            try
            {
            ConsoleHelper.WriteWarningLine($"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线入库完成");
            var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish)
@@ -403,6 +414,11 @@
                }
            }
        }
            catch (Exception ex)
            {
            }
        }
        #endregion 入库
@@ -417,6 +433,9 @@
        /// <param name="ProtocalDetailValue">线体当前bool读取偏移地址</param>
        public void RequestOutbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue)
        {
            try
            {
            // 查询输送线任务,根据输送线设备和子设备代码获取任务信息
            var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
@@ -452,6 +471,11 @@
                {
                    _taskService.UpdateTaskStatusToNext(task);
                }
                }
            }
            catch (Exception ex)
            {
            }
        }
@@ -511,6 +535,9 @@
        /// <param name="childDeviceCode">子设备编号</param>
        public void ConveyorLineOutFinish(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode, int ProtocalDetailValue)
        {
            try
            {
            // 打印成功信息,表示托盘已到达指定输送线并完成出库
            ConsoleHelper.WriteSuccessLine($"【{conveyorLine.DeviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线出库完成");
@@ -571,6 +598,11 @@
                }
            }
        }
            catch (Exception ex)
            {
            }
        }
        #endregion 出库