huangxiaoqiang
2025-06-12 3d14b1056267a25dc8aa0ee72f117daa84045f5c
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -382,7 +382,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)
@@ -403,6 +404,7 @@
                        WriteInfo(conveyorLine.DeviceName, logs);
                        conveyorLine.SendCommand(taskCommand, childDeviceCode);
                        _taskService.UpdateData(newTask);
                    }
                }
            }
@@ -427,7 +429,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)
@@ -549,7 +552,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)
@@ -584,6 +588,8 @@
                        // 标记输送线发送任务完成
                        ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
                        _taskService.UpdateData(newTask);
                    }
                }
            }
@@ -607,7 +613,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)
@@ -769,10 +776,11 @@
                }
                var wmsIpAddress = wmsBase + requestTrayOutTask;
                List<string> strings = platform.Roadway.Split(',').ToList();
                List<Dt_DeviceInfo> device;
                if (strings.Count > 0)
                if (platform.Roadway != null)
                {
                    List<string> strings = platform.Roadway.Split(',').ToList();
                    device = _deviceInfoRepository.QueryData(x => x.DeviceStatus == "1" && strings.Contains(x.DeviceCode));
                }
                else
@@ -786,6 +794,9 @@
                // 解析返回的JSON数据
                WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
                Console.WriteLine($"{JsonConvert.SerializeObject(content)}呼叫成功");
                // 检查返回状态,如果失败则返回
                if (!content.Status)
                    return;
@@ -795,6 +806,7 @@
                #endregion 调用WMS获取出库任务
                // 创建并发送任务
                CreateAndSendTask(taskDTO);
            }