87 lines
3.6 KiB
C#
87 lines
3.6 KiB
C#
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using WMS.Web.Core.Dto.Inventory;
|
|
using WMS.Web.Core.Internal.Results;
|
|
using WMS.Web.Domain.Infrastructure;
|
|
using WMS.Web.Domain.IService.Public;
|
|
using WMS.Web.Domain.Values;
|
|
|
|
namespace WMS.Web.Api.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 即时库存相关-接口
|
|
/// </summary>
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class InventoryController : ControllerBase
|
|
{
|
|
private readonly ILoginService _loginService;
|
|
private readonly IInventoryDetailsRepositories _inventoryDetailsRepositories;
|
|
private readonly IInventoryInOutDetailsRepositories _inventoryInOutDetailsRepositories;
|
|
private readonly IBoxInventoryRepositories _boxInventoryRepositories;
|
|
|
|
public InventoryController(ILoginService loginService,
|
|
IInventoryDetailsRepositories inventoryDetailsRepositories,
|
|
IInventoryInOutDetailsRepositories inventoryInOutDetailsRepositories,
|
|
IBoxInventoryRepositories boxInventoryRepositories)
|
|
{
|
|
this._loginService = loginService;
|
|
this._inventoryDetailsRepositories = inventoryDetailsRepositories;
|
|
this._inventoryInOutDetailsRepositories = inventoryInOutDetailsRepositories;
|
|
this._boxInventoryRepositories = boxInventoryRepositories;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 列表-即时库存
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("GetList")]
|
|
public async Task<ResultPagedList<InventoryDetailsQueryResponse>> GetPagedList([FromBody] InventoryDetailsQueryRequest dto)
|
|
{
|
|
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
|
if (loginInfo == null || loginInfo.UserInfo == null)
|
|
return ResultPagedList<InventoryDetailsQueryResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
|
var result = await _inventoryDetailsRepositories.GetPagedList(dto);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 列表-物料收发明细
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("GetListInOut")]
|
|
public async Task<ResultPagedList<InventoryInOutDetailsQueryResponse>> GetPagedListInOut([FromBody] InventoryInOutDetailsQueryRequest dto)
|
|
{
|
|
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
|
if (loginInfo == null || loginInfo.UserInfo == null)
|
|
return ResultPagedList<InventoryInOutDetailsQueryResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
|
var result = await _inventoryInOutDetailsRepositories.GetPagedList(dto);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 列表-箱库存明细
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("GetListBox")]
|
|
public async Task<ResultPagedList<BoxInventoryQueryResponse>> GetPagedListBox([FromBody] BoxInventoryQueryRequest dto)
|
|
{
|
|
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
|
if (loginInfo == null || loginInfo.UserInfo == null)
|
|
return ResultPagedList<BoxInventoryQueryResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
|
var result = await _boxInventoryRepositories.GetPagedList(dto);
|
|
return result;
|
|
}
|
|
}
|
|
}
|