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 { /// /// 生产领料,生产退料 /// [Authorize] public class PickMtrlController : BaseApiController { private readonly IPickMtrlService _pickMtrlService; public PickMtrlController(IMapper mapper, ILogger logger,IPickMtrlService pickMtrlService) :base(mapper, logger) { _pickMtrlService = pickMtrlService; } /// /// 生产领料提交 /// /// /// [HttpPost] [Idempotent] public async Task> PickMtrlSubmit([FromBody] InputBarCode 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); } /// /// 生产退料提交 /// /// /// [HttpPost] [Idempotent] public async Task> ReturnMtrlSubmit([FromBody] InputBarCode 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); } /// /// 生产补料提交 /// /// /// [HttpPost] [Idempotent] public async Task> FeedMtrlSubmit([FromBody] InputBarCode 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); } } }