| | |
| | | 锘縰sing Microsoft.AspNetCore.Authorization; |
| | | 锘縰sing HslCommunication.WebSocket; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEAWCS_Core; |
| | |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_Tasks; |
| | | |
| | | namespace WIDESEAWCS_WCSServer.Controllers.Task |
| | | { |
| | |
| | | public class TaskController : ApiBaseController<ITaskService, Dt_Task> |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor) : base(service) |
| | | private readonly IRouterExtension _routerExtension; |
| | | //private readonly WebSocketServer _webSocketServer; |
| | | |
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension/*, WebSocketServer webSocketServer*/) : base(service) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | _routerExtension = routerExtension; |
| | | //_webSocketServer = webSocketServer; |
| | | } |
| | | |
| | | [HttpPost, Route("ReceiveTask"), AllowAnonymous] |
| | |
| | | return Service.ReceiveWMSTask(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.UpdateTaskExceptionMessage(taskNum, message); |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("UpdateTaskStatusToNext")] |
| | | public WebResponseContent UpdateTaskStatusToNext(int taskNum) |
| | | { |
| | | return Service.UpdateTaskStatusToNext(taskNum); |
| | | } |
| | | //[HttpPost, HttpGet, Route("UpdateTaskStatusToNext")] |
| | | //public WebResponseContent UpdateTaskStatusToNext(int taskNum) |
| | | //{ |
| | | // return Service.UpdateTaskStatusToNext(taskNum); |
| | | //} |
| | | |
| | | [HttpPost, HttpGet, Route("TaskStatusRecovery")] |
| | | public WebResponseContent TaskStatusRecovery(int taskNum) |
| | |
| | | { |
| | | return Service.RollbackTaskStatusToLast(taskNum); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 鍥炲AGV瀹夊叏淇″彿 |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("SendSecureReplyToAgv")] |
| | | public WebResponseContent SendSecureReplyToAgv(int taskNum) |
| | | { |
| | | return Service.SendSecureReplyToAgv(taskNum); |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("GetRouteEndPoint"), AllowAnonymous] |
| | | public WebResponseContent GetRouteEndPoint(string startPoint, int routeType) |
| | | { |
| | | return WebResponseContent.Instance.OK(data: _routerExtension.GetEndPoint(startPoint, routeType)); |
| | | } |
| | | [HttpPost, HttpGet, Route("AgvCarrying"), AllowAnonymous] |
| | | public WebResponseContent AgvCarrying(int row, int startColumn, int endColumn, int layer, int targetLayer) |
| | | { |
| | | return Service.AgvCarrying(row, startColumn, endColumn, layer, targetLayer); |
| | | } |
| | | //[HttpPost, HttpGet, Route("WebSocketPushMessage"), AllowAnonymous] |
| | | //public WebResponseContent WebSocketPushMessage(string message) |
| | | //{ |
| | | // try |
| | | // { |
| | | // _webSocketServer.PublishAllClientPayload(message); |
| | | // return WebResponseContent.Instance.OK(); |
| | | // } |
| | | // catch(Exception ex) |
| | | // { |
| | | // return WebResponseContent.Instance.Error(ex.Message); |
| | | // } |
| | | //} |
| | | [HttpPost, HttpGet, Route("RecWMSTaskCompleted"), AllowAnonymous] |
| | | public WebResponseContent RecWMSTaskCompleted(int taskNum) |
| | | { |
| | | return Service.RecWMSTaskCompleted(taskNum); |
| | | } |
| | | } |
| | | } |