chenyong
5 天以前 8b3377273709a6abd89af0e5b2ff9618c167146e
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -103,16 +103,8 @@
                                            ConsoleHelper.WriteColorLine(builder, ConsoleColor.Blue);
                                            commonStackerCrane.LastTaskType = task.TaskType;
                                            if(task.TaskType == (int)TaskOutboundTypeEnum.InToOut)
                                            {
                                                task.TaskState = (int)TaskOutStatusEnum.SC_OutExecuting;
                                                _taskRepository.AddData(task);
                                                _taskService.StackCraneTaskCompleted(task.TaskNum);
                                            }
                                            else
                                            {
                                                _taskService.UpdateTaskStatusToNext(task.TaskNum);
                                            }
                                            _taskService.UpdateTaskStatusToNext(task.TaskNum);
                                        }
                                    }
                                    else
@@ -178,6 +170,24 @@
                    var task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum);
                    if (task == null) commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
                    if (commonStackerCrane.DeviceCode.Contains("CW") && task.TaskType==(int)TaskOutboundTypeEnum.InToOut)
                    {
                        var stationinfo = _stationManagerRepository.QueryFirst(x => (x.stationPLC == "1017"||x.stationPLC=="1024") && x.stationType == 10 && x.Roadway == commonStackerCrane.DeviceCode);
                        IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationinfo.stationPLC);
                        if (device != null)
                        {
                            CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(4000), stationinfo.stationChildCode);
                            Thread.Sleep(100);
                            conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTaskNum, 1000, stationinfo.stationChildCode);
                        }
                        WriteInfo(commonStackerCrane.DeviceName, $"【手动出库记录】任务号【{e.TaskNum}】托盘号【{task.PalletCode}】");
                    }
                    if (commonStackerCrane.DeviceCode.Contains("GW") && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                    {
@@ -309,7 +319,7 @@
                        device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode);
                        if (device != null)
                        {
                            CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;
                            CommonConveyorLine_CW conveyorLine = (CommonConveyorLine_CW)device;
                            if (conveyorLine.IsOccupied(task.NextAddress))//出库站台未被占用
                            {
                                return task;
@@ -326,7 +336,9 @@
                    IDevice? device = null;
                    if (task.Roadway.Contains("GW"))
                    {
                        device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "1015");
                        string targetDeviceCode = task.Roadway == "GWSC3" ? "2025" : "1015";
                        device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == targetDeviceCode);
                        if (device != null)
                        {
                            CommonConveyorLine_GW conveyorLine = (CommonConveyorLine_GW)device;