成品即时库存
This commit is contained in:
Binary file not shown.
101
src/WMS.Web.Api/Controllers/ProductInventoryController.cs
Normal file
101
src/WMS.Web.Api/Controllers/ProductInventoryController.cs
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core.Dto.OutStock;
|
||||||
|
using WMS.Web.Core.Dto.ProductInventory;
|
||||||
|
using WMS.Web.Core.Dto.SingleData;
|
||||||
|
using WMS.Web.Core.Internal.Results;
|
||||||
|
using WMS.Web.Domain.Infrastructure;
|
||||||
|
using WMS.Web.Domain.IService.Public;
|
||||||
|
using WMS.Web.Domain.Services.Public;
|
||||||
|
using WMS.Web.Domain.Values;
|
||||||
|
using WMS.Web.Repositories;
|
||||||
|
using WMS.Web.Core;
|
||||||
|
using WMS.Web.Domain.IService;
|
||||||
|
using WMS.Web.Domain.Options;
|
||||||
|
using Google.Protobuf.WellKnownTypes;
|
||||||
|
using WMS.Web.Domain.Services;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace WMS.Web.Api.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品仓即时库存
|
||||||
|
/// </summary>
|
||||||
|
[Route("api/[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
public class ProductInventoryController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly ILoginService _loginService;
|
||||||
|
private readonly IBasicsRepositories _basicsRepositories;
|
||||||
|
private readonly IProductInventoryRepositories _repositories;
|
||||||
|
private readonly QiniuOptions _option;
|
||||||
|
private readonly IExportExcelService _exportExcelService;
|
||||||
|
public ProductInventoryController(ILoginService loginService, IBasicsRepositories basicsRepositories,
|
||||||
|
IProductInventoryRepositories repositories, IOptions<QiniuOptions> option, IExportExcelService exportExcelServic) {
|
||||||
|
_loginService = loginService;
|
||||||
|
_basicsRepositories = basicsRepositories;
|
||||||
|
_repositories = repositories;
|
||||||
|
_option = option?.Value;
|
||||||
|
_exportExcelService = exportExcelServic;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取仓库
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">仓库模糊匹配 不必填</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
[Route("GetUcStock")]
|
||||||
|
public async Task<ResultList<UcStockHeadOfficeResponse>> GetUcStock([FromQuery] string name)
|
||||||
|
{
|
||||||
|
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||||
|
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||||
|
return ResultList<UcStockHeadOfficeResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||||
|
var r = await _basicsRepositories.GetUcStockByHeadOfficeAsync(name, loginInfo.UserInfo.CompanyId);
|
||||||
|
return ResultList<UcStockHeadOfficeResponse>.ReSuccess(r);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Route("GetList")]
|
||||||
|
public async Task<ResultPagedNumber2List<ProductInventoryQueryResponse>> GetPagedList([FromBody] ProductInventoryQueryRequest dto)
|
||||||
|
{
|
||||||
|
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||||
|
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||||
|
return ResultPagedNumber2List<ProductInventoryQueryResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||||
|
|
||||||
|
var (list, count, details) = await _repositories.GetListAsync(dto);
|
||||||
|
var result = ResultPagedNumber2List<ProductInventoryQueryResponse>.ReSuccess(list,count,details);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 导出
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[Route("Export")]
|
||||||
|
public Task<Result<string>> Export([FromBody] OutStockQueryRequest dto)
|
||||||
|
{
|
||||||
|
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||||
|
if (loginInfo == null)
|
||||||
|
return Task.FromResult(Result<string>.ReFailure(ResultCodes.Token_Invalid_Error));
|
||||||
|
string fileName = FileDownLoadOrderType.ProductInventory.GetRemark() + loginInfo.UserInfo.CompanyId + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx";
|
||||||
|
string res = _option.Url + fileName;
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
await _exportExcelService.ExportList<OutStockQueryInfoResponse, OutStockQueryRequest>(dto, fileName, loginInfo.UserInfo.StaffId, loginInfo.UserInfo.CompanyId, FileDownLoadOrderType.OutStock);
|
||||||
|
});
|
||||||
|
|
||||||
|
return Task.FromResult(Result<string>.ReSuccess(res));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -560,6 +560,32 @@
|
|||||||
<param name="id"></param>
|
<param name="id"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Api.Controllers.ProductInventoryController">
|
||||||
|
<summary>
|
||||||
|
成品仓即时库存
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Api.Controllers.ProductInventoryController.GetUcStock(System.String)">
|
||||||
|
<summary>
|
||||||
|
获取仓库
|
||||||
|
</summary>
|
||||||
|
<param name="name">仓库模糊匹配 不必填</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Api.Controllers.ProductInventoryController.GetPagedList(WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryRequest)">
|
||||||
|
<summary>
|
||||||
|
列表
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Api.Controllers.ProductInventoryController.Export(WMS.Web.Core.Dto.OutStock.OutStockQueryRequest)">
|
||||||
|
<summary>
|
||||||
|
导出
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:WMS.Web.Api.Controllers.SerialNumberController.Get(System.String)">
|
<member name="M:WMS.Web.Api.Controllers.SerialNumberController.Get(System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
获取序列号信息
|
获取序列号信息
|
||||||
|
|||||||
@@ -5534,6 +5534,86 @@
|
|||||||
每页条数 不传默认每页10 条
|
每页条数 不传默认每页10 条
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryRequest">
|
||||||
|
<summary>
|
||||||
|
成品即时库存列表
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryRequest.MaterialNumber">
|
||||||
|
<summary>
|
||||||
|
物料编码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryRequest.StockCode">
|
||||||
|
<summary>
|
||||||
|
仓库编码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryRequest.Customer">
|
||||||
|
<summary>
|
||||||
|
客户/店铺
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse">
|
||||||
|
<summary>
|
||||||
|
成品即时库存
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse.Id">
|
||||||
|
<summary>
|
||||||
|
单据Id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse.Type">
|
||||||
|
<summary>
|
||||||
|
单据类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse.MaterialNumber">
|
||||||
|
<summary>
|
||||||
|
物料编码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse.Specifications">
|
||||||
|
<summary>
|
||||||
|
物料规格型号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse.MaterialName">
|
||||||
|
<summary>
|
||||||
|
物料名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse.Stock">
|
||||||
|
<summary>
|
||||||
|
仓库
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse.Org">
|
||||||
|
<summary>
|
||||||
|
组织
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse.Customer">
|
||||||
|
<summary>
|
||||||
|
客户/店铺
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse.Batch">
|
||||||
|
<summary>
|
||||||
|
批号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse.Qty">
|
||||||
|
<summary>
|
||||||
|
可用量
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryResponse.BeforeQty">
|
||||||
|
<summary>
|
||||||
|
库存量
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:WMS.Web.Core.Dto.SendDataDto.CustomerCode">
|
<member name="P:WMS.Web.Core.Dto.SendDataDto.CustomerCode">
|
||||||
<summary>
|
<summary>
|
||||||
客户编码
|
客户编码
|
||||||
@@ -5824,6 +5904,26 @@
|
|||||||
仓库名称
|
仓库名称
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Core.Dto.SingleData.UcStockHeadOfficeResponse">
|
||||||
|
<summary>
|
||||||
|
根据总公司查仓库
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.SingleData.UcStockHeadOfficeResponse.WarehouseCodeOfLingxing">
|
||||||
|
<summary>
|
||||||
|
领星仓库编码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.SingleData.UcStockHeadOfficeResponse.WarehouseCodeOfJushuitan">
|
||||||
|
<summary>
|
||||||
|
聚水潭仓库编码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.SingleData.UcStockHeadOfficeResponse.WarehouseUseTo">
|
||||||
|
<summary>
|
||||||
|
用途
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Core.Dto.SingleData.UcStockResponse">
|
<member name="T:WMS.Web.Core.Dto.SingleData.UcStockResponse">
|
||||||
<summary>
|
<summary>
|
||||||
仓库响应
|
仓库响应
|
||||||
@@ -6817,6 +6917,78 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumber2List`1.#ctor">
|
||||||
|
<summary>
|
||||||
|
实体分页集合结果
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumber2List`1.#ctor(System.Collections.Generic.IList{`0},System.Int32,System.Collections.Generic.List{System.Decimal})">
|
||||||
|
<summary>
|
||||||
|
实体分页集合结果
|
||||||
|
</summary>
|
||||||
|
<param name="data">实体集合</param>
|
||||||
|
<param name="totalCount">总条数</param>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumber2List`1.#ctor(System.Collections.Generic.IList{`0},System.Int32,System.ValueTuple{System.Int32,System.String})">
|
||||||
|
<summary>
|
||||||
|
实体分页集合结果
|
||||||
|
</summary>
|
||||||
|
<param name="data"></param>
|
||||||
|
<param name="totalCount"></param>
|
||||||
|
<param name="result"></param>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Internal.Results.ResultPagedNumber2List`1.TotalCount">
|
||||||
|
<summary>
|
||||||
|
Total count of Items.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Internal.Results.ResultPagedNumber2List`1.Details">
|
||||||
|
<summary>
|
||||||
|
总数量
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumber2List`1.ReSuccess(System.Collections.Generic.IList{`0},System.Int32,System.Collections.Generic.List{System.Decimal})">
|
||||||
|
<summary>
|
||||||
|
创建成功的返回消息
|
||||||
|
</summary>
|
||||||
|
<param name="data">实体集合</param>
|
||||||
|
<param name="totalCount">总条数</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumber2List`1.ReSuccess">
|
||||||
|
<summary>
|
||||||
|
创建成功的返回消息
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumber2List`1.ReFailure(System.String,System.Int32)">
|
||||||
|
<summary>
|
||||||
|
创建返回信息(返回处理失败)
|
||||||
|
</summary>
|
||||||
|
<param name="message">结果消息</param>
|
||||||
|
<param name="status">结果状态</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumber2List`1.ReFailure(System.ValueTuple{System.Int32,System.String})">
|
||||||
|
<summary>
|
||||||
|
创建返回信息(返回处理失败)
|
||||||
|
</summary>
|
||||||
|
<param name="result">结果消息</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumber2List`1.ReFailure(WMS.Web.Core.Internal.Results.Result)">
|
||||||
|
<summary>
|
||||||
|
创建返回信息(返回处理失败)
|
||||||
|
</summary>
|
||||||
|
<param name="result">结果</param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumber2List`1.AsTask">
|
||||||
|
<summary>
|
||||||
|
转换为 task
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Core.Internal.Results.ResultPagedNumberList`1">
|
<member name="T:WMS.Web.Core.Internal.Results.ResultPagedNumberList`1">
|
||||||
<summary>
|
<summary>
|
||||||
分页列表结果对象
|
分页列表结果对象
|
||||||
|
|||||||
@@ -2075,6 +2075,56 @@
|
|||||||
已出库数量
|
已出库数量
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Domain.Entitys.ProductInventory">
|
||||||
|
<summary>
|
||||||
|
成品仓即时库存
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.ProductInventory.Id">
|
||||||
|
<summary>
|
||||||
|
主键 订单编号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.ProductInventory.MaterialNumber">
|
||||||
|
<summary>
|
||||||
|
物料编码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.ProductInventory.Type">
|
||||||
|
<summary>
|
||||||
|
单据类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.ProductInventory.OrgCode">
|
||||||
|
<summary>
|
||||||
|
组织编码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.ProductInventory.StockCode">
|
||||||
|
<summary>
|
||||||
|
仓库
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.ProductInventory.Customer">
|
||||||
|
<summary>
|
||||||
|
客户/店铺
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.ProductInventory.Batch">
|
||||||
|
<summary>
|
||||||
|
批号
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.ProductInventory.Qty">
|
||||||
|
<summary>
|
||||||
|
可用量
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:WMS.Web.Domain.Entitys.ProductInventory.BeforeQty">
|
||||||
|
<summary>
|
||||||
|
库存量
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Entitys.SendLog">
|
<member name="T:WMS.Web.Domain.Entitys.SendLog">
|
||||||
<summary>
|
<summary>
|
||||||
短信和邮箱发送日志表
|
短信和邮箱发送日志表
|
||||||
@@ -2676,6 +2726,12 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Infrastructure.IBasicsRepositories.GetUcStockByHeadOfficeAsync(System.String,System.Int32)">
|
||||||
|
<summary>
|
||||||
|
获取仓库总公司
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.Infrastructure.IBasicsRepositories.GetTransaction">
|
<member name="M:WMS.Web.Domain.Infrastructure.IBasicsRepositories.GetTransaction">
|
||||||
<summary>
|
<summary>
|
||||||
获取事务 用来处理即时库存
|
获取事务 用来处理即时库存
|
||||||
@@ -3364,6 +3420,34 @@
|
|||||||
<member name="M:WMS.Web.Domain.Infrastructure.IOutStockTaskRepositories.DeleteEntityList(System.Collections.Generic.List{System.Int32},System.Boolean)">
|
<member name="M:WMS.Web.Domain.Infrastructure.IOutStockTaskRepositories.DeleteEntityList(System.Collections.Generic.List{System.Int32},System.Boolean)">
|
||||||
删除实体集合
|
删除实体集合
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Domain.Infrastructure.IProductInventoryRepositories">
|
||||||
|
<summary>
|
||||||
|
成品仓即时库存
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Infrastructure.IProductInventoryRepositories.AddRange(System.Collections.Generic.List{WMS.Web.Domain.Entitys.ProductInventory},System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
添加
|
||||||
|
</summary>
|
||||||
|
<param name="entitys"></param>
|
||||||
|
<param name="isTransaction"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Infrastructure.IProductInventoryRepositories.Delete(WMS.Web.Domain.Values.ProductInventoryType,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
删除
|
||||||
|
</summary>
|
||||||
|
<param name="isTransaction"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:WMS.Web.Domain.Infrastructure.IProductInventoryRepositories.GetListAsync(WMS.Web.Core.Dto.ProductInventory.ProductInventoryQueryRequest,System.Int32)">
|
||||||
|
<summary>
|
||||||
|
列表-分页
|
||||||
|
</summary>
|
||||||
|
<param name="dto"></param>
|
||||||
|
<param name="companyId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:WMS.Web.Domain.Infrastructure.ISerialNumberOperateRepositories.AddRange(System.Collections.Generic.List{WMS.Web.Domain.Entitys.SerialNumberOperate},System.Boolean)">
|
<member name="M:WMS.Web.Domain.Infrastructure.ISerialNumberOperateRepositories.AddRange(System.Collections.Generic.List{WMS.Web.Domain.Entitys.SerialNumberOperate},System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
批量添加
|
批量添加
|
||||||
@@ -6918,6 +7002,11 @@
|
|||||||
出库信息
|
出库信息
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.FileDownLoadOrderType.ProductInventory">
|
||||||
|
<summary>
|
||||||
|
成品即时库存
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Values.InstockStatus">
|
<member name="T:WMS.Web.Domain.Values.InstockStatus">
|
||||||
<summary>
|
<summary>
|
||||||
入库状态
|
入库状态
|
||||||
@@ -7163,6 +7252,26 @@
|
|||||||
组装拆卸出库
|
组装拆卸出库
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:WMS.Web.Domain.Values.ProductInventoryType">
|
||||||
|
<summary>
|
||||||
|
成品即时库存类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.ProductInventoryType.JinDie">
|
||||||
|
<summary>
|
||||||
|
金蝶
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.ProductInventoryType.LingXing">
|
||||||
|
<summary>
|
||||||
|
领星
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.ProductInventoryType.JushuiTan">
|
||||||
|
<summary>
|
||||||
|
聚水潭
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Values.ResultCodes">
|
<member name="T:WMS.Web.Domain.Values.ResultCodes">
|
||||||
<summary>
|
<summary>
|
||||||
错误提示信息
|
错误提示信息
|
||||||
@@ -7713,6 +7822,11 @@
|
|||||||
获取仓位详情:根据仓位Codes集合和公司ID
|
获取仓位详情:根据仓位Codes集合和公司ID
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:WMS.Web.Domain.Values.Single.SysConfigAction.GetWmsWarehouseByHeadOfficeAndNameAndCompany">
|
||||||
|
<summary>
|
||||||
|
获取仓库::根据总公司标记获取仓库
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Domain.Values.SyncStatus">
|
<member name="T:WMS.Web.Domain.Values.SyncStatus">
|
||||||
<summary>
|
<summary>
|
||||||
同步金蝶状态
|
同步金蝶状态
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Dto.ProductInventory
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品即时库存列表
|
||||||
|
/// </summary>
|
||||||
|
public class ProductInventoryQueryRequest : PaginationBaseRequestDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编码
|
||||||
|
///</summary>
|
||||||
|
public string MaterialNumber { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 仓库编码
|
||||||
|
///</summary>
|
||||||
|
public string StockCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 客户/店铺
|
||||||
|
///</summary>
|
||||||
|
public string Customer { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
using Npoi.Mapper.Attributes;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Dto.ProductInventory
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品即时库存
|
||||||
|
/// </summary>
|
||||||
|
public class ProductInventoryQueryResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 单据Id
|
||||||
|
/// </summary>
|
||||||
|
[Ignore]
|
||||||
|
public int Id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 单据类型
|
||||||
|
/// </summary>
|
||||||
|
[Ignore]
|
||||||
|
public string Type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编码
|
||||||
|
/// </summary>
|
||||||
|
[Column("物料编码")]
|
||||||
|
public string MaterialNumber { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料规格型号
|
||||||
|
/// </summary>
|
||||||
|
[Column("规格型号")]
|
||||||
|
public string Specifications { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料名称
|
||||||
|
/// </summary>
|
||||||
|
[Column("物料名称")]
|
||||||
|
public string MaterialName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 仓库
|
||||||
|
///</summary>
|
||||||
|
[Column("仓库")]
|
||||||
|
public string Stock { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 组织
|
||||||
|
///</summary>
|
||||||
|
[Column("组织")]
|
||||||
|
public string Org { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 客户/店铺
|
||||||
|
///</summary>
|
||||||
|
[Column("客户/店铺")]
|
||||||
|
public string Customer { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 批号
|
||||||
|
///</summary>
|
||||||
|
[Column("批号")]
|
||||||
|
public string Batch { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 可用量
|
||||||
|
///</summary>
|
||||||
|
[Column("可用量")]
|
||||||
|
public decimal Qty { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
/// 库存量
|
||||||
|
///</summary>
|
||||||
|
[Column("库存量")]
|
||||||
|
public decimal BeforeQty { get; set; } = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
26
src/WMS.Web.Core/Dto/SingleData/UcStockHeadOfficeResponse.cs
Normal file
26
src/WMS.Web.Core/Dto/SingleData/UcStockHeadOfficeResponse.cs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Dto.SingleData
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 根据总公司查仓库
|
||||||
|
/// </summary>
|
||||||
|
public class UcStockHeadOfficeResponse: UcStockResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 领星仓库编码
|
||||||
|
/// </summary>
|
||||||
|
public string WarehouseCodeOfLingxing { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 聚水潭仓库编码
|
||||||
|
/// </summary>
|
||||||
|
public string WarehouseCodeOfJushuitan { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 用途
|
||||||
|
/// </summary>
|
||||||
|
public int? WarehouseUseTo { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
114
src/WMS.Web.Core/Internal/Results/ResultPagedNumber2List.cs
Normal file
114
src/WMS.Web.Core/Internal/Results/ResultPagedNumber2List.cs
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WMS.Web.Core.Internal.Results
|
||||||
|
{
|
||||||
|
public class ResultPagedNumber2List<T> : ResultList<T>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 实体分页集合结果
|
||||||
|
/// </summary>
|
||||||
|
public ResultPagedNumber2List()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 实体分页集合结果
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data">实体集合</param>
|
||||||
|
/// <param name="totalCount">总条数</param>
|
||||||
|
public ResultPagedNumber2List(IList<T> data, int totalCount, List<decimal> details) : base(data)
|
||||||
|
{
|
||||||
|
TotalCount = totalCount;
|
||||||
|
Details = details;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 实体分页集合结果
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <param name="totalCount"></param>
|
||||||
|
/// <param name="result"></param>
|
||||||
|
public ResultPagedNumber2List(IList<T> data, int totalCount, ValueTuple<int, string> result) : base(data, result)
|
||||||
|
{
|
||||||
|
TotalCount = totalCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Total count of Items.
|
||||||
|
/// </summary>
|
||||||
|
public int TotalCount { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 总数量
|
||||||
|
/// </summary>
|
||||||
|
public List<decimal> Details { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建成功的返回消息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data">实体集合</param>
|
||||||
|
/// <param name="totalCount">总条数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static ResultPagedNumber2List<T> ReSuccess(IList<T> data, int totalCount, List<decimal> details)
|
||||||
|
{
|
||||||
|
return new ResultPagedNumber2List<T>(data, totalCount, details);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建成功的返回消息
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public new static ResultPagedNumber2List<T> ReSuccess()
|
||||||
|
{
|
||||||
|
return new ResultPagedNumber2List<T>(new List<T>(), 0, new List<decimal>());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建返回信息(返回处理失败)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message">结果消息</param>
|
||||||
|
/// <param name="status">结果状态</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public new static ResultPagedNumber2List<T> ReFailure(string message, int status)
|
||||||
|
{
|
||||||
|
var result = new ResultPagedNumber2List<T>();
|
||||||
|
result.To(message, status);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建返回信息(返回处理失败)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="result">结果消息</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public new static ResultPagedNumber2List<T> ReFailure(ValueTuple<int, string> result)
|
||||||
|
{
|
||||||
|
var res = new ResultPagedNumber2List<T>();
|
||||||
|
res.To(result);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建返回信息(返回处理失败)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="result">结果</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public new static ResultPagedNumber2List<T> ReFailure(Result result)
|
||||||
|
{
|
||||||
|
var re = new ResultPagedNumber2List<T>();
|
||||||
|
re.To(result);
|
||||||
|
return re;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 转换为 task
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public new Task<ResultPagedNumber2List<T>> AsTask()
|
||||||
|
{
|
||||||
|
return Task.FromResult(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
64
src/WMS.Web.Domain/Entitys/ProductInventory.cs
Normal file
64
src/WMS.Web.Domain/Entitys/ProductInventory.cs
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Text;
|
||||||
|
using WMS.Web.Core;
|
||||||
|
using WMS.Web.Domain.Values;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Entitys
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品仓即时库存
|
||||||
|
/// </summary>
|
||||||
|
[Serializable]
|
||||||
|
[Table("t_wms_product_inventory")]
|
||||||
|
public class ProductInventory : EntityBase
|
||||||
|
{
|
||||||
|
public ProductInventory() { }
|
||||||
|
/// <summary>
|
||||||
|
/// 主键 订单编号
|
||||||
|
/// </summary>
|
||||||
|
[Column("Id")]
|
||||||
|
public override int Id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编码
|
||||||
|
/// </summary>
|
||||||
|
[Column("MaterialNumber")]
|
||||||
|
public string MaterialNumber { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 单据类型
|
||||||
|
/// </summary>
|
||||||
|
[Column("Type")]
|
||||||
|
public ProductInventoryType Type { get; set; } = ProductInventoryType.JinDie;
|
||||||
|
/// <summary>
|
||||||
|
/// 组织编码
|
||||||
|
///</summary>
|
||||||
|
[Column("OrgCode")]
|
||||||
|
public string OrgCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 仓库
|
||||||
|
///</summary>
|
||||||
|
[Column("StockCode")]
|
||||||
|
public string StockCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 客户/店铺
|
||||||
|
///</summary>
|
||||||
|
[Column("Customer")]
|
||||||
|
public string Customer { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 批号
|
||||||
|
///</summary>
|
||||||
|
[Column("Batch")]
|
||||||
|
public string Batch { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 可用量
|
||||||
|
///</summary>
|
||||||
|
[Column("Qty")]
|
||||||
|
public decimal Qty { get; set; } = 0;
|
||||||
|
/// <summary>
|
||||||
|
/// 库存量
|
||||||
|
///</summary>
|
||||||
|
[Column("BeforeQty")]
|
||||||
|
public decimal BeforeQty { get; set; } = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -71,6 +71,11 @@ namespace WMS.Web.Domain.Infrastructure
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<UcStockResponse>> GetUcStockAsync(string systemCode,string name, int companyId);
|
Task<List<UcStockResponse>> GetUcStockAsync(string systemCode,string name, int companyId);
|
||||||
|
/// <summary>
|
||||||
|
/// 获取仓库总公司
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<UcStockHeadOfficeResponse>> GetUcStockByHeadOfficeAsync(string name, int companyId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取事务 用来处理即时库存
|
/// 获取事务 用来处理即时库存
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core.Dto.Inventory;
|
||||||
|
using WMS.Web.Core.Dto.ProductInventory;
|
||||||
|
using WMS.Web.Domain.Entitys;
|
||||||
|
using WMS.Web.Domain.IService.Public;
|
||||||
|
using WMS.Web.Domain.Values;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Infrastructure
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品仓即时库存
|
||||||
|
/// </summary>
|
||||||
|
public interface IProductInventoryRepositories
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 添加
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entitys"></param>
|
||||||
|
/// <param name="isTransaction"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> AddRange(List<ProductInventory> entitys, bool isTransaction = true);
|
||||||
|
/// <summary>
|
||||||
|
/// 删除
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="isTransaction"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> Delete(ProductInventoryType type, bool isTransaction = true);
|
||||||
|
/// <summary>
|
||||||
|
/// 列表-分页
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <param name="companyId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<(List<ProductInventoryQueryResponse> list, int total, List<decimal> details)> GetListAsync(ProductInventoryQueryRequest dto, int companyId = 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -70,5 +70,11 @@ namespace WMS.Web.Domain.Values
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[EnumRemark("出库信息")]
|
[EnumRemark("出库信息")]
|
||||||
OutStockTaskInfo = 12,
|
OutStockTaskInfo = 12,
|
||||||
|
/// <summary>
|
||||||
|
/// 成品即时库存
|
||||||
|
/// </summary>
|
||||||
|
[EnumRemark("成品即时库存")]
|
||||||
|
ProductInventory = 13,
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
29
src/WMS.Web.Domain/Values/ProductInventoryType.cs
Normal file
29
src/WMS.Web.Domain/Values/ProductInventoryType.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using WMS.Web.Core;
|
||||||
|
|
||||||
|
namespace WMS.Web.Domain.Values
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品即时库存类型
|
||||||
|
/// </summary>
|
||||||
|
public enum ProductInventoryType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 金蝶
|
||||||
|
/// </summary>
|
||||||
|
[EnumRemark("金蝶")]
|
||||||
|
JinDie = 0,
|
||||||
|
/// <summary>
|
||||||
|
/// 领星
|
||||||
|
/// </summary>
|
||||||
|
[EnumRemark("领星")]
|
||||||
|
LingXing = 1,
|
||||||
|
/// <summary>
|
||||||
|
/// 聚水潭
|
||||||
|
/// </summary>
|
||||||
|
[EnumRemark("聚水潭")]
|
||||||
|
JushuiTan = 2,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -211,5 +211,9 @@ namespace WMS.Web.Domain.Values.Single
|
|||||||
/// 获取仓位详情:根据仓位Codes集合和公司ID
|
/// 获取仓位详情:根据仓位Codes集合和公司ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
GetWmsSubWarehouseByCodesAndCompany = 48,
|
GetWmsSubWarehouseByCodesAndCompany = 48,
|
||||||
|
/// <summary>
|
||||||
|
/// 获取仓库::根据总公司标记获取仓库
|
||||||
|
/// </summary>
|
||||||
|
GetWmsWarehouseByHeadOfficeAndNameAndCompany = 49,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,20 @@ namespace WMS.Web.Repositories
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 根据总公司获取仓位
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <param name="companyId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<List<UcStockHeadOfficeResponse>> GetUcStockByHeadOfficeAsync(string name, int companyId)
|
||||||
|
{
|
||||||
|
var result = await _singleDataService.GetSysConfigData<ResultList<UcStockHeadOfficeResponse>, SystemCodeRequest>
|
||||||
|
(new SystemCodeRequest("", name, companyId),
|
||||||
|
SysConfigAction.GetWmsWarehouseByHeadOfficeAndNameAndCompany);
|
||||||
|
if (!result.Success)
|
||||||
|
return null;
|
||||||
|
return result.Data.ToList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -414,8 +414,16 @@ namespace WMS.Web.Repositories.Configuration
|
|||||||
.SetValueComparer(valueComparer); ;
|
.SetValueComparer(valueComparer); ;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//成品即时库存
|
||||||
|
builder.Entity<ProductInventory>(ent =>
|
||||||
|
{
|
||||||
|
ent.ToTable("t_wms_product_inventory");
|
||||||
|
ent.HasKey(x => x.Id);
|
||||||
|
});
|
||||||
|
|
||||||
base.OnModelCreating(builder);
|
base.OnModelCreating(builder);
|
||||||
}
|
}
|
||||||
|
public DbSet<ProductInventory> ProductInventory { get; set; }
|
||||||
public DbSet<Materials> Materials { get; set; }
|
public DbSet<Materials> Materials { get; set; }
|
||||||
public DbSet<BoxMarkBillNo> BoxMarkBillNo { get; set; }
|
public DbSet<BoxMarkBillNo> BoxMarkBillNo { get; set; }
|
||||||
public DbSet<BoxMark> BoxMark { get; set; }
|
public DbSet<BoxMark> BoxMark { get; set; }
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||||||
services.AddTransient<IMaterialsRepositories, MaterialsRepositories>();
|
services.AddTransient<IMaterialsRepositories, MaterialsRepositories>();
|
||||||
|
|
||||||
services.AddTransient<ISubscribeNotificationRepositories, SubscribeNotificationRepositories>();
|
services.AddTransient<ISubscribeNotificationRepositories, SubscribeNotificationRepositories>();
|
||||||
|
services.AddTransient<IProductInventoryRepositories, ProductInventoryRepositories>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
177
src/WMS.Web.Repositories/ProductInventoryRepositories.cs
Normal file
177
src/WMS.Web.Repositories/ProductInventoryRepositories.cs
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using WMS.Web.Core.Dto.Erp.Customer;
|
||||||
|
using WMS.Web.Core.Dto.Erp.Org;
|
||||||
|
using WMS.Web.Core.Dto.Erp;
|
||||||
|
using WMS.Web.Core.Dto.ProductInventory;
|
||||||
|
using WMS.Web.Domain.Entitys;
|
||||||
|
using WMS.Web.Domain.Infrastructure;
|
||||||
|
using WMS.Web.Domain.IService.Public;
|
||||||
|
using WMS.Web.Domain.Values;
|
||||||
|
using WMS.Web.Repositories.Configuration;
|
||||||
|
using WMS.Web.Core.Dto.OutStockTask;
|
||||||
|
using WMS.Web.Domain.Values.Single;
|
||||||
|
using WMS.Web.Core;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
|
||||||
|
namespace WMS.Web.Repositories
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品仓即时库存
|
||||||
|
/// </summary>
|
||||||
|
public class ProductInventoryRepositories : IAllFielRepositories<ProductInventoryQueryRequest>, IProductInventoryRepositories
|
||||||
|
{
|
||||||
|
private readonly IMapper _mapper;
|
||||||
|
private readonly IServiceProvider _serviceProvider;
|
||||||
|
private readonly ILoginRepositories _loginRepositories;
|
||||||
|
private readonly IBasicsRepositories _basicsRepositories;
|
||||||
|
private readonly RepositoryDbContext _context;
|
||||||
|
private readonly IErpService _erpService;
|
||||||
|
private readonly ISingleDataService _singleDataService;
|
||||||
|
private readonly IErpBasicDataExtendService _erpBasicDataExtendService;
|
||||||
|
|
||||||
|
public ProductInventoryRepositories(RepositoryDbContext context,
|
||||||
|
IMapper mapper,
|
||||||
|
IErpService erpService,
|
||||||
|
IBasicsRepositories basicsRepositories,
|
||||||
|
ILoginRepositories loginRepositories,
|
||||||
|
IServiceProvider serviceProvider,
|
||||||
|
ISingleDataService singleDataService,
|
||||||
|
IErpBasicDataExtendService erpBasicDataExtendService)
|
||||||
|
{
|
||||||
|
_erpService = erpService;
|
||||||
|
_context = context;
|
||||||
|
_mapper = mapper;
|
||||||
|
_basicsRepositories = basicsRepositories;
|
||||||
|
_serviceProvider = serviceProvider;
|
||||||
|
_loginRepositories = loginRepositories;
|
||||||
|
_singleDataService = singleDataService;
|
||||||
|
_erpBasicDataExtendService = erpBasicDataExtendService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> AddRange(List<ProductInventory> entitys, bool isTransaction = true)
|
||||||
|
{
|
||||||
|
IDbContextTransaction _transaction = null;
|
||||||
|
if (isTransaction)
|
||||||
|
_transaction = _context.Database.BeginTransaction();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (entitys != null && entitys.Count != 0)
|
||||||
|
{
|
||||||
|
await _context.ProductInventory.AddRangeAsync(entitys);
|
||||||
|
await _context.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
if (_transaction != null)
|
||||||
|
_transaction.Commit();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
if (_transaction != null)
|
||||||
|
_transaction.Rollback();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> Delete(ProductInventoryType type, bool isTransaction = true)
|
||||||
|
{
|
||||||
|
IDbContextTransaction _transaction = null;
|
||||||
|
if (isTransaction)
|
||||||
|
_transaction = _context.Database.BeginTransaction();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var list = await _context.ProductInventory.Where(w => w.Type == type).ToListAsync();
|
||||||
|
_context.RemoveRange(list);
|
||||||
|
|
||||||
|
if (_transaction != null)
|
||||||
|
_transaction.Commit();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
if (_transaction != null)
|
||||||
|
_transaction.Rollback();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<(List<ProductInventoryQueryResponse> list, int total, List<decimal> details)> GetListAsync(ProductInventoryQueryRequest dto, int companyId = 0)
|
||||||
|
{
|
||||||
|
if (companyId == 0)
|
||||||
|
companyId = _loginRepositories.CompanyId;
|
||||||
|
#region erp基础资料
|
||||||
|
List<string> mNumber = new List<string>();
|
||||||
|
var materials_result = await _erpService.BillQueryForMaterial();
|
||||||
|
List<ErpMaterialDto> materials = new List<ErpMaterialDto>();
|
||||||
|
if (materials_result.IsSuccess)
|
||||||
|
materials = materials_result.Data.ToList();
|
||||||
|
//物料集合;模糊查询后的物料集合
|
||||||
|
if (!string.IsNullOrEmpty(dto.MaterialNumber))
|
||||||
|
{
|
||||||
|
if (materials != null)
|
||||||
|
mNumber = materials.Where(w => w.MaterialNumber.Contains(dto.MaterialNumber)
|
||||||
|
|| w.MaterialName.Contains(dto.MaterialNumber)
|
||||||
|
|| w.Specifications.Contains(dto.MaterialNumber)
|
||||||
|
).Select(s => s.MaterialNumber).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//取组织
|
||||||
|
var org_result = await _erpService.BillQueryForOrg();
|
||||||
|
List<ErpOrgDto> orgs = new List<ErpOrgDto>();
|
||||||
|
if (org_result.IsSuccess)
|
||||||
|
orgs = org_result.Data.ToList();
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
var query = _context.ProductInventory
|
||||||
|
.OrderByDescending(o => o.Id)
|
||||||
|
.Where(adv => 1 == 1);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(dto.MaterialNumber))
|
||||||
|
query = query.Where(w => mNumber.Contains(w.MaterialNumber));
|
||||||
|
if (!string.IsNullOrEmpty(dto.Customer))
|
||||||
|
query = query.Where(w => dto.Customer.Contains(w.MaterialNumber));
|
||||||
|
if (!string.IsNullOrEmpty(dto.StockCode))
|
||||||
|
query = query.Where(w => dto.StockCode.Contains(w.StockCode));
|
||||||
|
|
||||||
|
//组装
|
||||||
|
int total = await query.CountAsync();
|
||||||
|
decimal qty = await query.SumAsync(s => s.Qty);
|
||||||
|
decimal beforeQty = await query.SumAsync(s => s.BeforeQty);
|
||||||
|
List<decimal> details = new List<decimal>();
|
||||||
|
details.Add(qty);
|
||||||
|
details.Add(beforeQty);
|
||||||
|
var list = await query.Select(s => new ProductInventoryQueryResponse()
|
||||||
|
{
|
||||||
|
#region dto组装
|
||||||
|
Id = s.Id,
|
||||||
|
Type = s.Type.GetRemark(),
|
||||||
|
Stock = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, companyId, s.StockCode + s.OrgCode),
|
||||||
|
Org = _erpBasicDataExtendService.GetOrgName(orgs, s.OrgCode),
|
||||||
|
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, s.MaterialNumber),
|
||||||
|
MaterialNumber = s.MaterialNumber,
|
||||||
|
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.MaterialNumber),
|
||||||
|
Batch = s.Batch,
|
||||||
|
Customer = s.Customer,
|
||||||
|
Qty = s.Qty,
|
||||||
|
BeforeQty = s.BeforeQty
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||||
|
return (list, total, details);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<(object obj, int total)> GetListField(ProductInventoryQueryRequest dto, int companyId)
|
||||||
|
{
|
||||||
|
var (list, count, qty) = await GetListAsync(dto, companyId);
|
||||||
|
return (list, count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user