75 lines
2.5 KiB
C#
Executable File
75 lines
2.5 KiB
C#
Executable File
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;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Opsoft.NetCore.O3App.WebApi.Controllers.WMS
|
|
{
|
|
/// <summary>
|
|
/// 其他入库、出库
|
|
/// </summary>
|
|
[Authorize]
|
|
public class MisInStockController : BaseApiController<MisInStockController>
|
|
{
|
|
private readonly IMisInStockService service;
|
|
public MisInStockController(IMapper mapper, ILogger<MisInStockController> logger, IMisInStockService Service)
|
|
: base(mapper, logger)
|
|
{
|
|
service = Service;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 其他入库信息
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Idempotent]
|
|
public async Task<BaseResponse<object>> MisInStockSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.MisInStockSubmit(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<Dictionary<string, object>>> MisRetStockSubmit([FromBody] InputBarCode<BD_BARCODERS2> request)
|
|
{
|
|
return await TryProcess(async input =>
|
|
{
|
|
RetMessage retMess = await service.MisRetStockSubmit(request);
|
|
if (retMess == null || retMess.Status == 0)
|
|
{
|
|
throw new O3AppException(retMess.Message);
|
|
}
|
|
else
|
|
{
|
|
return retMess.Data;
|
|
}
|
|
}, LoginInfo);
|
|
}
|
|
|
|
}
|
|
}
|