|
@@ -3,42 +3,44 @@ package model
|
|
|
import pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
|
|
|
|
|
|
type EventEstrus struct {
|
|
|
- Id int64 `json:"id"`
|
|
|
- CowId int64 `json:"cowId"`
|
|
|
- DayAge int32 `json:"dayAge"`
|
|
|
- Lact int8 `json:"lact"`
|
|
|
- LactationDays int32 `json:"lactationDays"`
|
|
|
- EstrusAt int64 `json:"estrusAt"`
|
|
|
- UnMatingReasons pasturePb.UnMatingReasons_Kind `json:"unMatingReasons"`
|
|
|
- UnMatingReasonsName string `json:"unMatingReasonsName"`
|
|
|
- IsMating pasturePb.IsShow_Kind `json:"isMating"`
|
|
|
- Remarks string `json:"remarks"`
|
|
|
- OperationId int64 `json:"operationId"`
|
|
|
- OperationName string `json:"operationName"`
|
|
|
- MessageId int64 `json:"messageId"`
|
|
|
- MessageName string `json:"messageName"`
|
|
|
- CreatedAt int64 `json:"createdAt"`
|
|
|
- UpdatedAt int64 `json:"updatedAt"`
|
|
|
+ Id int64 `json:"id"`
|
|
|
+ CowId int64 `json:"cowId"`
|
|
|
+ DayAge int32 `json:"dayAge"`
|
|
|
+ Lact int8 `json:"lact"`
|
|
|
+ LactationDays int32 `json:"lactationDays"`
|
|
|
+ ExposeEstrusType pasturePb.ExposeEstrusType_Kind `json:"exposeEstrusType"`
|
|
|
+ EstrusAt int64 `json:"estrusAt"`
|
|
|
+ UnMatingReasons pasturePb.UnMatingReasons_Kind `json:"unMatingReasons"`
|
|
|
+ UnMatingReasonsName string `json:"unMatingReasonsName"`
|
|
|
+ IsMating pasturePb.IsShow_Kind `json:"isMating"`
|
|
|
+ Remarks string `json:"remarks"`
|
|
|
+ OperationId int64 `json:"operationId"`
|
|
|
+ OperationName string `json:"operationName"`
|
|
|
+ MessageId int64 `json:"messageId"`
|
|
|
+ MessageName string `json:"messageName"`
|
|
|
+ CreatedAt int64 `json:"createdAt"`
|
|
|
+ UpdatedAt int64 `json:"updatedAt"`
|
|
|
}
|
|
|
|
|
|
func (e *EventEstrus) TableName() string {
|
|
|
return "event_estrus"
|
|
|
}
|
|
|
|
|
|
-func NewEventEstrus(cow *Cow, currentUser *SystemUser, operation *SystemUser, req *pasturePb.EventEstrus) *EventEstrus {
|
|
|
+func NewEventEstrus(exposeEstrusType pasturePb.ExposeEstrusType_Kind, cow *Cow, currentUser *SystemUser, operation *SystemUser, req *pasturePb.EventEstrus) *EventEstrus {
|
|
|
return &EventEstrus{
|
|
|
- CowId: cow.Id,
|
|
|
- DayAge: cow.GetDayAge(),
|
|
|
- Lact: int8(cow.Lact),
|
|
|
- LactationDays: cow.GetLactationDays(),
|
|
|
- EstrusAt: int64(req.EstrusAt),
|
|
|
- Remarks: req.Remarks,
|
|
|
- IsMating: req.IsMathing,
|
|
|
- UnMatingReasons: req.UnMatingReasons,
|
|
|
- MessageId: currentUser.Id,
|
|
|
- MessageName: currentUser.Name,
|
|
|
- OperationId: operation.Id,
|
|
|
- OperationName: operation.Name,
|
|
|
+ CowId: cow.Id,
|
|
|
+ DayAge: cow.GetDayAge(),
|
|
|
+ Lact: int8(cow.Lact),
|
|
|
+ LactationDays: cow.GetLactationDays(),
|
|
|
+ EstrusAt: int64(req.EstrusAt),
|
|
|
+ Remarks: req.Remarks,
|
|
|
+ IsMating: req.IsMathing,
|
|
|
+ UnMatingReasons: req.UnMatingReasons,
|
|
|
+ MessageId: currentUser.Id,
|
|
|
+ MessageName: currentUser.Name,
|
|
|
+ OperationId: operation.Id,
|
|
|
+ OperationName: operation.Name,
|
|
|
+ ExposeEstrusType: exposeEstrusType,
|
|
|
}
|
|
|
}
|
|
|
|