Изменение GetShopReinforcedies
This commit is contained in:
parent
fbb8838012
commit
5cfafad105
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user