using Autofac.Core;
|
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Mvc;
|
using WIDESEA_Core;
|
using WIDESEA_Core.BaseController;
|
using WIDESEA_DTO.Outbound;
|
using WIDESEA_IOutboundService;
|
using WIDESEA_Model.Models;
|
|
namespace WIDESEA_WMSServer.Controllers.Outbound
|
{
|
|
[Route("api/OutboundPicking")]
|
[ApiController]
|
public class OutboundPickingController : ApiBaseController<IOutboundPickingService, Dt_PickingRecord>
|
{
|
private readonly ISplitPackageService _splitPackageService;
|
private readonly IOutStockLockInfoService _outStockLockInfoService;
|
public OutboundPickingController(IOutboundPickingService service, ISplitPackageService splitPackageService, IOutStockLockInfoService outStockLockInfoService) : base(service)
|
{
|
_splitPackageService = splitPackageService;
|
_outStockLockInfoService = outStockLockInfoService;
|
}
|
/// <summary>
|
/// 获取托盘的出库状态
|
/// </summary>
|
[HttpPost("GetPalletOutboundStatus")]
|
public async Task<WebResponseContent> GetPalletOutboundStatus(string palletCode)
|
{
|
return await Service.GetPalletOutboundStatus(palletCode);
|
}
|
|
/// <summary>
|
/// 获取托盘的锁定信息
|
/// </summary>
|
[HttpPost("GetPalletLockInfos")]
|
public async Task<WebResponseContent> GetPalletLockInfos(string palletCode)
|
{
|
var lockInfos = await _outStockLockInfoService.GetPalletLockInfos(palletCode);
|
return WebResponseContent.Instance.OK(null, lockInfos);
|
}
|
|
|
|
[HttpPost("unpicked-list")]
|
public async Task<WebResponseContent> GetUnpickedList([FromBody] ConfirmPickingDto dto)
|
{
|
var lists= await Service.GetUnpickedList(dto.OrderNo, dto.PalletCode);
|
return WebResponseContent.Instance.OK("", lists);
|
}
|
|
[HttpPost("picked-list")]
|
public async Task<WebResponseContent> GetPickedList([FromBody] ConfirmPickingDto dto)
|
{
|
var lists = await Service.GetPickedList(dto.OrderNo, dto.PalletCode);
|
return WebResponseContent.Instance.OK("", lists);
|
}
|
|
[HttpPost("confirm-picking")]
|
public async Task<WebResponseContent> ConfirmPicking([FromBody] ConfirmPickingDto dto)
|
{
|
return await Service.ConfirmPicking(dto.OrderNo, dto.PalletCode, dto.Barcode);
|
}
|
|
[HttpPost("picking-summary")]
|
public async Task<WebResponseContent> GetPickingSummary([FromBody] ConfirmPickingDto dto)
|
{
|
var data = await Service.GetPickingSummary(dto);
|
return WebResponseContent.Instance.OK("", data);
|
}
|
|
[HttpPost("split-package")]
|
public async Task<WebResponseContent> SplitPackage([FromBody] SplitPackageDto dto)
|
{
|
return await _splitPackageService.SplitPackage(dto);
|
|
}
|
|
[HttpPost("revert-split-package")]
|
public async Task<WebResponseContent> RevertSplitPackage([FromBody] RevertSplitDto dto)
|
{
|
return await _splitPackageService.RevertSplitPackage(dto.OriginalBarcode);
|
|
|
}
|
|
[HttpPost("split-package-info")]
|
public async Task<WebResponseContent> GetSplitPackageInfo([FromBody] ConfirmPickingDto dto)
|
{
|
return await _splitPackageService.GetSplitPackageInfo(dto.OrderNo, dto.PalletCode, dto.Barcode);
|
|
}
|
|
|
[HttpPost("return-to-stock")]
|
public async Task<WebResponseContent> ReturnToStock([FromBody] ConfirmPickingDto dto)
|
{
|
return await Service.ReturnRemaining(dto.OrderNo, dto.PalletCode, "");
|
}
|
|
[HttpPost("direct-outbound")]
|
public async Task<WebResponseContent> DirectOutbound([FromBody] DirectOutboundRequest dto)
|
{
|
return await Service.DirectOutbound(dto);
|
|
}
|
|
///// <summary>
|
///// 拣选确认
|
///// </summary>
|
//[HttpPost("ConfirmPicking")]
|
//public async Task<WebResponseContent> ConfirmPicking([FromBody] PickingConfirmRequest request)
|
//{
|
// return await Service.ConfirmPicking(request);
|
//}
|
/// <summary>
|
/// 验证条码并获取物料信息
|
/// </summary>
|
[HttpGet("ValidateBarcode")]
|
public async Task<WebResponseContent> ValidateBarcode(string barcode)
|
{
|
return await Service.ValidateBarcode(barcode);
|
}
|
|
|
///// <summary>
|
///// 直接出库
|
///// </summary>
|
//[HttpPost("DirectOutbound")]
|
//public async Task<WebResponseContent> DirectOutbound([FromBody] DirectOutboundRequest request)
|
//{
|
// return await Service.DirectOutbound(request);
|
//}
|
|
/// <summary>
|
/// 获取拣选历史
|
/// </summary>
|
[HttpGet("GetPickingHistory")]
|
public async Task<WebResponseContent> GetPickingHistory(int orderId)
|
{
|
var history = await Service.GetPickingHistory(orderId);
|
return WebResponseContent.Instance.OK(null, history);
|
}
|
|
/// <summary>
|
/// 撤销拣选
|
/// </summary>
|
[HttpPost("CancelPicking")]
|
public async Task<WebResponseContent> CancelPicking([FromBody] ConfirmPickingDto dto)
|
{
|
return await Service.CancelPicking(dto.OrderNo,dto.PalletCode,dto.Barcode);
|
}
|
}
|
}
|