using System; using System.Collections.Generic; using System.Linq; 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 SUBPICKMTRLController : BaseApiController { private readonly ISUBPICKMTRLService service; public SUBPICKMTRLController(IMapper mapper, ILogger logger, ISUBPICKMTRLService SUBPICKMTRLService) : base(mapper, logger) { service = SUBPICKMTRLService; } /// /// 委外领料 /// /// /// [HttpPost] [Idempotent] public async Task> SUBPICKMTRL([FromBody] InputBarCode request) { return await TryProcess(async input => { RetMessage retMess = await service.SUBPICKMTRL(request); if (retMess == null || retMess.Status == 0) { throw new O3AppException(retMess.Message); } else { return retMess.Data["data"]; } }, LoginInfo); } /// /// 委外退料 /// /// /// [HttpPost] [Idempotent] public async Task> SUBRETURNMTRL([FromBody] InputBarCode request) { return await TryProcess(async input => { RetMessage retMess = await service.SUBRETURNMTRL(request); if (retMess == null || retMess.Status == 0) { throw new O3AppException(retMess.Message); } else { return retMess.Data["data"]; } }, LoginInfo); } } }