123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- package model
- import pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
- const (
- High = "high"
- Rumina = "rumina"
- WeeklyActive = "weekly_active"
- XRuminaDisc = "x_rumina_disc"
- XChangeDiscount = "x_change_discount"
- ActiveLow = "active_low"
- ActiveMiddle = "active_middle"
- ActiveHigh = "active_high"
- MaxHabit = "max_habit"
- HealthWarning = "health_warning"
- MinWeeklyActive = "min_weekly_active"
- MaxPenBehavior = "pen_behavior"
- )
- type NeckRingConfigure struct {
- Id int64 `json:"id"`
- PastureId int64 `json:"pastureId"`
- Name string `json:"name"`
- Value int64 `json:"value"`
- Remarks string `json:"remarks"`
- IsShow pasturePb.IsShow_Kind `json:"is_show"`
- CreatedAt int64 `json:"createdAt"`
- UpdatedAt int64 `json:"updatedAt"`
- }
- func (s *NeckRingConfigure) TableName() string {
- return "neck_ring_configure"
- }
- func NeckRingConfigureInit(pastureId int64) []*NeckRingConfigure {
- res := make([]*NeckRingConfigure, 0)
- res = append(res, &NeckRingConfigure{
- PastureId: pastureId,
- Name: High,
- Value: 50,
- Remarks: "高活动量最低有效值",
- IsShow: pasturePb.IsShow_Ok,
- }, &NeckRingConfigure{
- PastureId: pastureId,
- Name: Rumina,
- Value: 5,
- Remarks: "反刍最低值",
- IsShow: pasturePb.IsShow_Ok,
- }, &NeckRingConfigure{
- PastureId: pastureId,
- Name: WeeklyActive,
- Value: 3000,
- Remarks: "周活动量初始值(oriWeeklyAct)",
- IsShow: pasturePb.IsShow_Ok,
- }, &NeckRingConfigure{
- PastureId: pastureId,
- Name: XRuminaDisc,
- Value: 3,
- Remarks: "变化趋势(使用的时候需要除以10)",
- IsShow: pasturePb.IsShow_Ok,
- }, &NeckRingConfigure{
- PastureId: pastureId,
- Name: XChangeDiscount,
- Value: 3,
- Remarks: "活动量滤波系数(使用的时候需要除以10)",
- IsShow: pasturePb.IsShow_Ok,
- }, &NeckRingConfigure{
- PastureId: pastureId,
- Name: ActiveLow,
- Value: 55,
- Remarks: "活动量低值",
- IsShow: pasturePb.IsShow_Ok,
- }, &NeckRingConfigure{
- PastureId: pastureId,
- Name: ActiveMiddle,
- Value: 75,
- Remarks: "活动量中间值",
- IsShow: pasturePb.IsShow_Ok,
- }, &NeckRingConfigure{
- PastureId: pastureId,
- Name: ActiveHigh,
- Value: 125,
- Remarks: "活动量高值",
- IsShow: pasturePb.IsShow_Ok,
- }, &NeckRingConfigure{
- PastureId: pastureId,
- Name: MaxHabit,
- Value: 0,
- Remarks: "脖环数据更新",
- IsShow: pasturePb.IsShow_Ok,
- }, &NeckRingConfigure{
- PastureId: pastureId,
- Name: HealthWarning,
- Value: 82,
- Remarks: "预警健康指数值",
- IsShow: pasturePb.IsShow_Ok,
- }, &NeckRingConfigure{
- PastureId: pastureId,
- Name: MinWeeklyActive,
- Value: 1500,
- Remarks: "周最小活动量值",
- IsShow: pasturePb.IsShow_Ok,
- }, &NeckRingConfigure{
- PastureId: pastureId,
- Name: new(PenBehavior).TableName(),
- Value: 0,
- Remarks: "栏舍行为数据",
- IsShow: pasturePb.IsShow_Ok,
- })
- return res
- }
|