| using WIDESEA_DTO; | 
| using static WIDESEA_DTO.RequestTaskDto; | 
|   | 
| namespace WIDESEA_WMSServer.Controllers; | 
|   | 
| /// <summary> | 
| /// 任务操作接口 | 
| /// </summary> | 
| [Route("api/[controller]")] | 
| [ApiController] | 
| public class TaskController : ApiBaseController<IDt_TaskService, Dt_Task> | 
| { | 
|     private readonly IHttpContextAccessor _httpContextAccessor; | 
|     private readonly IDt_TaskService _taskService; | 
|     private readonly ILocationInfoService _locationService; | 
|   | 
|     public TaskController(IDt_TaskService taskService, | 
|         IHttpContextAccessor httpContextAccessor, | 
|         ILocationInfoService locationService) : base(taskService) | 
|     { | 
|         _httpContextAccessor = httpContextAccessor; | 
|         _taskService = taskService; | 
|         _locationService = locationService; | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 任务完成 | 
|     /// </summary> | 
|     /// <param name="saveModel">任务号</param> | 
|     /// <returns>成功或失败</returns> | 
|     [HttpGet, Route("CompleteTaskAsync"), AllowAnonymous] | 
|     public async Task<WebResponseContent> CompleteTaskAsync(int taskNum) | 
|     { | 
|         return await _taskService.CompleteAsync(taskNum); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 任务完成 | 
|     /// </summary> | 
|     /// <param name="saveModel">任务号</param> | 
|     /// <returns>成功或失败</returns> | 
|     //[HttpGet, Route("CompleteTaskByStation"), AllowAnonymous] | 
|     //public async Task<WebResponseContent> CompleteTaskByStation(int taskNum) | 
|     //{ | 
|     //    return await _taskService.CompleteTaskByStation(taskNum); | 
|     //} | 
|   | 
|     /// <summary> | 
|     /// 检查是否需要进行移库 | 
|     /// </summary> | 
|     /// <param name="taskNum">任务号</param> | 
|     /// <returns>任务</returns> | 
|     [HttpGet, Route("TransferCheckAsync"), AllowAnonymous] | 
|     public async Task<WebResponseContent> TransferCheckAsync(int taskNum) | 
|     { | 
|         return new WebResponseContent().OK(data: await _locationService.TransferCheckAsync(taskNum)); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 请求任务巷道 | 
|     /// </summary> | 
|     /// <param name="input">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("RequestTaskAsync")] | 
|     public async Task<WebResponseContent> RequestTaskAsync([FromBody] RequestTaskDto input) | 
|     { | 
|         return await Service.RequestTaskAsync(input); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 请求任务巷道 | 
|     /// </summary> | 
|     /// <param name="input">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("RequestInTask")] | 
|     public async Task<WebResponseContent> RequestInTask([FromBody] RequestTaskDto input) | 
|     { | 
|         return await Service.RequestInTask(input); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 请求任务货位 | 
|     /// </summary> | 
|     /// <param name="input">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("RequestLocationTaskAsync")] | 
|     public async Task<WebResponseContent> UpdateExistingTask([FromBody] RequestTaskDto input) | 
|     { | 
|         return await Service.UpdateExistingTask(input); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 空托盘入库请求 | 
|     /// </summary> | 
|     /// <param name="input">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("RequestTrayInTaskAsync")] | 
|     public async Task<WebResponseContent> RequestTrayInTaskAsync([FromBody] RequestTaskDto input) | 
|     { | 
|         return await Service.RequestTrayInTaskAsync(input); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 空托盘&满盘出库请求 | 
|     /// </summary> | 
|     /// <param name="request">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("RequestTrayOutTaskAsync")] | 
|     public async Task<WebResponseContent> RequestTrayOutTaskAsync([FromBody] RequestOutTaskDto request) | 
|     { | 
|         return await Service.RequestTrayOutTaskAsync(request.Position, request.Tag, request.AreaCdoe, request.AreaCdoes, request.ProductionLine); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 任务状态修改 | 
|     /// </summary> | 
|     /// <param name="input">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("UpdateTaskStatus")] | 
|     public async Task<WebResponseContent> UpdateTaskStatus([FromBody] UpdateStatusDto input) | 
|     { | 
|         return await Service.UpdateTaskStatus(input.TaskNum, input.TaskState); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 获取高温可出库库存 | 
|     /// </summary> | 
|     /// <param name="input">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpGet, AllowAnonymous, Route("StockCheckingAsync")] | 
|     public WebResponseContent StockCheckingAsync() | 
|     { | 
|         return Service.StockCheckingAsync(); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 创建指定任务 | 
|     /// </summary> | 
|     /// <param name="locationCode">货位号</param> | 
|     /// <param name="palletCode">托盘号</param> | 
|     /// <returns></returns> | 
|     [HttpGet, AllowAnonymous, Route("CreateAndSendOutboundTask")] | 
|     public async Task<WebResponseContent> CreateAndSendOutboundTask(string locationCode, string palletCode) | 
|     { | 
|         return await Service.CreateAndSendOutboundTask(locationCode, palletCode); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 静置NG入库 | 
|     /// </summary> | 
|     /// <param name="locationCode">货位号</param> | 
|     /// <param name="palletCode">托盘号</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("RequestInBoundTaskNG")] | 
|     public async Task<WebResponseContent> RequestInBoundTaskNG([FromBody] RequestTaskDto input) | 
|     { | 
|         return await Service.CreateAndSendInboundTask(input.PalletCode, input.Position); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 常温补空托盘至分容 | 
|     /// </summary> | 
|     /// <param name="input">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("GetFROutTrayToCW")] | 
|     public async Task<WebResponseContent> GetFROutTrayToCW([FromBody] RequestTaskDto input) | 
|     { | 
|         return await Service.GetFROutTrayToCW(input); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// DTS火警出库 | 
|     /// </summary> | 
|     /// <param name="input">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("EmergencyTask")] | 
|     public WebResponseContent EmergencyTask([FromBody] object input) | 
|     { | 
|         return Service.EmergencyTask(input); | 
|     } | 
|   | 
|   | 
|     /// <summary> | 
|     /// CW3 出库至包装 | 
|     /// </summary> | 
|     /// <param name="input">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("RequestOutTaskToBZAsync")] | 
|     public async Task<WebResponseContent> RequestOutTaskToBZAsync([FromBody] RequestTaskDto input) | 
|     { | 
|         return await Service.RequestOutTaskToBZAsync(input); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 分容空框入库改为直接出库 | 
|     /// </summary> | 
|     /// <param name="input">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("SetEmptyOutbyInToOutAsync")] | 
|     public async Task<WebResponseContent> SetEmptyOutbyInToOutAsync([FromBody] RequestTaskDto input) | 
|     { | 
|         return await Service.SetEmptyOutbyInToOutAsync(input); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 分容空框出库改为直接出库 | 
|     /// </summary> | 
|     /// <param name="input">请求数据</param> | 
|     /// <returns></returns> | 
|     [HttpPost, AllowAnonymous, Route("SetEmptyOutbyInToOutOneAsync")] | 
|     public async Task<WebResponseContent> SetEmptyOutbyInToOutOneAsync([FromBody] RequestTaskDto input) | 
|     { | 
|         return await Service.SetEmptyOutbyInToOutOneAsync(input); | 
|     } | 
| } |