移箱列表

This commit is contained in:
18942506660
2023-10-27 09:22:37 +08:00
parent 0d88d4a35c
commit eec8396a91
6 changed files with 100 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
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;
using WMS.Web.Core.Dto.ChangeBoxRecord;
using WMS.Web.Core.Dto.MoveBoxRecord;
using WMS.Web.Core.Internal.Results;
using WMS.Web.Domain.Entitys;
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
{
[Route("api/[controller]")]
[ApiController]
public class MoveBoxRecordController : ControllerBase
{
private readonly IMapper _mapper;
private readonly ILoginService _loginService;
private readonly IMoveBoxRecordRepositories _repositories;
private readonly IChangeMoveBoxService _changeMoveBoxService;
public MoveBoxRecordController(IMapper mapper, ILoginService loginService, IMoveBoxRecordRepositories repositories, IChangeMoveBoxService changeMoveBoxService)
{
_mapper = mapper;
_loginService = loginService;
_repositories = repositories;
_changeMoveBoxService = changeMoveBoxService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
[Route("GetList")]
public async Task<ResultPagedList<MoveBoxRecordQueryInfoResponse>> GetPagedList([FromBody] MoveBoxRecordQueryRequest dto)
{
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
if (loginInfo == null || loginInfo.UserInfo == null)
return ResultPagedList<MoveBoxRecordQueryInfoResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
var (list, count) = await _repositories.GetListAsync(dto);
var result = ResultPagedList<MoveBoxRecordQueryInfoResponse>.ReSuccess(list, count);
return result;
}
/// <summary>
/// 保存
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
[Route("Save")]
public async Task<Result> Save(SaveChangeBoxRecordRequest dto)
{
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
if (loginInfo == null || loginInfo.UserInfo == null)
return Result.ReFailure(ResultCodes.Token_Invalid_Error);
return await _changeMoveBoxService.Save(dto, loginInfo);
}
}
}

View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WMS.Web.Core.Dto.MoveBoxRecord
{
public class MoveBoxRecordQueryInfoResponse
{
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WMS.Web.Core.Dto.MoveBoxRecord
{
/// <summary>
/// 移箱列表请求
/// </summary>
public class MoveBoxRecordQueryRequest : PaginationBaseRequestDto
{
}
}

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using WMS.Web.Core.Dto.MoveBoxRecord;
using WMS.Web.Domain.Entitys; using WMS.Web.Domain.Entitys;
namespace WMS.Web.Domain.Infrastructure namespace WMS.Web.Domain.Infrastructure
@@ -10,5 +11,7 @@ namespace WMS.Web.Domain.Infrastructure
{ {
// 新增 // 新增
Task<MoveBoxRecord> Add(MoveBoxRecord entity, bool isTransaction = true); Task<MoveBoxRecord> Add(MoveBoxRecord entity, bool isTransaction = true);
// 获取销售列表
Task<(List<MoveBoxRecordQueryInfoResponse> list, int total)> GetListAsync(MoveBoxRecordQueryRequest dto);
} }
} }

View File

@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using WMS.Web.Core.Dto.MoveBoxRecord;
using WMS.Web.Domain.Entitys; using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure; using WMS.Web.Domain.Infrastructure;
using WMS.Web.Repositories.Configuration; using WMS.Web.Repositories.Configuration;
@@ -57,5 +58,10 @@ namespace WMS.Web.Repositories
} }
} }
public Task<(List<MoveBoxRecordQueryInfoResponse> list, int total)> GetListAsync(MoveBoxRecordQueryRequest dto)
{
throw new NotImplementedException();
}
} }
} }