huangxiaoqiang
2025-06-03 975ea3c28b1661b3b6eabee5277cc98d853736d3
CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -285,10 +285,6 @@
                                    }
                                }
                            }
                            //else
                            //{
                            //    //ConsoleHelper.WriteErrorLine("静置空托不允许出料");
                            //}
                        }
                        else
                        {
@@ -392,7 +388,8 @@
                }
                else
                {
                    var taskInTray = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
                    //var taskInTray = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
                    var taskInTray = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode,command.Barcode);
                    if (taskInTray != null && taskInTray.TaskType == (int)TaskInboundTypeEnum.InTray)
                    {
                        RequestInNextAddress(conveyorLine, command, childDeviceCode, ProtocalDetailValue);
@@ -493,7 +490,8 @@
            _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
            WriteInfo(conveyorLine.DeviceName, log);
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            //Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode);
            if (task != null)
            {
                if (command.Barcode == task.PalletCode)
@@ -501,6 +499,7 @@
                    Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
                    if (newTask != null)
                    {
                        //ConveyorLineTaskCommand taskCommand = _mapper.Map<ConveyorLineTaskCommand>(newTask);
                        //taskCommand.InteractiveSignal = command.InteractiveSignal;
                        var next = newTask.NextAddress;
@@ -516,6 +515,7 @@
                        conveyorLine.SendCommand(taskCommand, childDeviceCode);
                        ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                        _taskService.UpdateData(newTask);
                    }
                }
@@ -541,7 +541,8 @@
                _noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
                WriteInfo(conveyorLine.DeviceName, log);
                var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
                //var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
                var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode);
                if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish)
                {
                    if (command.Barcode == task.PalletCode && childDeviceCode == task.NextAddress)
@@ -599,6 +600,7 @@
            {
                // 查询输送线任务,根据输送线设备和子设备代码获取任务信息
                var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
                //var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode, command.Barcode);
                // 输出成功信息,包括输送线名称、任务号、托盘条码和子设备代码,以及任务信息
                var logs = $"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线请求出库,task{task.ToJsonString()}";
@@ -663,7 +665,8 @@
            WriteInfo(conveyorLine.DeviceName, log);
            // 查询正在执行的输送线任务,根据任务号和子设备代码获取任务信息
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            //Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode);
            // 如果任务存在
            if (task != null)
@@ -677,6 +680,7 @@
                    // 如果更新后的任务对象不为空
                    if (newTask != null)
                    {
                        //_taskService.UpdateData(newTask);
                        // 获取下一目标地址
                        var next = newTask.NextAddress;
@@ -698,6 +702,7 @@
                        // 标记输送线发送任务完成
                        ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                        _taskService.UpdateData(newTask);
                    }
                }
@@ -722,7 +727,8 @@
                WriteInfo(conveyorLine.DeviceName, logs);
                // 查询正在执行的输送线任务
                var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
                //var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
                var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode, command.Barcode);
                // 如果任务存在
                if (task != null)