wangxinhui
2025-01-10 4bc0e18b94a2bf17c1b7277910d63ef82fbe616a
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs
文件名从 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs 修改
@@ -29,6 +29,9 @@
            _taskService = taskService;
            _taskRepository = taskRepository;
        }
        /// <summary>
        /// 瀹夊叏淇″彿鐢宠 AGV-WCS
        /// </summary>
@@ -46,18 +49,18 @@
                if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
                {
                    var content = TakeRequest(task.CurrentAddress);
                    if (!content.Status)
                    {
                        throw new Exception(content.Message);
                    }
                    //if (!content.Status)
                    //{
                    //    throw new Exception(content.Message);
                    //}
                }
                else
                {
                    var content = PutRequest(task.NextAddress, task.PalletType);
                    if (!content.Status)
                    {
                        throw new Exception(content.Message);
                    }
                    //if (!content.Status)
                    //{
                    //    throw new Exception(content.Message);
                    //}
                }
                task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt();
                var up = _taskRepository.UpdateData(task);
@@ -109,12 +112,12 @@
                            if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt())
                            {
                                var content = TakeRequest(task.CurrentAddress);
                                if (!content.Status) throw new Exception(content.Message);
                                //if (!content.Status) throw new Exception(content.Message);
                            }
                            else
                            {
                                var content = PutRequest(task.NextAddress, task.PalletType);
                                if (!content.Status) throw new Exception(content.Message);
                                //if (!content.Status) throw new Exception(content.Message);
                            }
                            task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt();
                            var up = _taskRepository.UpdateData(task);
@@ -134,7 +137,7 @@
                            }
                            task.CurrentAddress = dt_Station.StationCode;
                            task.NextAddress = "";
                            task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
                            task.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt();
                            task.DeviceCode = "SC01_CSJ";
                            var up = _taskRepository.UpdateData(task);
                            agvResponseContent.Code = up ? "0" : "1";
@@ -188,6 +191,7 @@
                bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode);
                if (canPut)
                {
                    otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode);
                    return WebResponseContent.Instance.OK();
                }
                else
@@ -271,6 +275,7 @@
                bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode);
                if (canPut)
                {
                    otherDevice.SetValue(GroundStationDBName.W_TakeRequest, true, stationManger.StationCode);
                    return WebResponseContent.Instance.OK();
                }
                else