Изменение GetShopReinforcedies

This commit is contained in:
Кашин Максим 2023-04-13 10:58:09 +04:00
parent fbb8838012
commit 5cfafad105

View File

@ -112,8 +112,6 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic
{
var shops = _shopStorage.GetFullList();
var reinforcedies = _reinforcedStorage.GetFullList();
var list = new List<ReportShopReinforcedViewModel>();
foreach (var shop in shops)
@ -121,18 +119,14 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic
var record = new ReportShopReinforcedViewModel
{
ShopName = shop.Name,
Reinforcedies = new List<Tuple<string, int>>(),
Reinforcedies = new(),
TotalCount = 0
};
foreach (var reinforced in reinforcedies)
foreach (var reinforced in shop.ShopReinforcedies)
{
if (shop.ShopReinforcedies.ContainsKey(reinforced.Id))
{
record.Reinforcedies.Add(new(reinforced.ReinforcedName, shop.ShopReinforcedies[reinforced.Id].Item2));
record.TotalCount += shop.ShopReinforcedies[reinforced.Id].Item2;
}
record.Reinforcedies.Add(new(reinforced.Value.Item1.ReinforcedName, reinforced.Value.Item2));
record.TotalCount += reinforced.Value.Item2;
}
record.Workload = record.TotalCount / (double)shop.ReinforcedMaxCount;
list.Add(record);
}