dengjunjie
2025-03-19 8abc9481eafeb715b39a4f4f8d6f628a642e6b53
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/ConveyorLineExtend/ConveyorLineExtend.cs
@@ -42,60 +42,28 @@
                        {
                            ConveyorLineInFinish(conveyorLine, command, childDeviceCode);
                        }
                        //else if (childDeviceCode == "1005" && command.Status == (ushort)ConveyorStatus.Stored)
                        //{
                        //    Dt_Task task = _taskService.QueryConveyorLineTaskNum(conveyorLine.DeviceCode, childDeviceCode, command.TaskNum);
                        //    if (task != null)
                        //    {
                        //        task.TaskState = TaskOutStatusEnum.Line_OutExecuting.ObjToInt();
                        //        _taskService.UpdateData(task);
                        //        ConveyorLineTaskCommandW taskCommand = _mapper.Map<ConveyorLineTaskCommandW>(task);
                        //        taskCommand.WriterTrue = (short)command.inRead;
                        //        conveyorLine.SendCommand(taskCommand, childDeviceCode);
                        //    }
                        //}
                        else if (childDeviceCode == "1008" && command.Status == (ushort)ConveyorStatus.Stored)
                        {
                            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
                            if (task != null)
                            {
                                List<Dt_Router> routers = _routerRepository.QueryData(x => x.StartPosi == task.NextAddress && x.ChildPosiDeviceCode == "AGV" && x.Remark == "未占用");
                                if (routers.Count > 0)
                                if (routers != null && routers.Count > 0)
                                {
                                    var router = routers.FirstOrDefault();
                                    if (router != null)
                                    {
                                        task.TaskState = TaskOutStatusEnum.Line_OutFinish.ObjToInt();
                                        task.CurrentAddress = childDeviceCode;
                                        task.NextAddress = router.ChildPosi;
                                        router.Remark = "占用";
                                        _routerRepository.UpdateData(router);
                                        _taskService.UpdateData(task);
                                    }
                                }
                                task.TaskState = TaskOutStatusEnum.Line_OutFinish.ObjToInt();
                                _taskService.UpdateData(task);
                            }
                        }
                    }
                    #region MyRegion
                    //if (command != null && command.Status == (ushort)ConveyorStatus.Stored)//添加输送线状态ConveyorLineStatus enum
                    //{
                    //    switch (childDeviceCode)
                    //    {
                    //        case "1002":
                    //            {
                    //                RequestInbound(conveyorLine, command, childDeviceCode);
                    //            }
                    //            break;
                    //        case "1004":
                    //            ConveyorLineInFinish(conveyorLine, command, childDeviceCode);
                    //            break;
                    //        //case "105":
                    //        //    RequestOutbound(conveyorLine, command, childDeviceCode);
                    //        //    break;
                    //        case "1008":
                    //            ConveyorLineOutFinish(conveyorLine, command, childDeviceCode);
                    //            break;
                    //            //default:
                    //            //    RequestInNextAddress(conveyorLine, command, childDeviceCode);
                    //            //    RequestOutNextAddress(conveyorLine, command, childDeviceCode);
                    //            //    break;
                    //    }
                    //}
                    #endregion
                }
                catch (Exception ex)
                {