group_data.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. package models
  2. import (
  3. "time"
  4. )
  5. type PastureBodyRequest struct {
  6. PastureId int64 `json:"pasture_id"`
  7. Body []*FeedFormula `json:"body"`
  8. }
  9. type FeedFormula struct {
  10. Id int64 `json:"id"`
  11. Name string `json:"name"`
  12. Colour string `json:"colour"`
  13. EncodeNumber string `json:"encode_number"`
  14. CattleCategoryId int32 `json:"cattle_category_id"`
  15. CattleCategoryName string `json:"cattle_category_name"`
  16. FormulaTypeId int32 `json:"formula_type_id"`
  17. FormulaTypeName string `json:"formula_type_name"`
  18. DataSourceId int32 `json:"data_source_id"`
  19. DataSourceName string `json:"data_source_name"`
  20. Remarks string `json:"remarks"`
  21. Version int64 `json:"version"`
  22. PastureId int64 `json:"pasture_id"`
  23. PastureName string `json:"pasture_name"`
  24. IsShow int32 `json:"is_show"`
  25. IsModify int32 `json:"is_modify"`
  26. IsDelete int32 `json:"is_delete"`
  27. CreatedAt int64 `json:"created_at"`
  28. UpdatedAt int64 `json:"updated_at"`
  29. }
  30. type AnalysisAccuracyRequest struct {
  31. CattleParentCategoryId int32 `json:"cattle_Parent_Category_Id"`
  32. FeedFormulaId int32 `json:"feed_formula_id"`
  33. StartDate string `json:"start_date"`
  34. EndDate string `json:"end_date"` // 结束时间
  35. PastureId int32 `json:"pasture_id"` //牧场id
  36. }
  37. type MixedFodderDataList struct {
  38. Iweight int64 `xorm:"iweight" json:"iweight"`
  39. Oweight int64 `xorm:"oweight" json:"oweight"`
  40. Lweight float64 `xorm:"lweight" json:"lweight"`
  41. MyDate time.Time `xorm:"mydate" json:"mydate"`
  42. }
  43. type MixedFodderCorrectDataList struct {
  44. UseMixedFodderOptionNumber int32 `xorm:"use_mixed_fodder_option_number" json:"use_mixed_fodder_option_number"` // 已混料操作数
  45. Date string `xorm:"date" json:"date"` // 日期
  46. MixedCorrectNumber int32 `xorm:"mixed_correct_number" json:"mixed_correct_number"` // 混料正确数
  47. }
  48. type SprinkleFodderCorrectDataList struct {
  49. UseSprinkleOptionNumber int32 `xorm:"use_sprinkle_option_number" json:"use_sprinkle_option_number"` // 已撒料操作数
  50. Date string `xorm:"date" json:"date"` // 日期
  51. SprinkleCorrectNumber int32 `xorm:"sprinkle_correct_number" json:"sprinkle_correct_number"` // 撒料正确数
  52. }
  53. type AnalysisAccuracyResponse struct {
  54. MixedFodderAccurateRatio []*PastureAnalysisAccuracyDataValue `json:"mixed_fodder_accurate_ratio"` // 混料准确率
  55. MixedFodderCorrectRatio []*PastureAnalysisAccuracyDataValue `json:"mixed_fodder_correct_ratio"` // 混料正确率
  56. SprinkleFodderAccurateRatio []*PastureAnalysisAccuracyDataValue `json:"sprinkle_fodder_accurate_ratio"` // 撒料准确率
  57. SprinkleFodderCorrectRatio []*PastureAnalysisAccuracyDataValue `json:"sprinkle_fodder_correct_ratio"` // 撒料正确率
  58. }
  59. type PastureAnalysisAccuracyDataValue struct {
  60. DayTime string `json:"day_time"`
  61. Ratio float64 `json:"ratio"`
  62. }
  63. type ProcessAnalysisResponse struct {
  64. AddFeedTime *ProcessAnalysisDataValue `json:"add_feed_time"` // 加料时间
  65. SprinkleTime *ProcessAnalysisDataValue `json:"sprinkle_time"` // 撒料时间
  66. StirTime *ProcessAnalysisDataValue `json:"stir_time"` // 搅拌延迟时间
  67. }
  68. type ProcessAnalysisDataValue struct {
  69. MaxValue string `json:"max_value"` // 最大时间
  70. MinValue string `json:"min_value"` // 最小时间
  71. MiddleValue string `json:"middle_value"` // 中位值时间
  72. DownMiddleValue string `json:"down_middle_value"` // 下4分位值
  73. UpMiddleValue string `json:"up_middle_value"` // 上4分位值
  74. }
  75. type ProcessData struct {
  76. Id int64 `xorm:"id" json:"id"`
  77. ExecBeginTime time.Time `xorm:"exec_begin_time" json:"exec_begin_time"`
  78. ExecEndTime time.Time `xorm:"exec_end_time" json:"exec_end_time"`
  79. ExecProcessTime string `xorm:"exec_process_time" json:"exec_process_time"`
  80. ExecStirDelay int `xorm:"exec_stir_delay" json:"exec_stir_delay"`
  81. L2BeginTime time.Time `xorm:"l2_begin_time" json:"l2_begin_time"`
  82. L2EndTime time.Time `xorm:"l2_end_time" json:"l2_end_time"`
  83. L2ProcessTime string `xorm:"l2_process_time" json:"l2_process_time"`
  84. }
  85. type SprinkleStatisticsRequest struct {
  86. FeedFormulaId int32 `json:"feed_formula_id"`
  87. StartDate string `json:"start_date"`
  88. EndDate string `json:"end_date"` // 结束时间
  89. PastureId int32 `json:"pasture_id"` //牧场id
  90. }
  91. type SprinkleStatisticsDataList struct {
  92. FBarId int32 `xorm:"fbarid" json:"f_bar_id"`
  93. FName string `xorm:"fname" json:"f_name"`
  94. InTime time.Time `xorm:"intime" json:"in_time"`
  95. ProcessTime string `xorm:"processtime" json:"process_time"`
  96. Times int32 `xorm:"times" json:"times"`
  97. }