using Autofac.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_DTO.ToMes;
using WIDESEA_ITaskInfoService;
using WIDESEA_Model.Models;
namespace WIDESEA_WMSServer.Controllers
{
///
/// 上游接口
///
[Route("v1/pallet/rmsPalletTask")]
[ApiController]
public class ToMes : ApiBaseController
{
public ToMes(ITaskService service) : base(service)
{
}
///
/// MES下发出库任务
///
///
///
[HttpPost, HttpGet, Route("sendExTask"), AllowAnonymous]
public ApiResponse sendExTask([FromBody] InOutboundTaskReceived outbound)
{
return Service.sendExTask(outbound);
}
///
/// MES下发入库任务
///
///
///
[HttpPost, HttpGet, Route("sendEnTask"), AllowAnonymous]
public ApiResponse sendEnTask([FromBody] InOutboundTaskReceived outbound)
{
return Service.sendEnTask(outbound);
}
///
/// 新建货位
///
[HttpPost, HttpGet, Route("createLocation"), AllowAnonymous]
public ApiResponse createLocation([FromBody] List locationInfo)
{
return Service.createLocation(locationInfo);
}
///
/// 修改货位
///
[HttpPost, HttpGet, Route("updateLocation"), AllowAnonymous]
public ApiResponse updateLocation([FromBody] LocationInfoDto locationInfo)
{
return Service.updateLocation(locationInfo);
}
///
/// 删除货位
///
[HttpPost, HttpGet, Route("deleteLocation"), AllowAnonymous]
public ApiResponse deleteLocation([FromBody] List locationCode)
{
return Service.deleteLocation(locationCode);
}
///
/// MES下发库位调拨任务
///
/// 库位调拨任务信息
///
[HttpPost, Route("onHandMove"), AllowAnonymous]
public ApiResponse sendAllocationTask([FromBody] AllocationTaskReceived allocationTask)
{
return Service.sendAllocationTask(allocationTask);
}
///
/// 托盘任务数据传输对象
/// 用于内部业务数据传输
///
public class PalletTaskDTO
{
///
/// 业务ID
///
public string BusinessId { get; set; }
///
/// 任务ID
///
public string TaskId { get; set; }
///
/// 托盘编码
///
public string PalletCode { get; set; }
}
///
/// MES取消任务接口
///
/// 任务号
///
[HttpPost, Route("cancelTask"), AllowAnonymous]
public ApiResponse Cancelinventory([FromBody] PalletTaskDTO palletTaskDTO)
{
return Service.Cancelinventory(palletTaskDTO.PalletCode);
}
///
/// MES手动任务完成
///
///
///
[HttpPost, Route("mockComplete"), AllowAnonymous]
public WebResponseContent ManualTaskCompleted([FromBody] PalletTaskDTO palletTaskDTO)
{
return Service.ManualTaskCompleted(palletTaskDTO.PalletCode);
}
}
}