出库单
This commit is contained in:
81
src/WMS.Web.Api/Controllers/OutStockController.cs
Normal file
81
src/WMS.Web.Api/Controllers/OutStockController.cs
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
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.OutStock;
|
||||||
|
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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 出库单
|
||||||
|
/// </summary>
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class OutStockController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
private readonly ILoginService _loginService;
|
||||||
|
private readonly IOutStockRepositories _repositories;
|
||||||
|
private readonly IOutStockService _takeStockService;
|
||||||
|
public OutStockController(IMapper mapper, ILoginService loginService,
|
||||||
|
IOutStockRepositories repositories, IOutStockService takeStockService)
|
||||||
|
{
|
||||||
|
_mapper = mapper;
|
||||||
|
_loginService = loginService;
|
||||||
|
_repositories = repositories;
|
||||||
|
_takeStockService = takeStockService;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Route("GetList")]
|
||||||
|
public async Task<ResultPagedList<OutStockQueryInfoResponse>> GetPagedList([FromBody] OutStockQueryRequest dto)
|
||||||
|
{
|
||||||
|
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||||
|
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||||
|
return ResultPagedList<OutStockQueryInfoResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||||
|
|
||||||
|
var (list, count) = await _repositories.GetListAsync(dto);
|
||||||
|
var result = ResultPagedList<OutStockQueryInfoResponse>.ReSuccess(list, count);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Route("Save")]
|
||||||
|
public async Task<Result> Save(List<SaveOutStockRequest> 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 _takeStockService.Save(dto, loginInfo);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 同步金蝶
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[Route("Sync")]
|
||||||
|
public async Task<Result> Sync([FromRoute] int id)
|
||||||
|
{
|
||||||
|
return Result.ReSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/WMS.Web.Api/Controllers/OutStockTaskController.cs
Normal file
18
src/WMS.Web.Api/Controllers/OutStockTaskController.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WMS.Web.Api.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 出库计划单
|
||||||
|
/// </summary>
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class OutStockTaskController : ControllerBase
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/WMS.Web.Core/Dto/OutStock/OutStockQueryInfoResponse.cs
Normal file
13
src/WMS.Web.Core/Dto/OutStock/OutStockQueryInfoResponse.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Dto.OutStock
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 出库列表详情
|
||||||
|
/// </summary>
|
||||||
|
public class OutStockQueryInfoResponse
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/WMS.Web.Core/Dto/OutStock/OutStockQueryRequest.cs
Normal file
13
src/WMS.Web.Core/Dto/OutStock/OutStockQueryRequest.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Dto.OutStock
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 出库单列表请求
|
||||||
|
/// </summary>
|
||||||
|
public class OutStockQueryRequest : PaginationBaseRequestDto
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/WMS.Web.Core/Dto/OutStock/SaveOutStockRequest.cs
Normal file
13
src/WMS.Web.Core/Dto/OutStock/SaveOutStockRequest.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Dto.OutStock
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 出库单保存
|
||||||
|
/// </summary>
|
||||||
|
public class SaveOutStockRequest
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/WMS.Web.Domain/IService/IOutStockService.cs
Normal file
13
src/WMS.Web.Domain/IService/IOutStockService.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.IService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 出库服务
|
||||||
|
/// </summary>
|
||||||
|
public interface IOutStockService
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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.OutStock;
|
||||||
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<OutStock> Add(OutStock entity, bool isTransaction = true);
|
Task<OutStock> Add(OutStock entity, bool isTransaction = true);
|
||||||
|
// 获取列表
|
||||||
|
Task<(List<OutStockQueryInfoResponse> list, int total)> GetListAsync(OutStockQueryRequest dto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
14
src/WMS.Web.Domain/Services/OutStockService.cs
Normal file
14
src/WMS.Web.Domain/Services/OutStockService.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using WMS.Web.Domain.IService;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 出库服务
|
||||||
|
/// </summary>
|
||||||
|
public class OutStockService: IOutStockService
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -236,6 +236,8 @@ namespace WMS.Web.Repositories.DependencyInjection
|
|||||||
|
|
||||||
Services.AddTransient<IChangeMoveBoxService, ChangeMoveBoxService>();
|
Services.AddTransient<IChangeMoveBoxService, ChangeMoveBoxService>();
|
||||||
Services.AddTransient<ITakeStockService, TakeStockService>();
|
Services.AddTransient<ITakeStockService, TakeStockService>();
|
||||||
|
Services.AddTransient<IOutStockService, OutStockService>();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.OutStock;
|
||||||
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,14 @@ namespace WMS.Web.Repositories
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task<(List<OutStockQueryInfoResponse> list, int total)> GetListAsync(OutStockQueryRequest dto)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user