config_data_extend.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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. }
  254. func (s *StoreEntry) DataWaringTypeEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  255. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  256. if isAll == model.IsAllYes {
  257. configOptions = append(configOptions,
  258. &pasturePb.ConfigOptionsList{
  259. Value: int32(0),
  260. Label: "全部",
  261. Disabled: true,
  262. })
  263. }
  264. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  265. Value: int32(pasturePb.DataWarningType_Sale_Standard),
  266. Label: "出栏标准",
  267. Disabled: true,
  268. Props: "达到出栏重量的牛只",
  269. }, &pasturePb.ConfigOptionsList{
  270. Value: int32(pasturePb.DataWarningType_UnPregnant_Mating_Time),
  271. Label: ">6次未孕牛只",
  272. Disabled: true,
  273. Props: "配次高于6次未孕牛只",
  274. }, &pasturePb.ConfigOptionsList{
  275. Value: int32(pasturePb.DataWarningType_Abortion_Time),
  276. Label: ">2次流产牛只",
  277. Disabled: true,
  278. Props: "本胎次内流产大于2次的牛只",
  279. }, &pasturePb.ConfigOptionsList{
  280. Value: int32(pasturePb.DataWarningType_Over_Age_UnPaired_Young),
  281. Label: "超龄未配(青年牛)",
  282. Disabled: true,
  283. Props: "超15个月未配青年牛",
  284. }, &pasturePb.ConfigOptionsList{
  285. Value: int32(pasturePb.DataWarningType_Over_Age_UnPregnant_Young),
  286. Label: "超龄未孕(青年牛)",
  287. Disabled: true,
  288. Props: "超22月未孕青年牛",
  289. }, &pasturePb.ConfigOptionsList{
  290. Value: int32(pasturePb.DataWarningType_Over_Age_UnPregnant_Young),
  291. Label: "超18月未卖",
  292. Disabled: true,
  293. Props: "饲养超过18个月未卖出牛只",
  294. })
  295. return configOptions
  296. }
  297. func (s *StoreEntry) NeckRingErrorEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  298. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  299. if isAll == model.IsAllYes {
  300. configOptions = append(configOptions,
  301. &pasturePb.ConfigOptionsList{
  302. Value: int32(0),
  303. Label: "全部",
  304. Disabled: true,
  305. })
  306. }
  307. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  308. Value: int32(pasturePb.NeckRingNumberError_Suspected_Fall_Off),
  309. Label: "疑似脱落",
  310. Disabled: true,
  311. }, &pasturePb.ConfigOptionsList{
  312. Value: int32(pasturePb.NeckRingNumberError_No_Signal),
  313. Label: "无信号",
  314. Disabled: true,
  315. }, &pasturePb.ConfigOptionsList{
  316. Value: int32(pasturePb.NeckRingNumberError_Receiving_Less),
  317. Label: "接受数据过少",
  318. Disabled: true,
  319. }, &pasturePb.ConfigOptionsList{
  320. Value: int32(pasturePb.NeckRingNumberError_Low_Battery),
  321. Label: "低电量",
  322. Disabled: true,
  323. }, &pasturePb.ConfigOptionsList{
  324. Value: int32(pasturePb.NeckRingNumberError_Data_Latency),
  325. Label: "数据有延迟",
  326. Disabled: true,
  327. }, &pasturePb.ConfigOptionsList{
  328. Value: int32(pasturePb.NeckRingNumberError_Low_Activity_Level),
  329. Label: "活动量过低",
  330. Disabled: true,
  331. }, &pasturePb.ConfigOptionsList{
  332. Value: int32(pasturePb.NeckRingNumberError_Abnormal_Wearing),
  333. Label: "佩戴异常",
  334. Disabled: true,
  335. }, &pasturePb.ConfigOptionsList{
  336. Value: int32(pasturePb.NeckRingNumberError_Should_Associated),
  337. Label: "脖环号未绑定牛号",
  338. Disabled: true,
  339. })
  340. return configOptions
  341. }