97 lines
3.2 KiB
C#
Executable File
97 lines
3.2 KiB
C#
Executable File
using System.Threading.Tasks;
|
|
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;
|
|
|
|
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
|
{
|
|
/// <summary>
|
|
/// 生产领料,生产退料
|
|
/// </summary>
|
|
[Authorize]
|
|
public class PickMtrlController : BaseApiController<SelBillController>
|
|
{
|
|
private readonly IPickMtrlService _pickMtrlService;
|
|
public PickMtrlController(IMapper mapper, ILogger<SelBillController> logger,IPickMtrlService pickMtrlService)
|
|
:base(mapper, logger)
|
|
{
|
|
_pickMtrlService = pickMtrlService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 生产领料提交
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Idempotent]
|
|
public async Task<BaseResponse<object>> PickMtrlSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMsg = await _pickMtrlService.PickMtrlSubmit(request);
|
|
if (retMsg == null || retMsg.Status == 0)
|
|
{
|
|
throw new O3AppException(retMsg.Message);
|
|
}
|
|
else
|
|
{
|
|
return retMsg.Data["data"];
|
|
}
|
|
}, LoginInfo);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 生产退料提交
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Idempotent]
|
|
public async Task<BaseResponse<object>> ReturnMtrlSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMsg = await _pickMtrlService.ReturnMtrlSubmit(request);
|
|
if (retMsg == null || retMsg.Status == 0)
|
|
{
|
|
throw new O3AppException(retMsg.Message);
|
|
}
|
|
else
|
|
{
|
|
return retMsg.Data["data"];
|
|
}
|
|
}, LoginInfo);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 生产补料提交
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Idempotent]
|
|
public async Task<BaseResponse<object>> FeedMtrlSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMsg = await _pickMtrlService.FeedMtrlSubmit(request);
|
|
if (retMsg == null || retMsg.Status == 0)
|
|
{
|
|
throw new O3AppException(retMsg.Message);
|
|
}
|
|
else
|
|
{
|
|
return retMsg.Data["data"];
|
|
}
|
|
}, LoginInfo);
|
|
}
|
|
}
|
|
}
|