|
@@ -3,22 +3,22 @@ package model
|
|
|
import pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
|
|
|
|
|
|
type EventCalving struct {
|
|
|
- Id int64 `json:"int_64"`
|
|
|
- CowId int64 `json:"cow_id"`
|
|
|
- EarNumber string `json:"ear_number"`
|
|
|
- Lact int32 `json:"lact"`
|
|
|
- DayAge int32 `json:"day_age"`
|
|
|
- PenId int32 `json:"pen_id"`
|
|
|
- CalvingAt int64 `json:"calving_at"`
|
|
|
- ChildNumber int8 `json:"child_number"`
|
|
|
- BullId int64 `json:"bull_id"`
|
|
|
- DaysPregnant int32 `json:"days_pregnant"`
|
|
|
- CalvingLevel pasturePb.CalvingLevel_Kind `json:"calving_level"`
|
|
|
- IsInducingChildbirth pasturePb.IsShow_Kind `json:"is_inducing_childbirth"`
|
|
|
- StaffMemberId int64 `json:"staff_member_id"`
|
|
|
- Remarks string `json:"remarks"`
|
|
|
- CreatedAt int64 `json:"created_at"`
|
|
|
- UpdatedAt int64 `json:"updated_at"`
|
|
|
+ Id int64 `json:"int_64"`
|
|
|
+ CowId int64 `json:"cow_id"`
|
|
|
+ EarNumber string `json:"ear_number"`
|
|
|
+ Lact int32 `json:"lact"`
|
|
|
+ DayAge int32 `json:"day_age"`
|
|
|
+ PenId int32 `json:"pen_id"`
|
|
|
+ CalvingAt int64 `json:"calving_at"`
|
|
|
+ ChildNumber int8 `json:"child_number"`
|
|
|
+ BullId int64 `json:"bull_id"`
|
|
|
+ DaysPregnant int32 `json:"days_pregnant"`
|
|
|
+ CalvingLevel pasturePb.CalvingLevel_Kind `json:"calving_level"`
|
|
|
+ StaffMemberId int64 `json:"staff_member_id"`
|
|
|
+ DystociaReason pasturePb.DystociaReason_Kind `json:"dystocia_reason"`
|
|
|
+ Remarks string `json:"remarks"`
|
|
|
+ CreatedAt int64 `json:"created_at"`
|
|
|
+ UpdatedAt int64 `json:"updated_at"`
|
|
|
}
|
|
|
|
|
|
func (e *EventCalving) TableName() string {
|
|
@@ -27,19 +27,19 @@ func (e *EventCalving) TableName() string {
|
|
|
|
|
|
func NewEventCalving(cow *Cow, req *pasturePb.CalvingEventRequest) *EventCalving {
|
|
|
return &EventCalving{
|
|
|
- CowId: cow.Id,
|
|
|
- EarNumber: cow.EarNumber,
|
|
|
- Lact: cow.Lact,
|
|
|
- DayAge: cow.GetDayAge(),
|
|
|
- PenId: int32(cow.PenId),
|
|
|
- CalvingAt: int64(req.CalvingAt),
|
|
|
- BullId: cow.LastBullId,
|
|
|
- CalvingLevel: req.CalvingLevel,
|
|
|
- DaysPregnant: cow.GetDaysPregnant(),
|
|
|
- ChildNumber: int8(req.ChildNumber),
|
|
|
- IsInducingChildbirth: req.IsInducingChildbirth,
|
|
|
- Remarks: req.Remarks,
|
|
|
- StaffMemberId: int64(req.StaffMemberId),
|
|
|
+ CowId: cow.Id,
|
|
|
+ EarNumber: cow.EarNumber,
|
|
|
+ Lact: cow.Lact,
|
|
|
+ DayAge: cow.GetDayAge(),
|
|
|
+ PenId: int32(cow.PenId),
|
|
|
+ CalvingAt: int64(req.CalvingAt),
|
|
|
+ BullId: cow.LastBullId,
|
|
|
+ CalvingLevel: req.CalvingLevel,
|
|
|
+ DystociaReason: req.DystociaReason,
|
|
|
+ DaysPregnant: cow.GetDaysPregnant(),
|
|
|
+ ChildNumber: int8(req.ChildNumber),
|
|
|
+ Remarks: req.Remarks,
|
|
|
+ StaffMemberId: int64(req.StaffMemberId),
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -73,22 +73,21 @@ func (e EventCalvingListSlice) ToPB(req []*EventCalvingCalf) []*pasturePb.Search
|
|
|
})
|
|
|
}
|
|
|
list = append(list, &pasturePb.SearchLavingList{
|
|
|
- Id: int32(item.Id),
|
|
|
- CowId: int32(item.CowId),
|
|
|
- Lact: item.Lact,
|
|
|
- PenId: item.PenId,
|
|
|
- PenName: item.PenName,
|
|
|
- CalvingAt: int32(item.CalvingAt),
|
|
|
- ChildNumber: int32(item.ChildNumber),
|
|
|
- DaysPregnant: item.DaysPregnant,
|
|
|
- IsInducingChildbirth: item.IsInducingChildbirth,
|
|
|
- StaffMemberId: int32(item.StaffMemberId),
|
|
|
- StaffMemberName: item.StaffMemberName,
|
|
|
- CalvingLevel: item.CalvingLevel,
|
|
|
- Remarks: item.Remarks,
|
|
|
- CreatedAt: int32(item.CreatedAt),
|
|
|
- UpdatedAt: int32(item.UpdatedAt),
|
|
|
- CalfItemList: CalfItemList,
|
|
|
+ Id: int32(item.Id),
|
|
|
+ CowId: int32(item.CowId),
|
|
|
+ Lact: item.Lact,
|
|
|
+ PenId: item.PenId,
|
|
|
+ PenName: item.PenName,
|
|
|
+ CalvingAt: int32(item.CalvingAt),
|
|
|
+ ChildNumber: int32(item.ChildNumber),
|
|
|
+ DaysPregnant: item.DaysPregnant,
|
|
|
+ StaffMemberId: int32(item.StaffMemberId),
|
|
|
+ StaffMemberName: item.StaffMemberName,
|
|
|
+ CalvingLevel: item.CalvingLevel,
|
|
|
+ Remarks: item.Remarks,
|
|
|
+ CreatedAt: int32(item.CreatedAt),
|
|
|
+ UpdatedAt: int32(item.UpdatedAt),
|
|
|
+ CalfItemList: CalfItemList,
|
|
|
})
|
|
|
}
|
|
|
return list
|