出库任务列表

This commit is contained in:
18942506660
2023-10-28 10:51:38 +08:00
parent 458f9d6a8e
commit ae3d0e0c2f
5 changed files with 215 additions and 1 deletions

View File

@@ -1,9 +1,16 @@
using Microsoft.AspNetCore.Http;
using AutoMapper;
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.OutStockTask;
using WMS.Web.Core.Internal.Results;
using WMS.Web.Domain.Infrastructure;
using WMS.Web.Domain.IService;
using WMS.Web.Domain.IService.Public;
using WMS.Web.Domain.Values;
namespace WMS.Web.Api.Controllers
{
@@ -14,5 +21,34 @@ namespace WMS.Web.Api.Controllers
[ApiController]
public class OutStockTaskController : ControllerBase
{
private readonly IMapper _mapper;
private readonly ILoginService _loginService;
private readonly IOutStockTaskRepositories _repositories;
private readonly IOutStockService _outStockService;
public OutStockTaskController(IMapper mapper, ILoginService loginService,
IOutStockTaskRepositories repositories, IOutStockService outStockService)
{
_mapper = mapper;
_loginService = loginService;
_repositories = repositories;
_outStockService = outStockService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
[Route("GetList")]
public async Task<ResultPagedList<OutStockTaskQueryInfoResponse>> GetPagedList([FromBody] OutStockTaskQueryRequest dto)
{
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
if (loginInfo == null || loginInfo.UserInfo == null)
return ResultPagedList<OutStockTaskQueryInfoResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
var (list, count) = await _repositories.GetListAsync(dto);
var result = ResultPagedList<OutStockTaskQueryInfoResponse>.ReSuccess(list, count);
return result;
}
}
}