| | |
| | | { |
| | | var task = _taskRepository.QueryFirst(x => secureApplyModel.TaskCode == x.AgvTaskNum); |
| | | if (task == null) throw new Exception("æªæ¾å°ä»»å¡"); |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | //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 (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | //{ |
| | | // var content = TakeRequest(task.CurrentAddress); |
| | | // //if (!content.Status) |
| | | // //{ |
| | | // // throw new Exception(content.Message); |
| | | // //} |
| | | //} |
| | | //else |
| | | //{ |
| | | // var content = PutRequest(task.NextAddress, task.PalletType); |
| | | // //if (!content.Status) |
| | | // //{ |
| | | // // throw new Exception(content.Message); |
| | | // //} |
| | | //} |
| | | task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | | agvResponseContent.Code = up ? "0" : "1"; |
| | |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | var content = TakeFinish(task.CurrentAddress); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | if (!content.Status) |
| | | { |
| | | task.TaskState = TaskStatusEnum.AGV_TakeError.ObjToInt(); |
| | | _taskRepository.UpdateData(task); |
| | | throw new Exception(content.Message); |
| | | } |
| | | task.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt(); |
| | | var up = _taskRepository.DeleteAndMoveIntoHty(task, OperateTypeEnum.èªå¨å®æ); |
| | | _taskService.TaskCompleted(task.TaskNum); |
| | |
| | | break; |
| | | case "getSafetySignal"://å®å
¨ä¿¡å·ç³è¯· |
| | | { |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | //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 (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | //{ |
| | | // var content = TakeRequest(task.CurrentAddress); |
| | | // //if (!content.Status) throw new Exception(content.Message); |
| | | //} |
| | | //else |
| | | //{ |
| | | // var content = PutRequest(task.NextAddress, task.PalletType); |
| | | // //if (!content.Status) throw new Exception(content.Message); |
| | | //} |
| | | task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | var up = _taskRepository.UpdateData(task); |
| | | agvResponseContent.Code = up ? "0" : "1"; |
| | |
| | | if (task.TaskType != TaskTypeEnum.Outbound.ObjToInt()) |
| | | { |
| | | var content = PutFinish(task.NextAddress); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | if (!content.Status) |
| | | { |
| | | task.TaskState = TaskStatusEnum.AGV_PutError.ObjToInt(); |
| | | _taskRepository.UpdateData(task); |
| | | throw new Exception(content.Message); |
| | | } |
| | | Dt_StationManger dt_Station = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == task.NextAddress); |
| | | if (dt_Station == null) |
| | | { |