feat(BE-278): add std for max_depletion

This commit is contained in:
ragilap
2025-12-31 09:44:20 +07:00
parent d9afd2913e
commit b8c0b0c37d
3 changed files with 17 additions and 11 deletions
+1
View File
@@ -37,6 +37,7 @@ type Recording struct {
StandardHandDay *float64 `gorm:"-"` StandardHandDay *float64 `gorm:"-"`
StandardHandHouse *float64 `gorm:"-"` StandardHandHouse *float64 `gorm:"-"`
StandardFeedIntake *float64 `gorm:"-"` StandardFeedIntake *float64 `gorm:"-"`
StandardMaxDepletion *float64 `gorm:"-"`
StandardEggMesh *float64 `gorm:"-"` StandardEggMesh *float64 `gorm:"-"`
StandardEggWeight *float64 `gorm:"-"` StandardEggWeight *float64 `gorm:"-"`
StandardFcr *float64 `gorm:"-"` StandardFcr *float64 `gorm:"-"`
@@ -33,6 +33,7 @@ type RecordingRelationDTO struct {
StandardHandDay *float64 `json:"hand_day_std,omitempty"` StandardHandDay *float64 `json:"hand_day_std,omitempty"`
StandardHandHouse *float64 `json:"hand_house_std,omitempty"` StandardHandHouse *float64 `json:"hand_house_std,omitempty"`
StandardFeedIntake *float64 `json:"feed_intake_std,omitempty"` StandardFeedIntake *float64 `json:"feed_intake_std,omitempty"`
StandardMaxDepletion *float64 `json:"max_depletion_std,omitempty"`
StandardEggMesh *float64 `json:"egg_mesh_std,omitempty"` StandardEggMesh *float64 `json:"egg_mesh_std,omitempty"`
StandardEggWeight *float64 `json:"egg_weight_std,omitempty"` StandardEggWeight *float64 `json:"egg_weight_std,omitempty"`
StandardFcr *float64 `json:"fcr_std,omitempty"` StandardFcr *float64 `json:"fcr_std,omitempty"`
@@ -164,6 +165,7 @@ func ToRecordingRelationDTO(e entity.Recording) RecordingRelationDTO {
StandardHandDay: e.StandardHandDay, StandardHandDay: e.StandardHandDay,
StandardHandHouse: e.StandardHandHouse, StandardHandHouse: e.StandardHandHouse,
StandardFeedIntake: e.StandardFeedIntake, StandardFeedIntake: e.StandardFeedIntake,
StandardMaxDepletion: e.StandardMaxDepletion,
StandardEggMesh: e.StandardEggMesh, StandardEggMesh: e.StandardEggMesh,
StandardEggWeight: e.StandardEggWeight, StandardEggWeight: e.StandardEggWeight,
StandardFcr: e.StandardFcr, StandardFcr: e.StandardFcr,
@@ -1019,6 +1019,7 @@ type productionStandardValues struct {
HandDay *float64 HandDay *float64
HandHouse *float64 HandHouse *float64
FeedIntake *float64 FeedIntake *float64
MaxDepletion *float64
EggMesh *float64 EggMesh *float64
EggWeight *float64 EggWeight *float64
} }
@@ -1083,6 +1084,7 @@ func (s *recordingService) attachProductionStandard(ctx context.Context, item *e
} }
if growthDetail != nil { if growthDetail != nil {
standard.FeedIntake = growthDetail.FeedIntake standard.FeedIntake = growthDetail.FeedIntake
standard.MaxDepletion = growthDetail.MaxDepletion
if category == string(utils.ProjectFlockCategoryLaying) && growthDetail.TargetMeanBw != nil && item.ProjectFlockKandang.ProjectFlock.FcrId > 0 { if category == string(utils.ProjectFlockCategoryLaying) && growthDetail.TargetMeanBw != nil && item.ProjectFlockKandang.ProjectFlock.FcrId > 0 {
targetWeight := *growthDetail.TargetMeanBw targetWeight := *growthDetail.TargetMeanBw
if targetWeight > 10 { if targetWeight > 10 {
@@ -1103,6 +1105,7 @@ func (s *recordingService) attachProductionStandard(ctx context.Context, item *e
item.StandardHandDay = standard.HandDay item.StandardHandDay = standard.HandDay
item.StandardHandHouse = standard.HandHouse item.StandardHandHouse = standard.HandHouse
item.StandardFeedIntake = standard.FeedIntake item.StandardFeedIntake = standard.FeedIntake
item.StandardMaxDepletion = standard.MaxDepletion
item.StandardEggMesh = standard.EggMesh item.StandardEggMesh = standard.EggMesh
item.StandardEggWeight = standard.EggWeight item.StandardEggWeight = standard.EggWeight
item.StandardFcr = standardFcr item.StandardFcr = standardFcr