调整结构
This commit is contained in:
Binary file not shown.
@@ -54,13 +54,13 @@ namespace WMS.Web.Api.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("GetList")]
|
||||
public async Task<ResultPagedList<InStockQueryResponse>> GetPagedList([FromBody] InStockQueryRequest dto)
|
||||
public async Task<ResultPagedNumberList<InStockQueryResponse>> GetPagedList([FromBody] InStockQueryRequest dto)
|
||||
{
|
||||
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||
return ResultPagedList<InStockQueryResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||
var (list, count) = await _inStockRepositories.GetPagedList(dto, loginInfo.UserInfo.CompanyId);
|
||||
return ResultPagedList<InStockQueryResponse>.ReSuccess(list, count);
|
||||
return ResultPagedNumberList<InStockQueryResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||
var (list, count,qty) = await _inStockRepositories.GetPagedList(dto, loginInfo.UserInfo.CompanyId);
|
||||
return ResultPagedNumberList<InStockQueryResponse>.ReSuccess(list, count,qty);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,13 +56,13 @@ namespace WMS.Web.Api.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Route("GetList")]
|
||||
public async Task<ResultPagedList<InventoryDetailsQueryResponse>> GetPagedList([FromBody] InventoryDetailsQueryRequest dto)
|
||||
public async Task<ResultPagedNumberList<InventoryDetailsQueryResponse>> GetPagedList([FromBody] InventoryDetailsQueryRequest dto)
|
||||
{
|
||||
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
|
||||
if (loginInfo == null || loginInfo.UserInfo == null)
|
||||
return ResultPagedList<InventoryDetailsQueryResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||
var (list, count) = await _inventoryDetailsRepositories.GetPagedList(dto,loginInfo.UserInfo.CompanyId);
|
||||
return ResultPagedList<InventoryDetailsQueryResponse>.ReSuccess(list, count);
|
||||
return ResultPagedNumberList<InventoryDetailsQueryResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
|
||||
var (list, count,qty) = await _inventoryDetailsRepositories.GetPagedList(dto,loginInfo.UserInfo.CompanyId);
|
||||
return ResultPagedNumberList<InventoryDetailsQueryResponse>.ReSuccess(list, count,qty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3023,11 +3023,6 @@
|
||||
数量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockQueryResponse.TotalQty">
|
||||
<summary>
|
||||
总入库量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.InStockQueryResponse.Creator">
|
||||
<summary>
|
||||
创建人
|
||||
@@ -3779,11 +3774,6 @@
|
||||
单位
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Dto.Inventory.InventoryDetailsQueryResponse.TotalQty">
|
||||
<summary>
|
||||
总库存量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Dto.Inventory.InventoryDetailsSummaryResponse">
|
||||
<summary>
|
||||
即时库存明细汇总
|
||||
@@ -6802,6 +6792,83 @@
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:WMS.Web.Core.Internal.Results.ResultPagedNumberList`1">
|
||||
<summary>
|
||||
分页列表结果对象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumberList`1.#ctor">
|
||||
<summary>
|
||||
实体分页集合结果
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumberList`1.#ctor(System.Collections.Generic.IList{`0},System.Int32,System.Decimal)">
|
||||
<summary>
|
||||
实体分页集合结果
|
||||
</summary>
|
||||
<param name="data">实体集合</param>
|
||||
<param name="totalCount">总条数</param>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumberList`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.ResultPagedNumberList`1.TotalCount">
|
||||
<summary>
|
||||
Total count of Items.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Internal.Results.ResultPagedNumberList`1.TotalQty">
|
||||
<summary>
|
||||
总数量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumberList`1.ReSuccess(System.Collections.Generic.IList{`0},System.Int32,System.Decimal)">
|
||||
<summary>
|
||||
创建成功的返回消息
|
||||
</summary>
|
||||
<param name="data">实体集合</param>
|
||||
<param name="totalCount">总条数</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumberList`1.ReSuccess">
|
||||
<summary>
|
||||
创建成功的返回消息
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Core.Internal.Results.ResultPagedNumberList`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.ResultPagedNumberList`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.ResultPagedNumberList`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.ResultPagedNumberList`1.AsTask">
|
||||
<summary>
|
||||
转换为 task
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Core.Internal.Security.RSA.RSAPrivateKey">
|
||||
<summary>
|
||||
用于签名的私钥
|
||||
|
||||
@@ -83,11 +83,6 @@ namespace WMS.Web.Core.Dto
|
||||
[Column("入库数量")]
|
||||
public decimal Qty { get; set; }
|
||||
/// <summary>
|
||||
/// 总入库量
|
||||
/// </summary>
|
||||
[Column("总入库量")]
|
||||
public decimal TotalQty { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[Column("创建人")]
|
||||
|
||||
@@ -63,10 +63,5 @@ namespace WMS.Web.Core.Dto.Inventory
|
||||
/// </summary>
|
||||
[Column("单位")]
|
||||
public string Unit { get; set; }
|
||||
/// <summary>
|
||||
/// 总库存量
|
||||
/// </summary>
|
||||
[Column("总库存量")]
|
||||
public decimal TotalQty { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
117
src/WMS.Web.Core/Internal/Results/ResultPagedNumberList.cs
Normal file
117
src/WMS.Web.Core/Internal/Results/ResultPagedNumberList.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WMS.Web.Core.Internal.Results
|
||||
{
|
||||
/// <summary>
|
||||
/// 分页列表结果对象
|
||||
/// </summary>
|
||||
public class ResultPagedNumberList<T> : ResultList<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// 实体分页集合结果
|
||||
/// </summary>
|
||||
public ResultPagedNumberList()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实体分页集合结果
|
||||
/// </summary>
|
||||
/// <param name="data">实体集合</param>
|
||||
/// <param name="totalCount">总条数</param>
|
||||
public ResultPagedNumberList(IList<T> data, int totalCount,decimal totalQty) : base(data)
|
||||
{
|
||||
TotalCount = totalCount;
|
||||
TotalQty = totalQty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实体分页集合结果
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="totalCount"></param>
|
||||
/// <param name="result"></param>
|
||||
public ResultPagedNumberList(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 decimal TotalQty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建成功的返回消息
|
||||
/// </summary>
|
||||
/// <param name="data">实体集合</param>
|
||||
/// <param name="totalCount">总条数</param>
|
||||
/// <returns></returns>
|
||||
public static ResultPagedNumberList<T> ReSuccess(IList<T> data, int totalCount,decimal totalQty)
|
||||
{
|
||||
return new ResultPagedNumberList<T>(data, totalCount,totalQty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建成功的返回消息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public new static ResultPagedNumberList<T> ReSuccess()
|
||||
{
|
||||
return new ResultPagedNumberList<T>(new List<T>(), 0,0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建返回信息(返回处理失败)
|
||||
/// </summary>
|
||||
/// <param name="message">结果消息</param>
|
||||
/// <param name="status">结果状态</param>
|
||||
/// <returns></returns>
|
||||
public new static ResultPagedNumberList<T> ReFailure(string message, int status)
|
||||
{
|
||||
var result = new ResultPagedNumberList<T>();
|
||||
result.To(message, status);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建返回信息(返回处理失败)
|
||||
/// </summary>
|
||||
/// <param name="result">结果消息</param>
|
||||
/// <returns></returns>
|
||||
public new static ResultPagedNumberList<T> ReFailure(ValueTuple<int, string> result)
|
||||
{
|
||||
var res = new ResultPagedNumberList<T>();
|
||||
res.To(result);
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建返回信息(返回处理失败)
|
||||
/// </summary>
|
||||
/// <param name="result">结果</param>
|
||||
/// <returns></returns>
|
||||
public new static ResultPagedNumberList<T> ReFailure(Result result)
|
||||
{
|
||||
var re = new ResultPagedNumberList<T>();
|
||||
re.To(result);
|
||||
return re;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转换为 task
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public new Task<ResultPagedNumberList<T>> AsTask()
|
||||
{
|
||||
return Task.FromResult(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ namespace WMS.Web.Domain.Infrastructure
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
Task<(List<InStockQueryResponse> list,int total)> GetPagedList(InStockQueryRequest dto,int companyId);
|
||||
Task<(List<InStockQueryResponse> list,int total,decimal totalQty)> GetPagedList(InStockQueryRequest dto,int companyId);
|
||||
|
||||
/// <summary>
|
||||
/// 箱是否存在于入库单明细中;(箱是否被上架了)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace WMS.Web.Domain.Infrastructure
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="companyId"></param>
|
||||
/// <returns></returns>
|
||||
Task<(List<InventoryDetailsQueryResponse> list,int total)> GetPagedList(InventoryDetailsQueryRequest dto, int companyId);
|
||||
Task<(List<InventoryDetailsQueryResponse> list,int total,decimal totalQty)> GetPagedList(InventoryDetailsQueryRequest dto, int companyId);
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加
|
||||
|
||||
@@ -113,7 +113,8 @@ namespace WMS.Web.Repositories
|
||||
/// <returns></returns>
|
||||
public async Task<(object obj, int total)> GetListField(InStockQueryRequest dto, int companyId)
|
||||
{
|
||||
return await GetPagedList(dto, companyId);
|
||||
var res= await GetPagedList(dto, companyId);
|
||||
return (res.list, res.total);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -270,7 +271,7 @@ namespace WMS.Web.Repositories
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<(List<InStockQueryResponse> list, int total)> GetPagedList(InStockQueryRequest dto, int companyId)
|
||||
public async Task<(List<InStockQueryResponse> list, int total, decimal totalQty)> GetPagedList(InStockQueryRequest dto, int companyId)
|
||||
{
|
||||
//1.获取物料集合和组织集合和供应商的集合
|
||||
var materials = new List<ErpMaterialDto>();
|
||||
@@ -381,7 +382,6 @@ namespace WMS.Web.Repositories
|
||||
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.detail.MaterialNumber),
|
||||
Stock = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, companyId, s.order.StockCode + s.order.OrgCode),
|
||||
Qty = s.detail.Qty,
|
||||
TotalQty= totalQty,
|
||||
Creator = _singleDataService.GetSingleData(SingleAction.Staffs, companyId, s.order.CreatorId),
|
||||
CreateTime = s.order.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
SuccessSync = (s.order.Type != InstockType.Purchase ? "--" : (s.order.SuccessSync == SyncStatus.Success ? "成功" : (s.order.SuccessSync == SyncStatus.SyncIng ? "同步中" : "失败"))),
|
||||
@@ -402,7 +402,7 @@ namespace WMS.Web.Repositories
|
||||
});
|
||||
}
|
||||
|
||||
return (list, total);
|
||||
return (list, total, totalQty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace WMS.Web.Repositories
|
||||
/// <param name="dto"></param>
|
||||
/// <param name="companyId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<(List<InventoryDetailsQueryResponse> list, int total)> GetPagedList(InventoryDetailsQueryRequest dto, int companyId)
|
||||
public async Task<(List<InventoryDetailsQueryResponse> list, int total, decimal totalQty)> GetPagedList(InventoryDetailsQueryRequest dto, int companyId)
|
||||
{
|
||||
//1.获取物料集合和组织集合
|
||||
var materials = new List<ErpMaterialDto>();
|
||||
@@ -115,12 +115,11 @@ namespace WMS.Web.Repositories
|
||||
Org = _erpBasicDataExtendService.GetOrgName(orgs, s.OrgCode),
|
||||
Stock = _singleDataService.GetSingleData(SingleAction.StocksJoinOrgCode, companyId, s.StockCode + s.OrgCode),
|
||||
Qty = s.Qty,
|
||||
TotalQty= totalQty,
|
||||
SubStock = _singleDataService.GetSingleData(SingleAction.SubStocksJoinOrgCode, companyId, s.SubStockCode + s.StockCode + s.OrgCode),
|
||||
Unit = _erpBasicDataExtendService.GetMaterialUnitName(materials, s.MaterialNumber),
|
||||
}).OrderByDescending(x => x.Id).Skip((dto.PageNo - 1) * dto.PageSize).Take(dto.PageSize).ToListAsync();
|
||||
|
||||
return (list, total);
|
||||
return (list, total, totalQty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -191,7 +190,8 @@ namespace WMS.Web.Repositories
|
||||
/// <returns></returns>
|
||||
public async Task<(object obj, int total)> GetListField(InventoryDetailsQueryRequest dto, int companyId)
|
||||
{
|
||||
return await GetPagedList(dto, companyId);
|
||||
var res= await GetPagedList(dto, companyId);
|
||||
return (res.list, res.total);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user