same_time_cow_list.go 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package model
  2. import (
  3. pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
  4. )
  5. type SameTimeCowDetail struct {
  6. Id int64 `json:"id"`
  7. CowId int64 `json:"cowId"`
  8. Lact int32 `json:"lact"`
  9. PenId int64 `json:"penId"`
  10. SameTimeId int64 `json:"sameTimeId"`
  11. SameTimeType pasturePb.SameTimeType_Kind `json:"sameTimeType"`
  12. PlanDay string `json:"planDay"`
  13. EndDay string `json:"endDay"`
  14. RealityDay string `json:"realityDay"`
  15. Status pasturePb.IsShow_Kind `json:"status"`
  16. DrugsId int64 `json:"drugsId"`
  17. Unit pasturePb.Unit_Kind `json:"unit"`
  18. Usage int32 `json:"usage"`
  19. OperationId int64 `json:"operationId"`
  20. OperationName string `json:"operationName"`
  21. CreatedAt int64 `json:"createdAt"`
  22. UpdatedAt int64 `json:"updatedAt"`
  23. }
  24. func (s *SameTimeCowDetail) TableName() string {
  25. return "same_time_cow_detail"
  26. }
  27. func NewSameTimeCowDetailList(cowList []*Cow, sameTimeId int64, planTime string, sameTimeType pasturePb.SameTimeType_Kind) []*SameTimeCowDetail {
  28. res := make([]*SameTimeCowDetail, len(cowList))
  29. for i, cow := range cowList {
  30. res[i] = &SameTimeCowDetail{
  31. CowId: cow.Id,
  32. Lact: cow.Lact,
  33. PenId: cow.PenId,
  34. SameTimeId: sameTimeId,
  35. SameTimeType: sameTimeType,
  36. Status: pasturePb.IsShow_No,
  37. PlanDay: planTime,
  38. EndDay: planTime,
  39. }
  40. }
  41. return res
  42. }
  43. type SameTimeHeader struct {
  44. Id string `json:"id"`
  45. CowId string `json:"cowId"`
  46. BreedStatus string `json:"breedStatus"`
  47. PenName string `json:"penName"`
  48. Lact string `json:"lact"`
  49. CalvingAge string `json:"calvingAge"`
  50. AbortionAge string `json:"abortionAge"`
  51. DayAge string `json:"dayAge"`
  52. Status string `json:"status"`
  53. ExecType string `json:"execType"`
  54. }
  55. type SameTimeBody struct {
  56. Id int64 `json:"id"`
  57. CowId int64 `json:"cowId"`
  58. BreedStatus pasturePb.BreedStatus_Kind `json:"breedStatus"`
  59. PenName string `json:"penName"`
  60. Lact int32 `json:"lact"`
  61. CalvingAge int32 `json:"calvingAge"`
  62. AbortionAge int32 `json:"abortionAge"`
  63. DayAge int32 `json:"dayAge"`
  64. Status pasturePb.IsShow_Kind `json:"status"`
  65. ExecType string `json:"execType"` // todo 执行类型定义成枚举???
  66. }