wangxinhui
2026-03-26 5c272c606bdf2da3577dbaa5f48d0ee163f1e7d2
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/³ÉÆ·²Ö/ConveyorLineJob_CPB.cs
@@ -1,7 +1,6 @@
using Microsoft.AspNetCore.Components.Routing;
using Newtonsoft.Json;
using Quartz;
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -11,6 +10,7 @@
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IBasicInfoRepository;
using WIDESEAWCS_ITaskInfoRepository;
@@ -101,16 +101,24 @@
                                            WriteError(item.StationName, $"路由信息配置错误,设备编号:{item.StationCode},任务号:{task.TaskNum}");
                                            continue;
                                        }
                                        device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode);
                                        device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode);
                                        device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
                                        task.CurrentAddress = item.StationCode;
                                        task.NextAddress = router.NextPosi;
                                        task.PalletCode = conveyorLineInfoRead.PalletCode;
                                        task.Roadway = roadWay;
                                        task.DeviceCode = router.ChildPosiDeviceCode;
                                        _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
                                        WriteInfo(item.StationName, $"任务号{conveyorLineInfoRead.TaskNo}下一步");
                                        WebResponseContent responseContent = _taskService.RequestInBoundPalletCode(task.TaskNum, conveyorLineInfoRead.PalletCode.Trim());
                                        if (responseContent.Status)
                                        {
                                            device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode);
                                            device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode);
                                            device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
                                            task.CurrentAddress = item.StationCode;
                                            task.NextAddress = router.NextPosi;
                                            task.PalletCode = conveyorLineInfoRead.PalletCode.Trim();
                                            task.Roadway = roadWay;
                                            task.DeviceCode = router.ChildPosiDeviceCode;
                                            _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
                                            WriteInfo(item.StationName, $"任务号{task.TaskNum}下一步到达{router.NextPosi}入库站台");
                                        }
                                        else
                                        {
                                            WriteError(item.StationName, $"任务号{task.TaskNum}扫码请求错误{responseContent.Message}");
                                        }
                                    }
                                    else
                                    {
@@ -124,6 +132,10 @@
                        else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt() && deviceProRead != null)
                        {//入库RGV接驳位交互
                            R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
                            if (conveyorLineInfoRead != null)
                            {
                                WriteInfo(item.StationName, $"状态{conveyorLineInfoRead.Serialize()}");
                            }
                            if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo > 0)
                            {
                                Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == device.DeviceCode);
@@ -212,8 +224,9 @@
                                }
                            }
                        }
                        else if (item.StationType == StationTypeEnum.StationType_StackingPlates.ObjToInt() && deviceProRead != null && deviceProWrite != null)
                        {//叠盘机工位叫料
                        else if (item.StationType == StationTypeEnum.StationType_StackingPlates.ObjToInt() && item.IsOccupied==StationOccupiedEnum.None.ObjToInt() && deviceProRead != null && deviceProWrite != null)
                        {
                            //叠盘机工位叫料
                            R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
                            if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 7 && conveyorLineInfoRead.TaskNo <= 0)
@@ -223,7 +236,14 @@
                                {
                                    //请求任务
                                    WebResponseContent content = _taskService.RequestPlateOutTask(item.StationCode);
                                    WriteInfo(item.StationName, $"二楼空托叠盘出库任务生成");
                                    if (content.Status)
                                    {
                                        WriteInfo(item.StationName, $"二楼空托叠盘出库任务生成");
                                    }
                                    else
                                    {
                                        WriteInfo(item.StationName, $"{content.Message}");
                                    }
                                }
                            }
                            //叠盘任务完成交互