neck_ring_configure.go 3.2 KB

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