This commit is contained in:
tongfei
2024-01-05 11:12:35 +08:00
parent d3a62e9a7b
commit 269eefe68b
6 changed files with 104 additions and 0 deletions

View File

@@ -104,5 +104,26 @@ namespace WMS.Web.Domain.Services
}
return Result.ReSuccess();
}
/// <summary>
/// 获取即时库存明细汇总
/// </summary>
/// <param name="mids"></param>
/// <param name="stockCodes"></param>
/// <param name="orgCodes"></param>
/// <returns></returns>
public async Task<List<InventoryDetailsSummaryResponse>> GetInventoryDetailsSummary(List<int> mids, List<string> stockCodes, List<string> orgCodes)
{
var inventoryDetails = await _inventoryDetailsRepositories.GetListBy(mids, stockCodes, orgCodes);
var resultList = inventoryDetails.GroupBy(x => new { MaterialId = x.MaterialId, StockCode = x.StockCode, OrgCode = x.OrgCode })
.Select(x => new InventoryDetailsSummaryResponse()
{
MaterialId=x.Key.MaterialId,
StockCode=x.Key.StockCode,
OrgCode=x.Key.OrgCode,
Qty=x.Sum(t=>t.Qty)
}).ToList();
return resultList;
}
}
}