neck_ring_configure.go 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. package model
  2. import pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
  3. const (
  4. High = "high"
  5. Rumina = "rumina"
  6. WeeklyActive = "weekly_active"
  7. XRuminaDisc = "x_rumina_disc"
  8. XChangeDiscount = "x_change_discount"
  9. ActiveLow = "active_low"
  10. ActiveMiddle = "active_middle"
  11. ActiveHigh = "active_high"
  12. MaxHabit = "max_habit"
  13. HealthWarning = "health_warning"
  14. MinWeeklyActive = "min_weekly_active"
  15. MaxPenBehavior = "pen_behavior"
  16. )
  17. type NeckRingConfigure struct {
  18. Id int64 `json:"id"`
  19. PastureId int64 `json:"pastureId"`
  20. Name string `json:"name"`
  21. Value int64 `json:"value"`
  22. Remarks string `json:"remarks"`
  23. IsShow pasturePb.IsShow_Kind `json:"is_show"`
  24. CreatedAt int64 `json:"createdAt"`
  25. UpdatedAt int64 `json:"updatedAt"`
  26. }
  27. func (s *NeckRingConfigure) TableName() string {
  28. return "neck_ring_configure"
  29. }
  30. func NeckRingConfigureInit(pastureId int64) []*NeckRingConfigure {
  31. res := make([]*NeckRingConfigure, 0)
  32. res = append(res, &NeckRingConfigure{
  33. PastureId: pastureId,
  34. Name: High,
  35. Value: 50,
  36. Remarks: "高活动量最低有效值",
  37. IsShow: pasturePb.IsShow_Ok,
  38. }, &NeckRingConfigure{
  39. PastureId: pastureId,
  40. Name: Rumina,
  41. Value: 5,
  42. Remarks: "反刍最低值",
  43. IsShow: pasturePb.IsShow_Ok,
  44. }, &NeckRingConfigure{
  45. PastureId: pastureId,
  46. Name: WeeklyActive,
  47. Value: 3000,
  48. Remarks: "周活动量初始值(oriWeeklyAct)",
  49. IsShow: pasturePb.IsShow_Ok,
  50. }, &NeckRingConfigure{
  51. PastureId: pastureId,
  52. Name: XRuminaDisc,
  53. Value: 3,
  54. Remarks: "变化趋势(使用的时候需要除以10)",
  55. IsShow: pasturePb.IsShow_Ok,
  56. }, &NeckRingConfigure{
  57. PastureId: pastureId,
  58. Name: XChangeDiscount,
  59. Value: 3,
  60. Remarks: "活动量滤波系数(使用的时候需要除以10)",
  61. IsShow: pasturePb.IsShow_Ok,
  62. }, &NeckRingConfigure{
  63. PastureId: pastureId,
  64. Name: ActiveLow,
  65. Value: 55,
  66. Remarks: "活动量低值",
  67. IsShow: pasturePb.IsShow_Ok,
  68. }, &NeckRingConfigure{
  69. PastureId: pastureId,
  70. Name: ActiveMiddle,
  71. Value: 75,
  72. Remarks: "活动量中间值",
  73. IsShow: pasturePb.IsShow_Ok,
  74. }, &NeckRingConfigure{
  75. PastureId: pastureId,
  76. Name: ActiveHigh,
  77. Value: 125,
  78. Remarks: "活动量高值",
  79. IsShow: pasturePb.IsShow_Ok,
  80. }, &NeckRingConfigure{
  81. PastureId: pastureId,
  82. Name: MaxHabit,
  83. Value: 0,
  84. Remarks: "脖环数据更新",
  85. IsShow: pasturePb.IsShow_Ok,
  86. }, &NeckRingConfigure{
  87. PastureId: pastureId,
  88. Name: HealthWarning,
  89. Value: 82,
  90. Remarks: "预警健康指数值",
  91. IsShow: pasturePb.IsShow_Ok,
  92. }, &NeckRingConfigure{
  93. PastureId: pastureId,
  94. Name: MinWeeklyActive,
  95. Value: 1500,
  96. Remarks: "周最小活动量值",
  97. IsShow: pasturePb.IsShow_Ok,
  98. }, &NeckRingConfigure{
  99. PastureId: pastureId,
  100. Name: new(PenBehavior).TableName(),
  101. Value: 0,
  102. Remarks: "栏舍行为数据",
  103. IsShow: pasturePb.IsShow_Ok,
  104. })
  105. return res
  106. }