| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseController; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_WCSServer.Controllers.Task |
| | | { |
| | | [Route("api/Task")] |
| | | [ApiController] |
| | | public class TaskController : ApiBaseController<ITaskService, Dt_Task> |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor) : base(service) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | } |
| | | |
| | | [HttpPost, Route("ReceiveTask"), AllowAnonymous] |
| | | public WebResponseContent ReceiveWMSTask([FromBody] List<WMSTaskDTO> taskDTOs) |
| | | { |
| | | return Service.ReceiveWMSTask(taskDTOs); |
| | | } |
| | | |
| | | [HttpPost, Route("ReceiveManualTask"), AllowAnonymous] |
| | | public WebResponseContent ReceiveManualTask([FromBody] List<WMSTaskDTO> taskDTOs) |
| | | { |
| | | return Service.ReceiveManualTask(taskDTOs); |
| | | } |
| | | |
| | | [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("TaskStatusRecovery")] |
| | | public WebResponseContent TaskStatusRecovery(int taskNum) |
| | | { |
| | | return Service.TaskStatusRecovery(taskNum); |
| | | } |
| | | |
| | | [HttpPost, HttpGet, Route("RollbackTaskStatusToLast")] |
| | | public WebResponseContent RollbackTaskStatusToLast(int taskNum) |
| | | { |
| | | return Service.RollbackTaskStatusToLast(taskNum); |
| | | } |
| | | } |
| | | } |
| | | using Microsoft.AspNetCore.Authorization;
|
| | | using Microsoft.AspNetCore.Http;
|
| | | using Microsoft.AspNetCore.Mvc;
|
| | | using System.Threading.Channels;
|
| | | using WIDESEAWCS_Core;
|
| | | using WIDESEAWCS_Core.BaseController;
|
| | | using WIDESEAWCS_DTO.TaskInfo;
|
| | | using WIDESEAWCS_ITaskInfoService;
|
| | | using WIDESEAWCS_Model.Models;
|
| | |
|
| | | namespace WIDESEAWCS_WCSServer.Controllers.Task
|
| | | {
|
| | | [Route("api/Task")]
|
| | | [ApiController]
|
| | | public class TaskController : ApiBaseController<ITaskService, Dt_Task>
|
| | | {
|
| | | private readonly IHttpContextAccessor _httpContextAccessor;
|
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor) : base(service)
|
| | | {
|
| | | _httpContextAccessor = httpContextAccessor;
|
| | | }
|
| | |
|
| | | [HttpPost, Route("ReceiveTask"), AllowAnonymous]
|
| | | public WebResponseContent ReceiveWMSTask([FromBody] List<WMSTaskDTO> taskDTOs)
|
| | | {
|
| | | return Service.ReceiveWMSTask(taskDTOs);
|
| | | }
|
| | |
|
| | | [HttpPost, Route("ReceiveManualTask"), AllowAnonymous]
|
| | | public WebResponseContent ReceiveManualTask([FromBody] List<WMSTaskDTO> taskDTOs)
|
| | | {
|
| | | return Service.ReceiveManualTask(taskDTOs);
|
| | | }
|
| | |
|
| | | [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("TaskStatusRecovery")]
|
| | | public WebResponseContent TaskStatusRecovery(int taskNum)
|
| | | {
|
| | | return Service.TaskStatusRecovery(taskNum);
|
| | | }
|
| | |
|
| | | [HttpPost, HttpGet, Route("RollbackTaskStatusToLast")]
|
| | | public WebResponseContent RollbackTaskStatusToLast(int taskNum)
|
| | | {
|
| | | return Service.RollbackTaskStatusToLast(taskNum);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 任务取消
|
| | | /// </summary>
|
| | | /// <param name="taskNum"></param>
|
| | | /// <returns></returns>
|
| | | [HttpPost, Route("CancelTask"), AllowAnonymous]
|
| | | public WebResponseContent CancelTask(int taskNum)
|
| | | {
|
| | | return Service.CancelTask(taskNum);
|
| | | }
|
| | | }
|
| | | }
|