修复bug

This commit is contained in:
18942506660
2024-11-05 17:33:22 +08:00
parent b276540af3
commit f15aa1eac5
3 changed files with 24 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ using WMS.Web.Core.Dto.Erp;
using WMS.Web.Core.Dto.Erp.Customer;
using WMS.Web.Core.Dto.Erp.Org;
using WMS.Web.Core.Dto.Erp.Supplier;
using WMS.Web.Core.Dto.SingleData;
namespace WMS.Web.Domain.IService.Public
{
@@ -173,5 +174,12 @@ namespace WMS.Web.Domain.IService.Public
/// <param name="code"></param>
/// <returns></returns>
string GetSubStockName(List<Erp_SubStockDto> erpStocks, string code);
/// <summary>
/// 成品即时库存仓库
/// </summary>
/// <param name="list"></param>
/// <param name="code"></param>
/// <returns></returns>
string GetProductInventoryStockName(List<UcStockHeadOfficeResponse> list, string code);
}
}

View File

@@ -7,6 +7,7 @@ using WMS.Web.Core.Dto.Erp;
using WMS.Web.Core.Dto.Erp.Customer;
using WMS.Web.Core.Dto.Erp.Org;
using WMS.Web.Core.Dto.Erp.Supplier;
using WMS.Web.Core.Dto.SingleData;
using WMS.Web.Domain.Infrastructure;
using WMS.Web.Domain.IService.Public;
@@ -407,6 +408,18 @@ namespace WMS.Web.Domain.Services.Public
var stock = erpStocks.Where(x => x.Code == code).FirstOrDefault();
return stock == null ? "" : stock.Name;
}
/// <summary>
/// 成品即时库存仓库
/// </summary>
/// <param name="list"></param>
/// <param name="code"></param>
/// <returns></returns>
public string GetProductInventoryStockName(List<UcStockHeadOfficeResponse> list, string code)
{
if (list == null || list.Count == 0)
return "";
var stock = list.Where(x => x.Code == code).FirstOrDefault();
return stock == null ? "" : stock.Name;
}
}
}

View File

@@ -132,7 +132,7 @@ namespace WMS.Web.Repositories
if (org_result.IsSuccess)
orgs = org_result.Data.ToList();
var r = await _basicsRepositories.GetUcStockByHeadOfficeAsync("", 1);
var p_stocks = await _basicsRepositories.GetUcStockByHeadOfficeAsync("", 1);
#endregion
var query = _context.ProductInventory
@@ -161,7 +161,7 @@ namespace WMS.Web.Repositories
#region dto组装
Id = s.Id,
Type = s.Type.GetRemark(),
Stock = GetStockName(r, s.StockCode),
Stock = _erpBasicDataExtendService.GetProductInventoryStockName(p_stocks, s.StockCode),
Org = _erpBasicDataExtendService.GetOrgName(orgs, s.OrgCode),
MaterialName = _erpBasicDataExtendService.GetMaterialName(materials, s.MaterialNumber),
MaterialNumber = s.MaterialNumber,
@@ -176,13 +176,6 @@ namespace WMS.Web.Repositories
return (list, total, details);
}
private string GetStockName(List<UcStockHeadOfficeResponse> list, string code)
{
var stock = list.FirstOrDefault(f => f.Code.Equals(code));
if (stock == null) return "";
return stock.Name;
}
public async Task<(object obj, int total)> GetListField(ProductInventoryQueryRequest dto, int companyId)
{
var (list, count, qty) = await GetListAsync(dto, companyId);