This commit is contained in:
tongfei
2024-03-26 15:04:29 +08:00
parent 217b197ed5
commit df821329ef
4 changed files with 48 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WMS.Web.Core.Dto;
using WMS.Web.Core.Dto.Erp;
using WMS.Web.Core.Dto.Erp.Org;
using WMS.Web.Core.Dto.Inventory;
@@ -224,5 +225,23 @@ namespace WMS.Web.Repositories
stockCodes.Contains(x.StockCode) &&
orgCodes.Contains(x.OrgCode)).ToListAsync();
}
/// <summary>
/// 获取物料对应的仓位集合
/// </summary>
/// <param name="materialNumbers"></param>
/// <param name="stockCodes"></param>
/// <param name="companyId"></param>
/// <returns></returns>
public async Task<List<MaterialSubStock>> GetMaterialSubStocks(List<string> materialNumbers, List<string> stockCodes,int companyId)
{
return await _context.InventoryDetails.Where(x => materialNumbers.Contains(x.MaterialNumber) &&
stockCodes.Contains(x.StockCode)).Select(x=>new MaterialSubStock()
{
MaterialNumber=x.MaterialNumber,
SubStockCode=x.SubStockCode,
SubStock = _singleDataService.GetSingleData(SingleAction.SubStocksJoinOrgCode, companyId, x.SubStockCode + x.StockCode + x.OrgCode),
}).ToListAsync();
}
}
}