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 SUBInStkPickmtlController : BaseApiController { private readonly ISUBInStkPickmtlService service; public SUBInStkPickmtlController(IMapper mapper, ILogger logger, ISUBInStkPickmtlService spotcheckService) : base(mapper, logger) { service = spotcheckService; } /// /// 委外入库 /// /// /// [HttpPost] [Idempotent] public async Task> SUBInStkPickmtl([FromBody] InputBarCode request) { return await TryProcess(async input => { RetMessage retMess = await service.SUBInStkPickmtl(request); if (retMess == null || retMess.Status == 0) { throw new O3AppException(retMess.Message); } else { return retMess.Data["data"]; } }, LoginInfo); } /// /// 委外退货 /// /// /// [HttpPost] [Idempotent] public async Task> SUBOutStkPickmtl([FromBody] InputBarCode request) { return await TryProcess(async input => { RetMessage retMess = await service.SUBOutStkPickmtl(request); if (retMess == null || retMess.Status == 0) { throw new O3AppException(retMess.Message); } else { return retMess.Data["data"]; } }, LoginInfo); } } }