mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
[FIX/BE-US-281] changes calculate fcr egg
This commit is contained in:
@@ -273,15 +273,15 @@ func (s dashboardService) buildPerformanceCharts(ctx context.Context, params *va
|
||||
weekFeed := weeklyFeedMap[week]
|
||||
|
||||
actFcr := 0.0
|
||||
if weekFeed > 0 {
|
||||
actFcr = weekEgg / weekFeed
|
||||
if weekEgg > 0 {
|
||||
actFcr = weekFeed / weekEgg
|
||||
}
|
||||
|
||||
cumEgg += weekEgg
|
||||
cumFeed += weekFeed
|
||||
actFcrCum := 0.0
|
||||
if cumFeed > 0 {
|
||||
actFcrCum = cumEgg / cumFeed
|
||||
if cumEgg > 0 {
|
||||
actFcrCum = cumFeed / cumEgg
|
||||
}
|
||||
|
||||
bodyWeightDataset = append(bodyWeightDataset, map[string]interface{}{
|
||||
@@ -359,10 +359,10 @@ func (s dashboardService) buildPerformanceCharts(ctx context.Context, params *va
|
||||
},
|
||||
"fcr": {
|
||||
Series: []dto.DashboardChartSeriesDTO{
|
||||
{Id: "act_fcr", Label: "Act. FCR", Unit: "%"},
|
||||
{Id: "std_fcr", Label: "STD. FCR", Unit: "%"},
|
||||
{Id: "act_fcr_cum", Label: "Act. FCR Cummulative", Unit: "%"},
|
||||
{Id: "std_fcr_cum", Label: "STD. FCR Cummulative", Unit: "%"},
|
||||
{Id: "act_fcr", Label: "Act. FCR", Unit: "kg/kg"},
|
||||
{Id: "std_fcr", Label: "STD. FCR", Unit: "kg/kg"},
|
||||
{Id: "act_fcr_cum", Label: "Act. FCR Cummulative", Unit: "kg/kg"},
|
||||
{Id: "std_fcr_cum", Label: "STD. FCR Cummulative", Unit: "kg/kg"},
|
||||
},
|
||||
Dataset: fcrDataset,
|
||||
},
|
||||
@@ -937,11 +937,11 @@ func (s dashboardService) fcrValue(ctx context.Context, filter *validation.Dashb
|
||||
}
|
||||
feedUsageGrams := feedUsageToGrams(feedRows)
|
||||
|
||||
if feedUsageGrams <= 0 {
|
||||
if eggWeightGrams <= 0 {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
return eggWeightGrams / feedUsageGrams, nil
|
||||
return feedUsageGrams / eggWeightGrams, nil
|
||||
}
|
||||
|
||||
func (s dashboardService) mortalityValue(ctx context.Context, filter *validation.DashboardFilter, startDate, endExclusive time.Time) (float64, error) {
|
||||
|
||||
Reference in New Issue
Block a user