调整接口

This commit is contained in:
18942506660
2024-10-15 09:16:02 +08:00
parent 8ef4ce8efa
commit 58aa0408db
5 changed files with 35 additions and 6 deletions

View File

@@ -300,19 +300,21 @@ namespace WMS.Web.Api.Controllers
/// </summary>
/// <param name="billNo"></param>
/// <returns></returns>
[HttpGet]
[Route("GetInfoByNo/{billNo}")]
public async Task<Result<OutStockTaskInfoResponse>> GetInfoByNo([FromRoute] string billNo)
[HttpPost]
[Route("GetInfoByNo")]
public async Task<Result<OutStockTaskInfoResponse>> GetInfoByNo([FromBody] OutStockTaskInfoRequest dto)
{
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
if (loginInfo == null || loginInfo.UserInfo == null)
return Result<OutStockTaskInfoResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
var entity = await _repositories.GetByBillNo(billNo);
var entity = await _repositories.GetByBillNo(dto.BillNo);
if (entity == null)
return Result<OutStockTaskInfoResponse>.ReFailure(ResultCodes.OutStockTaskNoData);
return await _outStockTaskService.GetInfo(entity.Id, loginInfo);
var response = await _outStockTaskService.GetInfo(entity.Id, loginInfo);
response.Data.Details = response.Data.Details.Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToList();
return response;
}
}
}