config_data_extend.go 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. package backend
  2. import (
  3. "kpt-pasture/model"
  4. pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
  5. )
  6. func (s *StoreEntry) WorkOrderSubUnitEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  7. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  8. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  9. Value: int32(pasturePb.WorkOrderSubscribeUnit_Person),
  10. Label: "个人",
  11. Disabled: true,
  12. }, &pasturePb.ConfigOptionsList{
  13. Value: int32(pasturePb.WorkOrderSubscribeUnit_dept),
  14. Label: "部门",
  15. Disabled: true,
  16. })
  17. return configOptions
  18. }
  19. func (s *StoreEntry) WorkOrderPriorityEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  20. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  21. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  22. Value: int32(pasturePb.Priority_Low),
  23. Label: "低",
  24. Disabled: true,
  25. }, &pasturePb.ConfigOptionsList{
  26. Value: int32(pasturePb.Priority_Middle),
  27. Label: "一般",
  28. Disabled: true,
  29. }, &pasturePb.ConfigOptionsList{
  30. Value: int32(pasturePb.Priority_High),
  31. Label: "紧急",
  32. Disabled: true,
  33. })
  34. return configOptions
  35. }
  36. func (s *StoreEntry) WorkOrderCategoryEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  37. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  38. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  39. Value: int32(pasturePb.WorkOrderCategory_Health),
  40. Label: "保健",
  41. Disabled: true,
  42. }, &pasturePb.ConfigOptionsList{
  43. Value: int32(pasturePb.WorkOrderCategory_Breed),
  44. Label: "繁殖",
  45. Disabled: true,
  46. }, &pasturePb.ConfigOptionsList{
  47. Value: int32(pasturePb.WorkOrderCategory_Nutrition),
  48. Label: "营养",
  49. Disabled: true,
  50. }, &pasturePb.ConfigOptionsList{
  51. Value: int32(pasturePb.WorkOrderCategory_Ordinary),
  52. Label: "日常",
  53. Disabled: true,
  54. }, &pasturePb.ConfigOptionsList{
  55. Value: int32(pasturePb.WorkOrderCategory_Other),
  56. Label: "其他",
  57. Disabled: true,
  58. })
  59. return configOptions
  60. }
  61. func (s *StoreEntry) AdmissionStatusEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  62. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  63. if isAll == model.IsAllYes {
  64. configOptions = append(configOptions,
  65. &pasturePb.ConfigOptionsList{
  66. Value: int32(pasturePb.AuditStatus_Invalid),
  67. Label: "全部",
  68. Disabled: true,
  69. })
  70. }
  71. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  72. Value: int32(pasturePb.AdmissionStatus_Admission),
  73. Label: "在群",
  74. Disabled: true,
  75. }, &pasturePb.ConfigOptionsList{
  76. Value: int32(pasturePb.AdmissionStatus_Die),
  77. Label: "死亡",
  78. Disabled: true,
  79. }, &pasturePb.ConfigOptionsList{
  80. Value: int32(pasturePb.AdmissionStatus_Out),
  81. Label: "淘汰",
  82. Disabled: true,
  83. }, &pasturePb.ConfigOptionsList{
  84. Value: int32(pasturePb.AdmissionStatus_Sale),
  85. Label: "售卖",
  86. Disabled: true,
  87. }, &pasturePb.ConfigOptionsList{
  88. Value: int32(pasturePb.AdmissionStatus_Transfer),
  89. Label: "转出",
  90. Disabled: true,
  91. })
  92. return configOptions
  93. }
  94. func (s *StoreEntry) ForbiddenMatingReasonsEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  95. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  96. if isAll == model.IsAllYes {
  97. configOptions = append(configOptions,
  98. &pasturePb.ConfigOptionsList{
  99. Value: int32(pasturePb.AuditStatus_Invalid),
  100. Label: "全部",
  101. Disabled: true,
  102. })
  103. }
  104. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  105. Value: int32(pasturePb.ForbiddenMatingReasons_Metritis),
  106. Label: "子宫炎",
  107. Disabled: true,
  108. }, &pasturePb.ConfigOptionsList{
  109. Value: int32(pasturePb.ForbiddenMatingReasons_Reproductive_Diseases),
  110. Label: "繁殖疾病",
  111. Disabled: true,
  112. }, &pasturePb.ConfigOptionsList{
  113. Value: int32(pasturePb.ForbiddenMatingReasons_Reproductive_Failure),
  114. Label: "繁殖障碍",
  115. Disabled: true,
  116. }, &pasturePb.ConfigOptionsList{
  117. Value: int32(pasturePb.ForbiddenMatingReasons_Breast_Abnormalities),
  118. Label: "乳腺异常",
  119. Disabled: true,
  120. }, &pasturePb.ConfigOptionsList{
  121. Value: int32(pasturePb.ForbiddenMatingReasons_Low_Yield),
  122. Label: "低产",
  123. Disabled: true,
  124. }, &pasturePb.ConfigOptionsList{
  125. Value: int32(pasturePb.ForbiddenMatingReasons_Hoof_Disease),
  126. Label: "蹄病",
  127. Disabled: true,
  128. }, &pasturePb.ConfigOptionsList{
  129. Value: int32(pasturePb.ForbiddenMatingReasons_Other),
  130. Label: "其他",
  131. Disabled: true,
  132. })
  133. return configOptions
  134. }
  135. func (s *StoreEntry) WarningHealthLevel(isAll string) []*pasturePb.ConfigOptionsList {
  136. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  137. if isAll == model.IsAllYes {
  138. configOptions = append(configOptions,
  139. &pasturePb.ConfigOptionsList{
  140. Value: int32(0),
  141. Label: "全部",
  142. Disabled: true,
  143. })
  144. }
  145. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  146. Value: int32(pasturePb.WarningHealthLevel_Preliminary),
  147. Label: "初级疑似",
  148. Disabled: true,
  149. }, &pasturePb.ConfigOptionsList{
  150. Value: int32(pasturePb.WarningHealthLevel_Moderate),
  151. Label: "中级疑似",
  152. Disabled: true,
  153. }, &pasturePb.ConfigOptionsList{
  154. Value: int32(pasturePb.WarningHealthLevel_Height),
  155. Label: "高度疑似",
  156. Disabled: true,
  157. })
  158. return configOptions
  159. }
  160. func (s *StoreEntry) Behavior(isAll string) []*pasturePb.ConfigOptionsList {
  161. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  162. if isAll == model.IsAllYes {
  163. configOptions = append(configOptions,
  164. &pasturePb.ConfigOptionsList{
  165. Value: int32(0),
  166. Label: "全部",
  167. Disabled: true,
  168. })
  169. }
  170. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  171. Value: int32(pasturePb.Behavior_Rumina),
  172. Label: "反刍",
  173. Disabled: true,
  174. }, &pasturePb.ConfigOptionsList{
  175. Value: int32(pasturePb.Behavior_Intake),
  176. Label: "采食",
  177. Disabled: true,
  178. }, &pasturePb.ConfigOptionsList{
  179. Value: int32(pasturePb.Behavior_Reset),
  180. Label: "休息",
  181. Disabled: true,
  182. }, &pasturePb.ConfigOptionsList{
  183. Value: int32(pasturePb.Behavior_Immobility),
  184. Label: "静止",
  185. Disabled: true,
  186. }, &pasturePb.ConfigOptionsList{
  187. Value: int32(pasturePb.Behavior_Chew),
  188. Label: "咀嚼",
  189. Disabled: true,
  190. })
  191. return configOptions
  192. }
  193. func (s *StoreEntry) HealthStatusEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  194. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  195. if isAll == model.IsAllYes {
  196. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  197. Value: int32(pasturePb.HealthStatus_Invalid),
  198. Label: "全部",
  199. Disabled: true,
  200. })
  201. }
  202. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  203. Value: int32(pasturePb.HealthStatus_Health),
  204. Label: "健康",
  205. Disabled: true,
  206. }, &pasturePb.ConfigOptionsList{
  207. Value: int32(pasturePb.HealthStatus_Disease),
  208. Label: "发病",
  209. Disabled: true,
  210. }, &pasturePb.ConfigOptionsList{
  211. Value: int32(pasturePb.HealthStatus_Treatment),
  212. Label: "治疗中",
  213. Disabled: true,
  214. }, &pasturePb.ConfigOptionsList{
  215. Value: int32(pasturePb.HealthStatus_Curable),
  216. Label: "治愈",
  217. Disabled: true,
  218. }, &pasturePb.ConfigOptionsList{
  219. Value: int32(pasturePb.HealthStatus_Out),
  220. Label: "淘汰",
  221. Disabled: true,
  222. }, &pasturePb.ConfigOptionsList{
  223. Value: int32(pasturePb.HealthStatus_Dead),
  224. Label: "死亡",
  225. Disabled: true,
  226. })
  227. return configOptions
  228. }
  229. func (s *StoreEntry) MatingWindowPeriodEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  230. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  231. if isAll == model.IsAllYes {
  232. configOptions = append(configOptions,
  233. &pasturePb.ConfigOptionsList{
  234. Value: int32(0),
  235. Label: "全部",
  236. Disabled: true,
  237. })
  238. }
  239. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  240. Value: int32(pasturePb.MatingWindowPeriod_Front),
  241. Label: "早期",
  242. Disabled: true,
  243. }, &pasturePb.ConfigOptionsList{
  244. Value: int32(pasturePb.MatingWindowPeriod_Middle),
  245. Label: "最优",
  246. Disabled: true,
  247. }, &pasturePb.ConfigOptionsList{
  248. Value: int32(pasturePb.MatingWindowPeriod_Behind),
  249. Label: "晚期",
  250. Disabled: true,
  251. })
  252. return configOptions
  253. }