71 lines
2.4 KiB
C#
Executable File
71 lines
2.4 KiB
C#
Executable File
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Opsoft.NetCore.O3App.Domain;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IServices;
|
|
using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.Model;
|
|
using Opsoft.NetCore.O3App.Shared;
|
|
using Opsoft.NetCore.O3App.WebApi.Filters;
|
|
using Opsoft.NetCore.O3App.WebApi.Models;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
|
{
|
|
/// <summary>
|
|
/// 受托加工入库、出库
|
|
/// </summary>
|
|
[Authorize]
|
|
public class OEMInStockController : BaseApiController<OEMInStockController>
|
|
{
|
|
private readonly IOEMInStockService service;
|
|
public OEMInStockController(IMapper mapper, ILogger<OEMInStockController> logger, IOEMInStockService Service)
|
|
: base(mapper, logger)
|
|
{
|
|
service = Service;
|
|
}
|
|
/// <summary>
|
|
/// 受托入库信息
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Idempotent]
|
|
public async Task<BaseResponse<object>> InStockSubmit([FromBody] InputBarCode<BD_BARCODERS5> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.InStockSubmit(request);
|
|
if (retMess == null || retMess.Status == 0)
|
|
{
|
|
throw new O3AppException(retMess.Message);
|
|
}
|
|
else
|
|
{
|
|
return retMess.Data["data"];
|
|
}
|
|
}, LoginInfo);
|
|
}
|
|
/// <summary>
|
|
/// 受托出库信息
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Idempotent]
|
|
public async Task<BaseResponse<object>> RetStockSubmit([FromBody] InputBarCode<BD_BARCODERS5> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.RetStockSubmit(request);
|
|
if (retMess == null || retMess.Status == 0)
|
|
{
|
|
throw new O3AppException(retMess.Message);
|
|
}
|
|
else
|
|
{
|
|
return retMess.Data["data"];
|
|
}
|
|
}, LoginInfo);
|
|
}
|
|
}
|
|
}
|