config_data.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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) BarnTypeEnumList() []*pasturePb.ConfigOptionsList {
  7. barnTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  8. barnTypeList = append(barnTypeList, &pasturePb.ConfigOptionsList{
  9. Value: int32(pasturePb.PenType_Lactating_Calves),
  10. Label: "哺乳牛舍",
  11. Disabled: true,
  12. }, &pasturePb.ConfigOptionsList{
  13. Value: int32(pasturePb.PenType_Weaned_Calves),
  14. Label: "断奶牛舍",
  15. Disabled: true,
  16. }, &pasturePb.ConfigOptionsList{
  17. Value: int32(pasturePb.PenType_Youth),
  18. Label: "育成牛舍",
  19. Disabled: true,
  20. }, &pasturePb.ConfigOptionsList{
  21. Value: int32(pasturePb.PenType_Nurturing),
  22. Label: "育成牛舍",
  23. Disabled: true,
  24. }, &pasturePb.ConfigOptionsList{
  25. Value: int32(pasturePb.PenType_Lactation),
  26. Label: "泌乳牛舍",
  27. Disabled: true,
  28. }, &pasturePb.ConfigOptionsList{
  29. Value: int32(pasturePb.PenType_Peripartum),
  30. Label: "围产牛舍",
  31. Disabled: true,
  32. }, &pasturePb.ConfigOptionsList{
  33. Value: int32(pasturePb.PenType_Dry_Milking),
  34. Label: "干奶牛舍",
  35. Disabled: true,
  36. }, &pasturePb.ConfigOptionsList{
  37. Value: int32(pasturePb.PenType_Sick_Cow),
  38. Label: "病牛舍",
  39. Disabled: true,
  40. }, &pasturePb.ConfigOptionsList{
  41. Value: int32(pasturePb.PenType_Out),
  42. Label: "淘汰牛舍",
  43. Disabled: true,
  44. }, &pasturePb.ConfigOptionsList{
  45. Value: int32(pasturePb.PenType_Segregate),
  46. Label: "隔离牛舍",
  47. Disabled: true,
  48. })
  49. return barnTypeList
  50. }
  51. func (s *StoreEntry) BreedStatusEnumList() []*pasturePb.ConfigOptionsList {
  52. breedStatusList := make([]*pasturePb.ConfigOptionsList, 0)
  53. breedStatusList = append(breedStatusList, &pasturePb.ConfigOptionsList{
  54. Value: int32(pasturePb.BreedStatus_UnBreed),
  55. Label: "未配",
  56. Disabled: true,
  57. }, &pasturePb.ConfigOptionsList{
  58. Value: int32(pasturePb.BreedStatus_Breeding),
  59. Label: "已配未检",
  60. Disabled: true,
  61. }, &pasturePb.ConfigOptionsList{
  62. Value: int32(pasturePb.BreedStatus_Pregnant),
  63. Label: "怀孕",
  64. Disabled: true,
  65. }, &pasturePb.ConfigOptionsList{
  66. Value: int32(pasturePb.BreedStatus_Empty),
  67. Label: "空怀",
  68. Disabled: true,
  69. }, &pasturePb.ConfigOptionsList{
  70. Value: int32(pasturePb.BreedStatus_Calving),
  71. Label: "产犊",
  72. Disabled: true,
  73. }, &pasturePb.ConfigOptionsList{
  74. Value: int32(pasturePb.BreedStatus_Abort),
  75. Label: "流产",
  76. Disabled: true,
  77. }, &pasturePb.ConfigOptionsList{
  78. Value: int32(pasturePb.BreedStatus_No_Mating),
  79. Label: "禁配",
  80. Disabled: true,
  81. })
  82. return breedStatusList
  83. }
  84. func (s *StoreEntry) CowKindEnumList() []*pasturePb.ConfigOptionsList {
  85. cowKindList := make([]*pasturePb.ConfigOptionsList, 0)
  86. cowKindList = append(cowKindList, &pasturePb.ConfigOptionsList{
  87. Value: int32(pasturePb.CowKind_XMTEN),
  88. Label: "西门塔尔牛",
  89. Disabled: true,
  90. }, &pasturePb.ConfigOptionsList{
  91. Value: int32(pasturePb.CowKind_AGSN),
  92. Label: "安格斯牛",
  93. Disabled: true,
  94. }, &pasturePb.ConfigOptionsList{
  95. Value: int32(pasturePb.CowKind_XNLN),
  96. Label: "夏洛莱牛",
  97. Disabled: true,
  98. }, &pasturePb.ConfigOptionsList{
  99. Value: int32(pasturePb.CowKind_LMZN),
  100. Label: "利木赞牛",
  101. Disabled: true,
  102. }, &pasturePb.ConfigOptionsList{
  103. Value: int32(pasturePb.CowKind_HFTN),
  104. Label: "海福特牛",
  105. Disabled: true,
  106. }, &pasturePb.ConfigOptionsList{
  107. Value: int32(pasturePb.CowKind_HN),
  108. Label: "和牛",
  109. Disabled: true,
  110. })
  111. return cowKindList
  112. }
  113. func (s *StoreEntry) CowSourceEnumList() []*pasturePb.ConfigOptionsList {
  114. cowSourceList := make([]*pasturePb.ConfigOptionsList, 0)
  115. cowSourceList = append(cowSourceList, &pasturePb.ConfigOptionsList{
  116. Value: int32(pasturePb.CowSource_Calving),
  117. Label: "产犊",
  118. Disabled: true,
  119. }, &pasturePb.ConfigOptionsList{
  120. Value: int32(pasturePb.CowSource_Transfer_In),
  121. Label: "调入",
  122. Disabled: true,
  123. }, &pasturePb.ConfigOptionsList{
  124. Value: int32(pasturePb.CowSource_Buy),
  125. Label: "购买",
  126. Disabled: true,
  127. })
  128. return cowSourceList
  129. }
  130. func (s *StoreEntry) CowTypeEnumList(optionName, isAll string) []*pasturePb.ConfigOptionsList {
  131. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  132. if isAll == model.IsAllYes {
  133. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  134. Value: int32(pasturePb.CowType_Invalid),
  135. Label: "全部",
  136. Disabled: true,
  137. })
  138. }
  139. if optionName == "breed" {
  140. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  141. Value: int32(pasturePb.CowType_Reserve_Calf),
  142. Label: "后备牛",
  143. Disabled: true,
  144. }, &pasturePb.ConfigOptionsList{
  145. Value: int32(pasturePb.CowType_Breeding_Calf),
  146. Label: "经产牛",
  147. Disabled: true,
  148. })
  149. return cowTypeList
  150. }
  151. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  152. Value: int32(pasturePb.CowType_Lactating_Calf),
  153. Label: "哺乳犊牛",
  154. Disabled: true,
  155. }, &pasturePb.ConfigOptionsList{
  156. Value: int32(pasturePb.CowType_Weaned_Calf),
  157. Label: "育成牛",
  158. Disabled: true,
  159. }, &pasturePb.ConfigOptionsList{
  160. Value: int32(pasturePb.CowType_Youth_Calf),
  161. Label: "青年牛",
  162. Disabled: true,
  163. }, &pasturePb.ConfigOptionsList{
  164. Value: int32(pasturePb.CowType_Fattening_Calf),
  165. Label: "育肥牛",
  166. Disabled: true,
  167. }, &pasturePb.ConfigOptionsList{
  168. Value: int32(pasturePb.CowType_Reserve_Calf),
  169. Label: "后备牛",
  170. Disabled: true,
  171. }, &pasturePb.ConfigOptionsList{
  172. Value: int32(pasturePb.CowType_Breeding_Calf),
  173. Label: "种母牛",
  174. Disabled: true,
  175. }, &pasturePb.ConfigOptionsList{
  176. Value: int32(pasturePb.CowType_Breeding_Bull),
  177. Label: "种公牛",
  178. Disabled: true,
  179. })
  180. return cowTypeList
  181. }
  182. func (s *StoreEntry) SameTimeCowTypeEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  183. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  184. if isAll == model.IsAllYes {
  185. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  186. Value: int32(pasturePb.SameTimeCowType_Invalid),
  187. Label: "全部",
  188. Disabled: true,
  189. })
  190. }
  191. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  192. Value: int32(pasturePb.SameTimeCowType_Empty),
  193. Label: "空怀牛",
  194. Disabled: true,
  195. }, &pasturePb.ConfigOptionsList{
  196. Value: int32(pasturePb.SameTimeCowType_Breeding_Calf),
  197. Label: "种母牛",
  198. Disabled: true,
  199. })
  200. return cowTypeList
  201. }
  202. func (s *StoreEntry) SameTimeTypeEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  203. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  204. if isAll == model.IsAllYes {
  205. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  206. Value: int32(pasturePb.SameTimeType_Invalid),
  207. Label: "全部",
  208. Disabled: true,
  209. })
  210. }
  211. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  212. Value: int32(pasturePb.SameTimeType_PGBJ),
  213. Label: "PG保健",
  214. Disabled: true,
  215. }, &pasturePb.ConfigOptionsList{
  216. Value: int32(pasturePb.SameTimeType_PGTQ),
  217. Label: "PG同期",
  218. Disabled: true,
  219. }, &pasturePb.ConfigOptionsList{
  220. Value: int32(pasturePb.SameTimeType_RnGH),
  221. Label: "RnGH",
  222. Disabled: true,
  223. }, &pasturePb.ConfigOptionsList{
  224. Value: int32(pasturePb.SameTimeType_TAI),
  225. Label: "TAI输精",
  226. Disabled: true,
  227. })
  228. return cowTypeList
  229. }
  230. func (s *StoreEntry) ImmunizationCowTypeEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  231. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  232. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  233. Value: int32(pasturePb.CowType_Lactating_Calf),
  234. Label: "犊牛",
  235. Disabled: true,
  236. }, &pasturePb.ConfigOptionsList{
  237. Value: int32(pasturePb.CowType_Weaned_Calf),
  238. Label: "育成牛",
  239. Disabled: true,
  240. }, &pasturePb.ConfigOptionsList{
  241. Value: int32(pasturePb.CowType_Youth_Calf),
  242. Label: "青年牛",
  243. Disabled: true,
  244. }, &pasturePb.ConfigOptionsList{
  245. Value: int32(pasturePb.CowType_Fattening_Calf),
  246. Label: "育肥牛",
  247. Disabled: true,
  248. }, &pasturePb.ConfigOptionsList{
  249. Value: int32(pasturePb.CowType_Reserve_Calf),
  250. Label: "后备牛",
  251. Disabled: true,
  252. }, &pasturePb.ConfigOptionsList{
  253. Value: int32(pasturePb.CowType_Reserve_Calf),
  254. Label: "种母牛",
  255. Disabled: true,
  256. }, &pasturePb.ConfigOptionsList{
  257. Value: int32(pasturePb.CowType_Breeding_Bull),
  258. Label: "种公牛",
  259. Disabled: true,
  260. })
  261. return cowTypeList
  262. }
  263. func (s *StoreEntry) ImmunizationConditionsEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  264. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  265. if isAll == model.IsAllYes {
  266. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  267. Value: int32(pasturePb.ImmunizationConditions_Invalid),
  268. Label: "全部",
  269. Disabled: true,
  270. })
  271. }
  272. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  273. Value: int32(pasturePb.ImmunizationConditions_Days_Age),
  274. Label: "日龄",
  275. Disabled: true,
  276. }, &pasturePb.ConfigOptionsList{
  277. Value: int32(pasturePb.ImmunizationConditions_Days_After_Delivery),
  278. Label: "产后天数",
  279. Disabled: true,
  280. }, &pasturePb.ConfigOptionsList{
  281. Value: int32(pasturePb.ImmunizationConditions_Days_Of_Pregnancy),
  282. Label: "怀孕天数",
  283. Disabled: true,
  284. }, &pasturePb.ConfigOptionsList{
  285. Value: int32(pasturePb.ImmunizationConditions_Admission_Days),
  286. Label: "入场天数",
  287. Disabled: true,
  288. }, &pasturePb.ConfigOptionsList{
  289. Value: int32(pasturePb.ImmunizationConditions_Other_Vaccine_After),
  290. Label: "基于其他疫苗之后",
  291. Disabled: true,
  292. })
  293. return cowTypeList
  294. }
  295. func (s *StoreEntry) TransferPenEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  296. transferPenList := make([]*pasturePb.ConfigOptionsList, 0)
  297. if isAll == model.IsAllYes {
  298. transferPenList = append(transferPenList, &pasturePb.ConfigOptionsList{
  299. Value: int32(pasturePb.TransferPenReason_Invalid),
  300. Label: "全部",
  301. Disabled: true,
  302. })
  303. }
  304. transferPenList = append(transferPenList, &pasturePb.ConfigOptionsList{
  305. Value: int32(pasturePb.TransferPenReason_Normal),
  306. Label: "正常转群",
  307. Disabled: true,
  308. }, &pasturePb.ConfigOptionsList{
  309. Value: int32(pasturePb.TransferPenReason_Feed),
  310. Label: "饲喂转群",
  311. Disabled: true,
  312. }, &pasturePb.ConfigOptionsList{
  313. Value: int32(pasturePb.TransferPenReason_Dry_Milk),
  314. Label: "干奶转群",
  315. Disabled: true,
  316. }, &pasturePb.ConfigOptionsList{
  317. Value: int32(pasturePb.TransferPenReason_Pregnant),
  318. Label: "怀孕转群",
  319. Disabled: true,
  320. }, &pasturePb.ConfigOptionsList{
  321. Value: int32(pasturePb.TransferPenReason_Overantibody),
  322. Label: "过抗转群",
  323. Disabled: true,
  324. })
  325. return transferPenList
  326. }
  327. func (s *StoreEntry) ChildNumberEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  328. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  329. if isAll == model.IsAllYes {
  330. configOptions = append(configOptions,
  331. &pasturePb.ConfigOptionsList{
  332. Value: int32(pasturePb.ChildNumber_Invalid),
  333. Label: "全部",
  334. Disabled: true,
  335. })
  336. }
  337. configOptions = append(configOptions,
  338. &pasturePb.ConfigOptionsList{
  339. Value: int32(pasturePb.ChildNumber_One),
  340. Label: "单胎",
  341. Disabled: true,
  342. }, &pasturePb.ConfigOptionsList{
  343. Value: int32(pasturePb.ChildNumber_Two),
  344. Label: "双胎",
  345. Disabled: true,
  346. }, &pasturePb.ConfigOptionsList{
  347. Value: int32(pasturePb.ChildNumber_Three),
  348. Label: "三胎",
  349. Disabled: true,
  350. }, &pasturePb.ConfigOptionsList{
  351. Value: int32(pasturePb.ChildNumber_Four),
  352. Label: "四胎",
  353. Disabled: true,
  354. })
  355. return configOptions
  356. }
  357. func (s *StoreEntry) CalvingLevelEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  358. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  359. if isAll == model.IsAllYes {
  360. configOptions = append(configOptions,
  361. &pasturePb.ConfigOptionsList{
  362. Value: int32(pasturePb.CalvingLevel_Invalid),
  363. Label: "全部",
  364. Disabled: true,
  365. })
  366. }
  367. configOptions = append(configOptions,
  368. &pasturePb.ConfigOptionsList{
  369. Value: int32(pasturePb.CalvingLevel_Natural_Childbirth),
  370. Label: "自然分娩",
  371. Disabled: true,
  372. }, &pasturePb.ConfigOptionsList{
  373. Value: int32(pasturePb.CalvingLevel_Artificial_Midwifery1),
  374. Label: "人工助产(1-2人)",
  375. Disabled: true,
  376. }, &pasturePb.ConfigOptionsList{
  377. Value: int32(pasturePb.CalvingLevel_Artificial_Midwifery2),
  378. Label: "人工助产(3人以上)",
  379. Disabled: true,
  380. }, &pasturePb.ConfigOptionsList{
  381. Value: int32(pasturePb.CalvingLevel_Caesarean_Section),
  382. Label: "剖腹产",
  383. Disabled: true,
  384. })
  385. return configOptions
  386. }
  387. func (s *StoreEntry) DystociaReasonEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  388. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  389. if isAll == model.IsAllYes {
  390. configOptions = append(configOptions,
  391. &pasturePb.ConfigOptionsList{
  392. Value: int32(pasturePb.DystociaReason_Invalid),
  393. Label: "全部",
  394. Disabled: true,
  395. })
  396. }
  397. configOptions = append(configOptions,
  398. &pasturePb.ConfigOptionsList{
  399. Value: int32(pasturePb.DystociaReason_Malposition),
  400. Label: "胎位不正",
  401. Disabled: true,
  402. }, &pasturePb.ConfigOptionsList{
  403. Value: int32(pasturePb.DystociaReason_Fetal_Overgrowth),
  404. Label: "胎儿过大",
  405. Disabled: true,
  406. }, &pasturePb.ConfigOptionsList{
  407. Value: int32(pasturePb.DystociaReason_Uterine_Atony),
  408. Label: "子宫收缩无力",
  409. Disabled: true,
  410. }, &pasturePb.ConfigOptionsList{
  411. Value: int32(pasturePb.DystociaReason_Pelvic_Stenosis),
  412. Label: "盆骨狭小",
  413. Disabled: true,
  414. }, &pasturePb.ConfigOptionsList{
  415. Value: int32(pasturePb.DystociaReason_Sub_Health),
  416. Label: "母牛亚健康状态",
  417. Disabled: true,
  418. })
  419. return configOptions
  420. }
  421. func (s *StoreEntry) PregnantCheckResultEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  422. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  423. if isAll == model.IsAllYes {
  424. configOptions = append(configOptions,
  425. &pasturePb.ConfigOptionsList{
  426. Value: int32(pasturePb.PregnantCheckResult_Invalid),
  427. Label: "全部",
  428. Disabled: true,
  429. })
  430. }
  431. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  432. Value: int32(pasturePb.PregnantCheckResult_Pregnant),
  433. Label: "有胎",
  434. Disabled: true,
  435. }, &pasturePb.ConfigOptionsList{
  436. Value: int32(pasturePb.PregnantCheckResult_UnPregnant),
  437. Label: "无胎",
  438. Disabled: true,
  439. })
  440. return configOptions
  441. }