mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
fix hpp harian kandang
This commit is contained in:
@@ -1515,18 +1515,18 @@ func (s *repportService) GetHppPerKandang(ctx *fiber.Ctx) (*dto.HppPerKandangRes
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// eggMap, err := s.HppPerKandangRepo.GetEggProductionByProjectFlockKandangIDs(ctx.Context(), startOfDay, endOfDay, validPfkIDs)
|
||||
// if err != nil {
|
||||
// return nil, nil, err
|
||||
// }
|
||||
// for pfkID, egg := range eggMap {
|
||||
// if rowIdx, ok := pfkIndex[pfkID]; ok {
|
||||
// repoRows[rowIdx].EggProductionWeightKgRemaining = egg.EggProductionWeightKgRemaining
|
||||
// repoRows[rowIdx].EggProductionPiecesRemaining = egg.EggProductionPiecesRemaining
|
||||
// repoRows[rowIdx].EggProductionTotalWeightKg = egg.EggProductionTotalWeightKg
|
||||
// repoRows[rowIdx].EggProductionTotalPieces = egg.EggProductionTotalPieces
|
||||
// }
|
||||
// }
|
||||
eggMap, err := s.HppPerKandangRepo.GetWeightRemainingByProjectFlockKandangIDs(ctx.Context(), startOfDay, endOfDay, validPfkIDs)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
for pfkID, egg := range eggMap {
|
||||
if rowIdx, ok := pfkIndex[pfkID]; ok {
|
||||
repoRows[rowIdx].EggProductionWeightKgRemaining = egg.EggProductionWeightKgRemaining
|
||||
// repoRows[rowIdx].EggProductionPiecesRemaining = egg.EggProductionPiecesRemaining
|
||||
// repoRows[rowIdx].EggProductionTotalWeightKg = egg.EggProductionTotalWeightKg
|
||||
// repoRows[rowIdx].EggProductionTotalPieces = egg.EggProductionTotalPieces
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
costMap := make(map[uint]HppCostAggregate, len(costRows))
|
||||
@@ -1612,7 +1612,7 @@ func (s *repportService) GetHppPerKandang(ctx *fiber.Ctx) (*dto.HppPerKandangRes
|
||||
}
|
||||
|
||||
var eggPiecesFloatRemaining float64
|
||||
var eggRemainingWeightFloatRemaining float64
|
||||
eggRemainingWeightFloatRemaining := row.EggProductionWeightKgRemaining
|
||||
var eggTotalPiecesFloat float64
|
||||
var eggWeightFloat float64
|
||||
eggHpp := 0.0
|
||||
@@ -1622,7 +1622,7 @@ func (s *repportService) GetHppPerKandang(ctx *fiber.Ctx) (*dto.HppPerKandangRes
|
||||
return nil, nil, err
|
||||
}
|
||||
if hppCost != nil {
|
||||
eggRemainingWeightFloatRemaining = hppCost.Estimation.Kg - hppCost.Real.Kg
|
||||
// eggRemainingWeightFloatRemaining = hppCost.Estimation.Kg - hppCost.Real.Kg
|
||||
eggPiecesFloatRemaining = hppCost.Estimation.Butir - hppCost.Real.Butir
|
||||
eggHpp = hppCost.Estimation.HargaKg
|
||||
eggTotalPiecesFloat = hppCost.Estimation.Butir
|
||||
|
||||
Reference in New Issue
Block a user