| | |
| | | //private readonly WebSocketServer _webSocketServer; |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension ,ITaskService taskService,ITaskRepository taskRepository /*, WebSocketServer webSocketServer*/) : base(service) |
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension, ITaskService taskService, ITaskRepository taskRepository /*, WebSocketServer webSocketServer*/) : base(service) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | _routerExtension = routerExtension; |
| | |
| | | return Service.ReceiveWMSTask(taskDTOs); |
| | | } |
| | | |
| | | |
| | | [HttpPost, Route("ReceiveCPTask"), AllowAnonymous] |
| | | public WebResponseContent ReceiveWMSCPTask([FromBody] List<WMSTaskDTO> taskDTOs) |
| | | { |
| | | return Service.ReceiveWMSCPTask(taskDTOs); |
| | | } |
| | | |
| | | |
| | | [HttpPost, HttpGet, Route("RequestAssignLocation"), AllowAnonymous] |
| | | public string? RequestAssignLocation(int taskNum, string roadwayNo) |
| | | { |
| | | return Service.RequestAssignLocation(taskNum, roadwayNo); |
| | | } |
| | | |
| | | |
| | | [HttpPost, HttpGet, Route("UpdateTaskExceptionMessage")] |
| | | public WebResponseContent UpdateTaskExceptionMessage(int taskNum, string message) |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error("未找到该任务信息"); |
| | | } |
| | | if(task.TaskState == TaskStatusEnum.SC_Executing.ObjToInt()) |
| | | if (task.TaskState == TaskStatusEnum.SC_Executing.ObjToInt()) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute); |
| | | } |
| | |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch(Exception ex) |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | //RGV入库任务重发 |
| | | [HttpPost, HttpGet, Route("RGVTaskResending"), AllowAnonymous] |
| | | //堆垛机任务优先执行 |
| | | [HttpPost, HttpGet, Route("StackerCraneTaskPriority"), AllowAnonymous] |
| | | public WebResponseContent StackerCraneTaskPriority(int taskNum) |
| | | { |
| | | try |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error("未找到该任务信息"); |
| | | } |
| | | if (task.TaskState == TaskStatusEnum.RGV_Executing.ObjToInt()) |
| | | if (task.TaskState == TaskStatusEnum.SC_Execute.ObjToInt()) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.RGV_NEW); |
| | | task.Grade = 98; |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error("非RGV执行中状态"); |
| | | return WebResponseContent.Instance.Error("非堆垛机待执行状态"); |
| | | } |
| | | _taskRepository.UpdateData(task); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |