wangxinhui
2025-03-19 d8db1698c125618c1b5f62b009204ddc5d4eed5a
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGV/CTU_AGVController .cs
@@ -107,10 +107,35 @@
                var task = _taskRepository.QueryFirst(x => agvUpdateModel.TaskCode == x.AgvTaskNum);
                if (task == null) throw new Exception($"未找到任务,任务号【{agvUpdateModel.TaskCode}】");
                if (agvUpdateModel.Method == "end")
                switch (agvUpdateModel.Method)
                {
                    if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutEmpty.ObjToInt()) PutFinish(task.NextAddress);
                    _taskService.TaskCompleted(task.TaskNum);
                    case "end":
                        if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutEmpty.ObjToInt() || task.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() || task.TaskType == TaskTypeEnum.OutProduct.ObjToInt())
                            PutFinish(task.NextAddress);
                        _taskService.TaskCompleted(task.TaskNum);
                        break;
                    case "applyToAgv":
                        //更改成品入库AGV取货任务状态
                        if (task.TaskType == TaskTypeEnum.InProduct.ObjToInt())
                        {
                            _taskService.UpdateTask(task,TaskStatusEnum.AGV_WaitToExecute);
                        }
                        break;
                    case "applyFromAgv":
                        //更改成品出AGV放货任务状态
                        if (task.TaskType == TaskTypeEnum.OutProduct.ObjToInt())
                        {
                            _taskService.UpdateTask(task, TaskStatusEnum.AGV_WaitToExecute);
                        }
                        break;
                    case "outbin":
                        if (task.TaskType == TaskTypeEnum.OutProduct.ObjToInt())
                        {
                            TakeFinish(task.CurrentAddress);
                        }
                        break;
                    default:
                        break;
                }
                agvResponseContent.Code = "0";
                agvResponseContent.Message = "成功";