| | |
| | | using HslCommunication.WebSocket; |
| | | using Autofac.Core.Resolving.Middleware; |
| | | using HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | |
| | | //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 Service.AgvCarrying(row, startColumn, endColumn, layer, targetLayer); |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("LedShowTask"), AllowAnonymous] |
| | | public WebResponseContent LedShowTask(string stationCode, string palletCode, int taskType) |
| | | { |
| | | return Service.LedShowTask(stationCode,palletCode,taskType); |
| | | } |
| | | //[HttpPost, HttpGet, Route("WebSocketPushMessage"), AllowAnonymous] |
| | | //public WebResponseContent WebSocketPushMessage(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); |
| | | } |