208 lines
7.1 KiB
C#
Executable File
208 lines
7.1 KiB
C#
Executable File
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Newtonsoft.Json.Linq;
|
|
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;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
|
{
|
|
/// <summary>
|
|
/// 销售出库
|
|
/// </summary>
|
|
[Authorize]
|
|
public class OutStockController : BaseApiController<SelBillController>
|
|
{
|
|
private readonly IOutStockService service;
|
|
public OutStockController(IMapper mapper, ILogger<SelBillController> logger, IOutStockService spotcheckService)
|
|
: base(mapper, logger)
|
|
{
|
|
service = spotcheckService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 销售出库信息
|
|
/// </summary>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Idempotent]
|
|
public async Task<BaseResponse<object>> SaleOutStockSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.SaleOutStockSubmit(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>> SaleInStockSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.SaleInStockSubmit(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>> SaleOutStockSuitSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.SaleOutStockSuitSubmit(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>> SaleInStockSuitSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.SaleInStockSuitSubmit(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]
|
|
public async Task<BaseResponse<object>> SaleCheckScanSourceBill([FromBody] JObject request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.SaleCheckScanSourceBill(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]
|
|
public async Task<BaseResponse<object>> SaleCheckScanCode([FromBody] JObject request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.SaleCheckScanCode(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]
|
|
public async Task<BaseResponse<object>> SaleCheckTemporaryStorage([FromBody] InputSalCheck<BD_BARCODERS2> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.SaleCheckTemporaryStorage(request.FBILLNO, request.orgID, request.barcodeList);
|
|
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]
|
|
public async Task<BaseResponse<object>> SaleCheckSubmit([FromBody] InputSalCheck<BD_BARCODERS2> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.SaleCheckSubmit(request.FBILLNO,request.orgID,request.barcodeList);
|
|
if (retMess == null || retMess.Status == 0)
|
|
{
|
|
throw new O3AppException(retMess.Message);
|
|
}
|
|
else
|
|
{
|
|
return retMess.Data["data"];
|
|
}
|
|
}, LoginInfo);
|
|
}
|
|
}
|
|
}
|