|
@@ -18,6 +18,7 @@ type EventPregnantCheck struct {
|
|
PregnantCheckName string `json:"pregnantCheckName"`
|
|
PregnantCheckName string `json:"pregnantCheckName"`
|
|
PregnantCheckResult pasturePb.PregnantCheckResult_Kind `json:"pregnantCheckResult"`
|
|
PregnantCheckResult pasturePb.PregnantCheckResult_Kind `json:"pregnantCheckResult"`
|
|
PregnantCheckMethod pasturePb.PregnantCheckMethod_Kind `json:"pregnantCheckMethod"`
|
|
PregnantCheckMethod pasturePb.PregnantCheckMethod_Kind `json:"pregnantCheckMethod"`
|
|
|
|
+ Status pasturePb.IsShow_Kind `json:"status"`
|
|
OperationId int64 `json:"operationId"`
|
|
OperationId int64 `json:"operationId"`
|
|
OperationName string `json:"operationName"`
|
|
OperationName string `json:"operationName"`
|
|
Remarks string `json:"remarks"`
|
|
Remarks string `json:"remarks"`
|
|
@@ -37,6 +38,7 @@ func NewEventPregnantCheck(cow *Cow, pregnantCheckAt int64, pregnantCheckName st
|
|
PlanDay: time.Unix(pregnantCheckAt, 0).Format(LayoutTime),
|
|
PlanDay: time.Unix(pregnantCheckAt, 0).Format(LayoutTime),
|
|
EndDay: time.Unix(pregnantCheckAt, 0).Format(LayoutTime),
|
|
EndDay: time.Unix(pregnantCheckAt, 0).Format(LayoutTime),
|
|
PregnantCheckName: pregnantCheckName,
|
|
PregnantCheckName: pregnantCheckName,
|
|
|
|
+ Status: pasturePb.IsShow_No,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -79,3 +81,40 @@ func (e EventPregnantCheckSlice) ToPB(
|
|
}
|
|
}
|
|
return result
|
|
return result
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+type PregnantCheckHeader struct {
|
|
|
|
+ Id string `json:"id"`
|
|
|
|
+ CowId string `json:"cowId"`
|
|
|
|
+ CowType string `json:"cowType"`
|
|
|
|
+ DayAge string `json:"dayAge"`
|
|
|
|
+ Lact string `json:"lact"`
|
|
|
|
+ PlanDay string `json:"planDay"`
|
|
|
|
+ PenName string `json:"penName"`
|
|
|
|
+ CheckName string `json:"checkName"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+type PregnantCheckBody struct {
|
|
|
|
+ Id int64 `json:"id"`
|
|
|
|
+ CowId int64 `json:"cowId"`
|
|
|
|
+ CowType pasturePb.CowType_Kind `json:"cowType"`
|
|
|
|
+ DayAge int64 `json:"dayAge"`
|
|
|
|
+ Lact int32 `json:"lact"`
|
|
|
|
+ PlanDay string `json:"planDay"`
|
|
|
|
+ PenName string `json:"penName"`
|
|
|
|
+ CheckName string `json:"checkName"`
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func (e EventPregnantCheckSlice) ToPB2() []*PregnantCheckBody {
|
|
|
|
+ res := make([]*PregnantCheckBody, len(e))
|
|
|
|
+ for i, v := range e {
|
|
|
|
+ res[i] = &PregnantCheckBody{
|
|
|
|
+ Id: v.Id,
|
|
|
|
+ CowId: v.CowId,
|
|
|
|
+ DayAge: int64(v.DayAge),
|
|
|
|
+ Lact: int32(v.Lact),
|
|
|
|
+ PlanDay: v.PlanDay,
|
|
|
|
+ CheckName: PregnantCheckNameMap[v.PregnantCheckName],
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return res
|
|
|
|
+}
|