Files
GX.O3.WMS/APP.O3/WebApi/Controllers/WMS/SUBInStkPickmtlController.cs

76 lines
2.5 KiB
C#
Executable File

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
{
/// <summary>
/// 委外入库/委外退货
/// </summary>
[Authorize]
public class SUBInStkPickmtlController : BaseApiController<SelBillController>
{
private readonly ISUBInStkPickmtlService service;
public SUBInStkPickmtlController(IMapper mapper, ILogger<SelBillController> logger, ISUBInStkPickmtlService spotcheckService)
: base(mapper, logger)
{
service = spotcheckService;
}
/// <summary>
/// 委外入库
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
[HttpPost]
[Idempotent]
public async Task<BaseResponse<object>> SUBInStkPickmtl([FromBody] InputBarCode<BD_BARCODERS2> 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);
}
/// <summary>
/// 委外退货
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
[HttpPost]
[Idempotent]
public async Task<BaseResponse<object>> SUBOutStkPickmtl([FromBody] InputBarCode<BD_BARCODERS2> 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);
}
}
}