mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
Merge branch 'development' of https://gitlab.com/mbugroup/lti-api into feat/BE/sso-adjustment
This commit is contained in:
@@ -1681,7 +1681,7 @@ func (s *repportService) GetHppPerKandang(ctx *fiber.Ctx) (*dto.HppPerKandangRes
|
||||
var avgWeight float64
|
||||
eggHpp := 0.0
|
||||
if s.HppSvc != nil {
|
||||
hppCost, err := s.HppSvc.CalculateHppCost(row.ProjectFlockKandangID, &endOfDay)
|
||||
hppCost, err := s.HppSvc.CalculateHppCost(row.ProjectFlockKandangID, &periodDate)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
@@ -1690,7 +1690,9 @@ func (s *repportService) GetHppPerKandang(ctx *fiber.Ctx) (*dto.HppPerKandangRes
|
||||
eggHpp = hppCost.Estimation.HargaKg
|
||||
eggTotalPiecesFloat = hppCost.Estimation.Butir
|
||||
eggWeightFloat = hppCost.Estimation.Kg
|
||||
avgWeight = eggWeightFloat / eggTotalPiecesFloat
|
||||
if eggTotalPiecesFloat > 0 {
|
||||
avgWeight = eggWeightFloat / eggTotalPiecesFloat
|
||||
}
|
||||
eggRemainingWeightFloatRemaining = avgWeight * eggPiecesFloatRemaining
|
||||
}
|
||||
}
|
||||
@@ -1706,6 +1708,9 @@ func (s *repportService) GetHppPerKandang(ctx *fiber.Ctx) (*dto.HppPerKandangRes
|
||||
if math.IsNaN(eggWeightFloat) || math.IsInf(eggWeightFloat, 0) {
|
||||
eggWeightFloat = 0
|
||||
}
|
||||
if math.IsNaN(avgWeight) || math.IsInf(avgWeight, 0) {
|
||||
avgWeight = 0
|
||||
}
|
||||
|
||||
if params.WeightMin != nil && avgWeight < *params.WeightMin {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user