mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 07:15:43 +00:00
feat(BE-278): add std for max_depletion
This commit is contained in:
@@ -34,10 +34,11 @@ type Recording struct {
|
|||||||
|
|
||||||
LatestApproval *Approval `gorm:"-" json:"-"`
|
LatestApproval *Approval `gorm:"-" json:"-"`
|
||||||
|
|
||||||
StandardHandDay *float64 `gorm:"-"`
|
StandardHandDay *float64 `gorm:"-"`
|
||||||
StandardHandHouse *float64 `gorm:"-"`
|
StandardHandHouse *float64 `gorm:"-"`
|
||||||
StandardFeedIntake *float64 `gorm:"-"`
|
StandardFeedIntake *float64 `gorm:"-"`
|
||||||
StandardEggMesh *float64 `gorm:"-"`
|
StandardMaxDepletion *float64 `gorm:"-"`
|
||||||
StandardEggWeight *float64 `gorm:"-"`
|
StandardEggMesh *float64 `gorm:"-"`
|
||||||
StandardFcr *float64 `gorm:"-"`
|
StandardEggWeight *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,
|
||||||
|
|||||||
@@ -1016,11 +1016,12 @@ func (s *recordingService) attachLatestApproval(ctx context.Context, item *entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
type productionStandardValues struct {
|
type productionStandardValues struct {
|
||||||
HandDay *float64
|
HandDay *float64
|
||||||
HandHouse *float64
|
HandHouse *float64
|
||||||
FeedIntake *float64
|
FeedIntake *float64
|
||||||
EggMesh *float64
|
MaxDepletion *float64
|
||||||
EggWeight *float64
|
EggMesh *float64
|
||||||
|
EggWeight *float64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *recordingService) attachProductionStandards(ctx context.Context, items []entity.Recording) error {
|
func (s *recordingService) attachProductionStandards(ctx context.Context, items []entity.Recording) error {
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user