wangxinhui
16 小时以前 67348f250a1b7970059698002949a5e0a5f3c52f
ÏîÄ¿´úÂë/WCS/WCSServices/WIDESEAWCS_Tasks/³ÉÆ·²Ö/ConveyorLineJob_CPD.cs
@@ -74,6 +74,7 @@
                    if (item.StationType == StationTypeEnum.StationType_InStartAndOutEnd.ObjToInt() && deviceProRead != null && deviceProWrite != null)
                    {
                        R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
                        //成品一楼入库口写入对应入库站台地址
                        if (conveyorLineInfoRead!=null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0)
                        {
                            Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.DeviceCode == device.DeviceCode);
@@ -102,13 +103,14 @@
                                task.PalletType = 1;
                                task.PalletCode = conveyorLineInfoRead.PalletCode;
                                _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
                                WriteError(item.StationName, $"任务号{conveyorLineInfoRead.TaskNo}下一步");
                                WriteInfo(item.StationName, $"任务号{conveyorLineInfoRead.TaskNo}下一步");
                            }
                        }
                    }
                    else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null)
                    {
                        R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
                        //入库站台分配货位准备堆垛入库
                        if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0)
                        {
                            Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode);
@@ -121,20 +123,14 @@
                                task.NextAddress = local;
                                task.DeviceCode = item.StackerCraneCode;
                                _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute);
                                WriteError(item.StationName, $"任务号:{task.TaskNum}进行堆垛机入库");
                                //string? locationCode = _taskService.RequestAssignLocation(task.TaskNum, "AGV_CP");
                                //if (string.IsNullOrEmpty(locationCode) && task.TaskType != TaskTypeEnum.EmptyProductBack.ObjToInt())
                                //{
                                //    WriteError(item.StationName, $"请求分配货位返回信息错误,设备编号:{item.StationCode},任务号:{task.TaskNum}");
                                //    continue;
                                //}
                                WriteInfo(item.StationName, $"任务号:{task.TaskNum}进行堆垛机入库");
                            }
                        }
                    }
                    else if (item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && deviceProRead != null && deviceProWrite != null)
                    {
                        R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
                        //出库站台分配出库对应目标出库口地址
                        if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 4 && conveyorLineInfoRead.TaskNo <= 0)
                        {
                            //获取出库站台是否存在出库待执行任务
@@ -155,7 +151,7 @@
                                device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode);
                                device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
                                _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
                                WriteError(item.StationName, $"任务号:{task.TaskNum}进行线体出库");
                                WriteInfo(item.StationName, $"任务号:{task.TaskNum}进行线体出库");
                            }
                        }
                    }