|
@@ -1,8 +1,11 @@
|
|
package model
|
|
package model
|
|
|
|
|
|
|
|
+import pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
|
|
|
|
+
|
|
type EventBodyScore struct {
|
|
type EventBodyScore struct {
|
|
Id int64 `json:"id"`
|
|
Id int64 `json:"id"`
|
|
CowId int64 `json:"cow_id"`
|
|
CowId int64 `json:"cow_id"`
|
|
|
|
+ EarNumber string `json:"ear_number"`
|
|
Score int32 `json:"score"`
|
|
Score int32 `json:"score"`
|
|
Lact int32 `json:"lact"`
|
|
Lact int32 `json:"lact"`
|
|
DayAge int32 `json:"day_age"`
|
|
DayAge int32 `json:"day_age"`
|
|
@@ -17,3 +20,17 @@ type EventBodyScore struct {
|
|
func (e *EventBodyScore) TableName() string {
|
|
func (e *EventBodyScore) TableName() string {
|
|
return "event_body_score"
|
|
return "event_body_score"
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func NewEventBodyScore(cow *Cow, operationId int64, req *pasturePb.BodyScoreEventRequest) *EventBodyScore {
|
|
|
|
+ return &EventBodyScore{
|
|
|
|
+ CowId: cow.Id,
|
|
|
|
+ EarNumber: cow.EarNumber,
|
|
|
|
+ Score: req.Score,
|
|
|
|
+ Lact: cow.Lact,
|
|
|
|
+ DayAge: cow.GetDayAge(),
|
|
|
|
+ ScoreAt: int64(req.ScoreAt),
|
|
|
|
+ Remarks: req.Remarks,
|
|
|
|
+ StaffMemberId: int64(req.StaffMemberId),
|
|
|
|
+ OperationId: operationId,
|
|
|
|
+ }
|
|
|
|
+}
|