feat(api): среднее значение для workload считаем только для дней у которых работ больше 0.
This commit is contained in:
@@ -6,7 +6,17 @@
|
|||||||
|
|
||||||
public int WorksCount => WorkLoad?.Sum(t => t.TemplateCount) ?? 0;
|
public int WorksCount => WorkLoad?.Sum(t => t.TemplateCount) ?? 0;
|
||||||
|
|
||||||
public double AverageWorksCount => Math.Round((double)WorksCount / WorkLoad.Count(), 2);
|
public double AverageWorksCount
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int divider = WorkLoad.Where(t => t.TemplateCount > 0).Count();
|
||||||
|
if (divider > 0)
|
||||||
|
return Math.Round((double)WorksCount / divider, 2);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}//=> Math.Round((double)WorksCount / WorkLoad.Where(t => t.TemplateCount > 0).Count(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class StatWorkLoadDataResponse
|
public class StatWorkLoadDataResponse
|
||||||
|
|||||||
Reference in New Issue
Block a user