diff --git a/src/WMS.Web.Api/Controllers/InventoryController.cs b/src/WMS.Web.Api/Controllers/InventoryController.cs new file mode 100644 index 00000000..938ac8f0 --- /dev/null +++ b/src/WMS.Web.Api/Controllers/InventoryController.cs @@ -0,0 +1,67 @@ +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 +{ + /// + /// 即时库存相关-接口 + /// + [Route("api/[controller]")] + [ApiController] + public class InventoryController : ControllerBase + { + private readonly ILoginService _loginService; + private readonly IInventoryDetailsRepositories _inventoryDetailsRepositories; + private readonly IInventoryInOutDetailsRepositories _inventoryInOutDetailsRepositories; + + public InventoryController(ILoginService loginService, + IInventoryDetailsRepositories inventoryDetailsRepositories, + IInventoryInOutDetailsRepositories inventoryInOutDetailsRepositories) + { + this._loginService = loginService; + this._inventoryDetailsRepositories = inventoryDetailsRepositories; + this._inventoryInOutDetailsRepositories = inventoryInOutDetailsRepositories; + } + + /// + /// 列表-即时库存 + /// + /// + /// + [HttpPost] + [Route("GetList")] + public async Task> GetPagedList([FromBody] InventoryDetailsQueryRequest dto) + { + var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]); + if (loginInfo == null || loginInfo.UserInfo == null) + return ResultPagedList.ReFailure(ResultCodes.Token_Invalid_Error); + var result = await _inventoryDetailsRepositories.GetPagedList(dto); + return result; + } + + /// + /// 列表-物料收发明细 + /// + /// + /// + [HttpPost] + [Route("GetListInOut")] + public async Task> GetPagedListInOut([FromBody] InventoryInOutDetailsQueryRequest dto) + { + var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]); + if (loginInfo == null || loginInfo.UserInfo == null) + return ResultPagedList.ReFailure(ResultCodes.Token_Invalid_Error); + var result = await _inventoryInOutDetailsRepositories.GetPagedList(dto); + return result; + } + } +} diff --git a/src/WMS.Web.Api/wwwroot/WMS.Web.Api.xml b/src/WMS.Web.Api/wwwroot/WMS.Web.Api.xml index 1bac536c..d324c964 100644 --- a/src/WMS.Web.Api/wwwroot/WMS.Web.Api.xml +++ b/src/WMS.Web.Api/wwwroot/WMS.Web.Api.xml @@ -94,6 +94,25 @@ + + + 即时库存相关-接口 + + + + + 列表-即时库存 + + + + + + + 列表-物料收发明细 + + + + 登录接口