using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using WIDESEA_Common.CommonEnum; using WIDESEA_Core; using WIDESEA_Core.BaseController; using WIDESEA_DTO; using WIDESEA_DTO.Stock; using WIDESEA_DTO.Task; using WIDESEA_ITaskInfoService; using WIDESEA_Model.Models; namespace WIDESEA_WMSServer.Controllers.TaskInfo { /// /// 任务 /// [Route("api/Task")] [ApiController] public class TaskController : ApiBaseController { public TaskController(ITaskService service) : base(service) { } /// /// 创建入库任务 /// /// /// [HttpGet, HttpPost, Route("CreateTaskInbound"),AllowAnonymous] public async Task CreateTaskInboundAsync([FromBody] CreateTaskDto taskDto) { return await Service.CreateTaskInboundAsync(taskDto); } /// /// 根据指定的任务详情异步创建新的出库任务 /// /// /// [HttpGet, HttpPost, Route("CreateTaskOutbound"), AllowAnonymous] public async Task CreateTaskOutboundAsync([FromBody] CreateTaskDto taskDto) { return await Service.CreateTaskOutboundAsync(taskDto); } /// /// 获取可入库货位 /// /// /// [HttpGet, HttpPost, Route("GetTasksLocation"), AllowAnonymous] public async Task GetTasksLocationAsync([FromBody] CreateTaskDto taskDto) { return await Service.GetTasksLocationAsync(taskDto); } /// /// 入库任务完成:添加库存,修改货位状态,删除任务数据,添加历史任务数据 /// /// /// [HttpGet, HttpPost, Route("InboundFinishTask"), AllowAnonymous] public async Task InboundFinishTaskAsync([FromBody] CreateTaskDto taskDto) { return await Service.InboundFinishTaskAsync(taskDto); } /// /// 出库任务完成 :修改库存,修改货位状态,删除任务数据,添加历史任务数据 /// /// /// [HttpGet, HttpPost, Route("OutboundFinishTask"), AllowAnonymous] public async Task OutboundFinishTaskAsync([FromBody] CreateTaskDto taskDto) { return await Service.OutboundFinishTaskAsync(taskDto); } /// /// 创建空托盘出库任务 /// /// /// [HttpGet, HttpPost, Route("GetOutBoundTrayTask"), AllowAnonymous] public async Task GetOutBoundTrayTaskAsync([FromBody] CreateTaskDto taskDto) { return await Service.GetOutBoundTrayTaskAsync(taskDto); } /// /// 创建空托盘出库任务 /// /// /// [HttpGet, HttpPost, Route("CreateTaskInboundTray"), AllowAnonymous] public async Task CreateTaskInboundTrayAsync([FromBody] CreateTaskDto taskDto) { return await Service.CreateTaskInboundTrayAsync(taskDto); } /// /// 修改任务状态(根据任务ID修改为指定状态) /// /// /// [HttpGet, HttpPost, Route("UpdateTaskByStatus"), AllowAnonymous] public async Task UpdateTaskByStatusAsync([FromBody] int taskId, int newStatus) { return await Service.UpdateTaskByStatusAsync(taskId, newStatus); } /// /// 堆垛机取放货完成后物流通知化成分容柜完成信号 /// /// /// [HttpGet, HttpPost, Route("InOrOutCompleted"), AllowAnonymous] public async Task InOrOutCompletedAsync([FromBody] InputDto input) { return await Service.InOrOutCompletedAsync(input); } /// /// 化成分容柜定时向物流更新分容柜状态信息 /// /// /// [HttpGet, HttpPost, Route("SendLocationStatus"), AllowAnonymous] public async Task SendLocationStatusAsync([FromBody] InputDto input) { return await Service.SendLocationStatusAsync(input); } /// /// 分容柜工作完成后调用此接口通知物流出库 /// /// /// [HttpGet, HttpPost, Route("RequestOutbound"), AllowAnonymous] public async Task RequestOutboundAsync([FromBody] InputDto input) { return await Service.RequestOutboundAsync(input); } /// /// 入库完成分容调用获取托盘上每个通道电芯 /// /// /// [HttpGet, HttpPost, Route("GetPalletCodeCell"), AllowAnonymous] public async Task GetPalletCodeCellAsync([FromBody] InputDto input) { return await Service.GetPalletCodeCellAsync(input); } } }