1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- package model
- import (
- "kpt-pasture/util"
- "time"
- pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
- )
- type EventWeaning struct {
- Id int64 `json:"id"`
- CowId int64 `json:"cowId"`
- PlanDay int64 `json:"planDay"`
- EndDay int64 `json:"endDay"`
- RealityDay int64 `json:"realityDay"`
- Status pasturePb.IsShow_Kind `json:"status"`
- BeforePenId int32 `json:"beforePenId"`
- AfterPenId int32 `json:"afterPenId"`
- RealityDayAge int32 `json:"realityDayAge"`
- Remarks string `json:"remarks"`
- OperationId int32 `json:"operationId"`
- OperationName string `json:"operationName"`
- CreatedAt int64 `json:"createdAt"`
- UpdatedAt int64 `json:"updatedAt"`
- }
- func (c *EventWeaning) TableName() string {
- return "event_weaning"
- }
- func NewEventWeaning(cowId int64, penId int32) *EventWeaning {
- return &EventWeaning{
- CowId: cowId,
- PlanDay: util.TimeParseLocalUnix(time.Now().Format(LayoutDate2)),
- EndDay: util.TimeParseLocalEndUnix(time.Now().Format(LayoutDate2)),
- Status: pasturePb.IsShow_No,
- BeforePenId: penId,
- }
- }
- func NewEventWeaningList(cowList []*Cow) []*EventWeaning {
- var weaningList = make([]*EventWeaning, 0)
- for _, cow := range cowList {
- weaningList = append(weaningList, NewEventWeaning(cow.Id, cow.PenId))
- }
- return weaningList
- }
- type WeaningHeader struct {
- Id string `json:"id"`
- CowId string `json:"cowId"`
- DayAge string `json:"dayAge"`
- PlanDay string `json:"planDay"`
- Status string `json:"status"`
- PenName string `json:"penName"`
- }
- type WeaningBody struct {
- Id int64 `json:"id"`
- CowId int64 `json:"cowId"`
- DayAge int64 `json:"dayAge"`
- PlanDay string `json:"planDay"`
- Status pasturePb.IsShow_Kind `json:"status"`
- PenName string `json:"penName"`
- }
|