| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Autofac.Core; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Text; |
| | |
| | | _taskRepository = taskRepository; |
| | | _routerRepository = routerRepository; |
| | | } |
| | | /// <summary> |
| | | /// AGV任塿´æ° |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("Callback"), AllowAnonymous] |
| | | public WebResponseContent? Callback([FromBody]AgvUpdateDTO agvUpdateDTO) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var task = _taskRepository.QueryFirst(x => agvUpdateDTO.ContainerCode==x.PalletCode) ?? throw new Exception($"æªæ¾å°æç®±ã{agvUpdateDTO.ContainerCode}ãä»»å¡"); |
| | | switch (agvUpdateDTO.MissionStatus) |
| | | { |
| | | case nameof(AGVStatusEnum.PICKER_RECEIVE): |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_TakeFinish); |
| | | break; |
| | | case nameof(AGVStatusEnum.PICKER_SEND): |
| | | //WebResponseContent responseContent = _taskService.AgvTaskFlow(task.PalletCode); |
| | | //if (!responseContent.Status) throw new Exception($"{responseContent.Message}"); |
| | | _taskService.TaskCompleted(task.TaskNum); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |