using HslCommunication.WebSocket; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using WIDESEAWCS_Common.TaskEnum; using WIDESEAWCS_Core; using WIDESEAWCS_Core.BaseController; using WIDESEAWCS_Core.Helper; using WIDESEAWCS_DTO.TaskInfo; using WIDESEAWCS_IBasicInfoRepository; using WIDESEAWCS_ITaskInfoService; using WIDESEAWCS_Model.Models; using WIDESEAWCS_QuartzJob; using WIDESEAWCS_Tasks; using WIDESEAWCS_Tasks.DBNames; namespace WIDESEAWCS_WCSServer.Controllers.Task { [Route("api/Task")] [ApiController] public class TaskController : ApiBaseController { private readonly IHttpContextAccessor _httpContextAccessor; private readonly IRouterExtension _routerExtension; //private readonly WebSocketServer _webSocketServer; private readonly IStationMangerRepository _stationMangerRepository; public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension/*, WebSocketServer webSocketServer*/, IStationMangerRepository stationMangerRepository) : base(service) { _httpContextAccessor = httpContextAccessor; _routerExtension = routerExtension; _stationMangerRepository=stationMangerRepository; //_webSocketServer = webSocketServer; } [HttpPost, Route("ReceiveTask"), AllowAnonymous] public WebResponseContent ReceiveWMSTask([FromBody] List taskDTOs) { 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("TaskStatusRecovery")] public WebResponseContent TaskStatusRecovery(int taskNum) { return Service.TaskStatusRecovery(taskNum); } [HttpPost, HttpGet, Route("RollbackTaskStatusToLast")] public WebResponseContent RollbackTaskStatusToLast(int taskNum) { return Service.RollbackTaskStatusToLast(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("AssignCPRoadwayNo"), AllowAnonymous] public WebResponseContent AssignCPRoadwayNo() { return Service.AssignCPRoadwayNo(); } /// /// WMS任务完成同步 /// /// /// [HttpPost, HttpGet, Route("RecWMSTaskCompleted"), AllowAnonymous] public WebResponseContent RecWMSTaskCompleted(int taskNum) { return Service.RecWMSTaskCompleted(taskNum); } } }