config_data.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. package backend
  2. import (
  3. "kpt-pasture/model"
  4. "gitee.com/xuyiping_admin/pkg/logger/zaplog"
  5. "go.uber.org/zap"
  6. pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
  7. )
  8. func (s *StoreEntry) BarnTypeEnumList() []*pasturePb.ConfigOptionsList {
  9. barnTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  10. barnTypeList = append(barnTypeList, &pasturePb.ConfigOptionsList{
  11. Value: int32(pasturePb.PenType_Lactating_Calves),
  12. Label: "哺乳犊牛舍",
  13. Disabled: true,
  14. }, &pasturePb.ConfigOptionsList{
  15. Value: int32(pasturePb.PenType_Weaned_Calves),
  16. Label: "断奶犊牛舍",
  17. Disabled: true,
  18. }, &pasturePb.ConfigOptionsList{
  19. Value: int32(pasturePb.PenType_Youth),
  20. Label: "育成牛舍",
  21. Disabled: true,
  22. }, &pasturePb.ConfigOptionsList{
  23. Value: int32(pasturePb.PenType_Nurturing),
  24. Label: "育成牛舍",
  25. Disabled: true,
  26. }, &pasturePb.ConfigOptionsList{
  27. Value: int32(pasturePb.PenType_Lactation),
  28. Label: "泌乳牛舍",
  29. Disabled: true,
  30. }, &pasturePb.ConfigOptionsList{
  31. Value: int32(pasturePb.PenType_Peripartum),
  32. Label: "围产牛舍",
  33. Disabled: true,
  34. }, &pasturePb.ConfigOptionsList{
  35. Value: int32(pasturePb.PenType_Dry_Milking),
  36. Label: "干奶牛舍",
  37. Disabled: true,
  38. }, &pasturePb.ConfigOptionsList{
  39. Value: int32(pasturePb.PenType_Sick_Cow),
  40. Label: "病牛舍",
  41. Disabled: true,
  42. }, &pasturePb.ConfigOptionsList{
  43. Value: int32(pasturePb.PenType_Eliminate),
  44. Label: "淘汰牛舍",
  45. Disabled: true,
  46. })
  47. return barnTypeList
  48. }
  49. func (s *StoreEntry) BreedStatusEnumList() []*pasturePb.ConfigOptionsList {
  50. breedStatusList := make([]*pasturePb.ConfigOptionsList, 0)
  51. breedStatusList = append(breedStatusList, &pasturePb.ConfigOptionsList{
  52. Value: int32(pasturePb.BreedStatus_Unmarried),
  53. Label: "未配",
  54. Disabled: true,
  55. }, &pasturePb.ConfigOptionsList{
  56. Value: int32(pasturePb.BreedStatus_InCheck_Unpregnant),
  57. Label: "初检无胎",
  58. Disabled: true,
  59. }, &pasturePb.ConfigOptionsList{
  60. Value: int32(pasturePb.BreedStatus_InCheck_Pregnant),
  61. Label: "初检有胎",
  62. Disabled: true,
  63. }, &pasturePb.ConfigOptionsList{
  64. Value: int32(pasturePb.BreedStatus_Recheck_Unpregnant),
  65. Label: "复检无胎",
  66. Disabled: true,
  67. }, &pasturePb.ConfigOptionsList{
  68. Value: int32(pasturePb.BreedStatus_Recheck_Pregnant),
  69. Label: "复检有胎",
  70. Disabled: true,
  71. }, &pasturePb.ConfigOptionsList{
  72. Value: int32(pasturePb.BreedStatus_Pause_Pregnant),
  73. Label: "停配",
  74. Disabled: true,
  75. }, &pasturePb.ConfigOptionsList{
  76. Value: int32(pasturePb.BreedStatus_No_Pregnant),
  77. Label: "禁配",
  78. Disabled: true,
  79. })
  80. return breedStatusList
  81. }
  82. func (s *StoreEntry) CowKindEnumList() []*pasturePb.ConfigOptionsList {
  83. cowKindList := make([]*pasturePb.ConfigOptionsList, 0)
  84. cowKindList = append(cowKindList, &pasturePb.ConfigOptionsList{
  85. Value: int32(pasturePb.CowKind_HST),
  86. Label: "荷斯坦",
  87. Disabled: true,
  88. }, &pasturePb.ConfigOptionsList{
  89. Value: int32(pasturePb.CowKind_JSN),
  90. Label: "娟姗牛",
  91. Disabled: true,
  92. }, &pasturePb.ConfigOptionsList{
  93. Value: int32(pasturePb.CowKind_SHN),
  94. Label: "三河牛",
  95. Disabled: true,
  96. }, &pasturePb.ConfigOptionsList{
  97. Value: int32(pasturePb.CowKind_XJHN),
  98. Label: "新疆褐牛",
  99. Disabled: true,
  100. }, &pasturePb.ConfigOptionsList{
  101. Value: int32(pasturePb.CowKind_MN),
  102. Label: "牦牛",
  103. Disabled: true,
  104. }, &pasturePb.ConfigOptionsList{
  105. Value: int32(pasturePb.CowKind_XMTEN),
  106. Label: "西门塔尔牛",
  107. Disabled: true,
  108. })
  109. return cowKindList
  110. }
  111. func (s *StoreEntry) CowSourceEnumList() []*pasturePb.ConfigOptionsList {
  112. cowSourceList := make([]*pasturePb.ConfigOptionsList, 0)
  113. cowSourceList = append(cowSourceList, &pasturePb.ConfigOptionsList{
  114. Value: int32(pasturePb.CowSource_Calving),
  115. Label: "产犊",
  116. Disabled: true,
  117. }, &pasturePb.ConfigOptionsList{
  118. Value: int32(pasturePb.CowSource_Transfer_In),
  119. Label: "调入",
  120. Disabled: true,
  121. }, &pasturePb.ConfigOptionsList{
  122. Value: int32(pasturePb.CowSource_Buy),
  123. Label: "购买",
  124. Disabled: true,
  125. })
  126. return cowSourceList
  127. }
  128. func (s *StoreEntry) CowStatusEnumList() []*pasturePb.ConfigOptionsList {
  129. cowStatusList := make([]*pasturePb.ConfigOptionsList, 0)
  130. cowStatusList = append(cowStatusList, &pasturePb.ConfigOptionsList{
  131. Value: int32(pasturePb.CowStatus_Calving),
  132. Label: "产犊",
  133. Disabled: true,
  134. }, &pasturePb.ConfigOptionsList{
  135. Value: int32(pasturePb.CowStatus_Empty),
  136. Label: "空怀",
  137. Disabled: true,
  138. }, &pasturePb.ConfigOptionsList{
  139. Value: int32(pasturePb.CowStatus_Breeding),
  140. Label: "配种",
  141. Disabled: true,
  142. }, &pasturePb.ConfigOptionsList{
  143. Value: int32(pasturePb.CowStatus_Pregnant),
  144. Label: "怀孕",
  145. Disabled: true,
  146. }, &pasturePb.ConfigOptionsList{
  147. Value: int32(pasturePb.CowStatus_Dry_Milk),
  148. Label: "干奶",
  149. Disabled: true,
  150. }, &pasturePb.ConfigOptionsList{
  151. Value: int32(pasturePb.CowStatus_Peripartum),
  152. Label: "围产",
  153. Disabled: true,
  154. }, &pasturePb.ConfigOptionsList{
  155. Value: int32(pasturePb.CowStatus_No_Pregnant),
  156. Label: "禁配",
  157. Disabled: true,
  158. })
  159. return cowStatusList
  160. }
  161. func (s *StoreEntry) CowTypeEnumList() []*pasturePb.ConfigOptionsList {
  162. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  163. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  164. Value: int32(pasturePb.CowType_Lactating_Calf),
  165. Label: "哺乳犊牛",
  166. Disabled: true,
  167. }, &pasturePb.ConfigOptionsList{
  168. Value: int32(pasturePb.CowType_Weaned_Calf),
  169. Label: "断奶犊牛",
  170. Disabled: true,
  171. }, &pasturePb.ConfigOptionsList{
  172. Value: int32(pasturePb.CowType_Youth_Calf),
  173. Label: "青年牛",
  174. Disabled: true,
  175. }, &pasturePb.ConfigOptionsList{
  176. Value: int32(pasturePb.CowType_Fattening_Calf),
  177. Label: "育肥牛",
  178. Disabled: true,
  179. }, &pasturePb.ConfigOptionsList{
  180. Value: int32(pasturePb.CowType_Reserve_Calf),
  181. Label: "后备牛",
  182. Disabled: true,
  183. }, &pasturePb.ConfigOptionsList{
  184. Value: int32(pasturePb.CowType_Breeding_Calf),
  185. Label: "种母牛",
  186. Disabled: true,
  187. }, &pasturePb.ConfigOptionsList{
  188. Value: int32(pasturePb.CowType_Breeding_Bull),
  189. Label: "种公牛",
  190. Disabled: true,
  191. })
  192. return cowTypeList
  193. }
  194. func (s *StoreEntry) SemeTimeCowTypeEnumList() []*pasturePb.ConfigOptionsList {
  195. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  196. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  197. Value: int32(pasturePb.CowType_Reserve_Calf),
  198. Label: "后备牛",
  199. Disabled: true,
  200. }, &pasturePb.ConfigOptionsList{
  201. Value: int32(pasturePb.CowType_Breeding_Calf),
  202. Label: "种母牛",
  203. Disabled: true,
  204. })
  205. return cowTypeList
  206. }
  207. func (s *StoreEntry) ImmunizationCowTypeEnumList() []*pasturePb.ConfigOptionsList {
  208. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  209. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  210. Value: int32(pasturePb.ImmunizationCowType_Reserve_Cattle),
  211. Label: "后备牛",
  212. Disabled: true,
  213. }, &pasturePb.ConfigOptionsList{
  214. Value: int32(pasturePb.ImmunizationCowType_Adult_Cow),
  215. Label: "种母牛",
  216. Disabled: true,
  217. }, &pasturePb.ConfigOptionsList{
  218. Value: int32(pasturePb.ImmunizationCowType_Adult_bulls),
  219. Label: "种公牛",
  220. Disabled: true,
  221. }, &pasturePb.ConfigOptionsList{
  222. Value: int32(pasturePb.ImmunizationCowType_Calf),
  223. Label: "犊牛",
  224. Disabled: true,
  225. })
  226. return cowTypeList
  227. }
  228. func (s *StoreEntry) ImmunizationConditionsEnumList() []*pasturePb.ConfigOptionsList {
  229. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  230. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  231. Value: int32(pasturePb.ImmunizationConditions_Days_Age),
  232. Label: "日龄",
  233. Disabled: true,
  234. }, &pasturePb.ConfigOptionsList{
  235. Value: int32(pasturePb.ImmunizationConditions_Days_After_Delivery),
  236. Label: "产后天数",
  237. Disabled: true,
  238. }, &pasturePb.ConfigOptionsList{
  239. Value: int32(pasturePb.ImmunizationConditions_Days_Of_Pregnancy),
  240. Label: "怀孕天数",
  241. Disabled: true,
  242. }, &pasturePb.ConfigOptionsList{
  243. Value: int32(pasturePb.ImmunizationConditions_Month),
  244. Label: "每年月份",
  245. Disabled: true,
  246. }, &pasturePb.ConfigOptionsList{
  247. Value: int32(pasturePb.ImmunizationConditions_Admission_Days),
  248. Label: "入场天数",
  249. Disabled: true,
  250. })
  251. return cowTypeList
  252. }
  253. func (s *StoreEntry) TransferPenEnumList() []*pasturePb.ConfigOptionsList {
  254. transferPenList := make([]*pasturePb.ConfigOptionsList, 0)
  255. transferPenList = append(transferPenList, &pasturePb.ConfigOptionsList{
  256. Value: int32(pasturePb.TransferPenReason_Normal),
  257. Label: "正常转群",
  258. Disabled: true,
  259. }, &pasturePb.ConfigOptionsList{
  260. Value: int32(pasturePb.TransferPenReason_Feed),
  261. Label: "饲喂转群",
  262. Disabled: true,
  263. }, &pasturePb.ConfigOptionsList{
  264. Value: int32(pasturePb.TransferPenReason_Dry_Milk),
  265. Label: "干奶转群",
  266. Disabled: true,
  267. }, &pasturePb.ConfigOptionsList{
  268. Value: int32(pasturePb.TransferPenReason_Pregnant),
  269. Label: "怀孕转群",
  270. Disabled: true,
  271. }, &pasturePb.ConfigOptionsList{
  272. Value: int32(pasturePb.TransferPenReason_Overantibody),
  273. Label: "过抗转群",
  274. Disabled: true,
  275. })
  276. return transferPenList
  277. }
  278. func (s *StoreEntry) ChildNumberEnumList() []*pasturePb.ConfigOptionsList {
  279. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  280. configOptions = append(configOptions,
  281. &pasturePb.ConfigOptionsList{
  282. Value: int32(pasturePb.ChildNumber_One),
  283. Label: "单胎",
  284. Disabled: true,
  285. }, &pasturePb.ConfigOptionsList{
  286. Value: int32(pasturePb.ChildNumber_Two),
  287. Label: "双胎",
  288. Disabled: true,
  289. }, &pasturePb.ConfigOptionsList{
  290. Value: int32(pasturePb.ChildNumber_Three),
  291. Label: "三胎",
  292. Disabled: true,
  293. }, &pasturePb.ConfigOptionsList{
  294. Value: int32(pasturePb.ChildNumber_Four),
  295. Label: "四胎",
  296. Disabled: true,
  297. })
  298. return configOptions
  299. }
  300. func (s *StoreEntry) CalvingLevelEnumList() []*pasturePb.ConfigOptionsList {
  301. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  302. configOptions = append(configOptions,
  303. &pasturePb.ConfigOptionsList{
  304. Value: int32(pasturePb.CalvingLevel_Natural_Childbirth),
  305. Label: "自然分娩",
  306. Disabled: true,
  307. }, &pasturePb.ConfigOptionsList{
  308. Value: int32(pasturePb.CalvingLevel_Artificial_Midwifery1),
  309. Label: "人工助产(1-2人)",
  310. Disabled: true,
  311. }, &pasturePb.ConfigOptionsList{
  312. Value: int32(pasturePb.CalvingLevel_Artificial_Midwifery2),
  313. Label: "人工助产(3人以上)",
  314. Disabled: true,
  315. }, &pasturePb.ConfigOptionsList{
  316. Value: int32(pasturePb.CalvingLevel_Caesarean_Section),
  317. Label: "剖腹产",
  318. Disabled: true,
  319. })
  320. return configOptions
  321. }
  322. func (s *StoreEntry) DystociaReasonEnumList() []*pasturePb.ConfigOptionsList {
  323. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  324. configOptions = append(configOptions,
  325. &pasturePb.ConfigOptionsList{
  326. Value: int32(pasturePb.DystociaReason_Malposition),
  327. Label: "胎位不正",
  328. Disabled: true,
  329. }, &pasturePb.ConfigOptionsList{
  330. Value: int32(pasturePb.DystociaReason_Fetal_Overgrowth),
  331. Label: "胎儿过大",
  332. Disabled: true,
  333. }, &pasturePb.ConfigOptionsList{
  334. Value: int32(pasturePb.DystociaReason_Uterine_Atony),
  335. Label: "子宫收缩无力",
  336. Disabled: true,
  337. }, &pasturePb.ConfigOptionsList{
  338. Value: int32(pasturePb.DystociaReason_Pelvic_Stenosis),
  339. Label: "盆骨狭小",
  340. Disabled: true,
  341. }, &pasturePb.ConfigOptionsList{
  342. Value: int32(pasturePb.DystociaReason_Sub_Health),
  343. Label: "母牛亚健康状态",
  344. Disabled: true,
  345. })
  346. return configOptions
  347. }
  348. func (s *StoreEntry) PregnantCheckResultEnumList() []*pasturePb.ConfigOptionsList {
  349. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  350. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  351. Value: int32(pasturePb.PregnantCheckResult_InCheck_UnPregnant),
  352. Label: "初检未孕",
  353. Disabled: true,
  354. }, &pasturePb.ConfigOptionsList{
  355. Value: int32(pasturePb.PregnantCheckResult_InCheck_Pregnant),
  356. Label: "初检已孕",
  357. Disabled: true,
  358. }, &pasturePb.ConfigOptionsList{
  359. Value: int32(pasturePb.PregnantCheckResult_Recheck_UnPregnant),
  360. Label: "复检未孕",
  361. Disabled: true,
  362. }, &pasturePb.ConfigOptionsList{
  363. Value: int32(pasturePb.PregnantCheckResult_Recheck_Pregnant),
  364. Label: "初检已孕",
  365. Disabled: true,
  366. })
  367. return configOptions
  368. }
  369. func (s *StoreEntry) PregnantCheckMethodEnumList() []*pasturePb.ConfigOptionsList {
  370. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  371. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  372. Value: int32(pasturePb.PregnantCheckMethod_B_Ultrasound),
  373. Label: "B超",
  374. Disabled: true,
  375. }, &pasturePb.ConfigOptionsList{
  376. Value: int32(pasturePb.PregnantCheckMethod_Blood_Testing),
  377. Label: "血检",
  378. Disabled: true,
  379. }, &pasturePb.ConfigOptionsList{
  380. Value: int32(pasturePb.PregnantCheckMethod_Manual_Inspection),
  381. Label: "人工检查",
  382. Disabled: true,
  383. })
  384. return configOptions
  385. }
  386. func (s *StoreEntry) DrugCategoryEnumList() []*pasturePb.ConfigOptionsList {
  387. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  388. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  389. Value: int32(pasturePb.DrugCategory_Antibiotics),
  390. Label: "抗生素类",
  391. Disabled: true,
  392. }, &pasturePb.ConfigOptionsList{
  393. Value: int32(pasturePb.DrugCategory_Antivirals),
  394. Label: "抗病毒类",
  395. Disabled: true,
  396. }, &pasturePb.ConfigOptionsList{
  397. Value: int32(pasturePb.DrugCategory_Antifungals),
  398. Label: "抗真菌类",
  399. Disabled: true,
  400. }, &pasturePb.ConfigOptionsList{
  401. Value: int32(pasturePb.DrugCategory_Antiparasitics),
  402. Label: "驱虫类",
  403. Disabled: true,
  404. }, &pasturePb.ConfigOptionsList{
  405. Value: int32(pasturePb.DrugCategory_Analgesics),
  406. Label: "镇痛类",
  407. Disabled: true,
  408. }, &pasturePb.ConfigOptionsList{
  409. Value: int32(pasturePb.DrugCategory_Antipyretic),
  410. Label: "退烧类",
  411. Disabled: true,
  412. }, &pasturePb.ConfigOptionsList{
  413. Value: int32(pasturePb.DrugCategory_Vitamin),
  414. Label: "维生素类",
  415. Disabled: true,
  416. }, &pasturePb.ConfigOptionsList{
  417. Value: int32(pasturePb.DrugCategory_Brine),
  418. Label: "盐水",
  419. Disabled: true,
  420. }, &pasturePb.ConfigOptionsList{
  421. Value: int32(pasturePb.DrugCategory_Glucose),
  422. Label: "葡萄糖",
  423. Disabled: true,
  424. }, &pasturePb.ConfigOptionsList{
  425. Value: int32(pasturePb.DrugCategory_Hormone),
  426. Label: "激素类",
  427. Disabled: true,
  428. }, &pasturePb.ConfigOptionsList{
  429. Value: int32(pasturePb.DrugCategory_Anti_Stress),
  430. Label: "抗应激类",
  431. Disabled: true,
  432. }, &pasturePb.ConfigOptionsList{
  433. Value: int32(pasturePb.DrugCategory_Disinfect),
  434. Label: "消毒类",
  435. Disabled: true,
  436. }, &pasturePb.ConfigOptionsList{
  437. Value: int32(pasturePb.DrugCategory_Chinese_Herbal),
  438. Label: "中药合剂",
  439. Disabled: true,
  440. }, &pasturePb.ConfigOptionsList{
  441. Value: int32(pasturePb.DrugCategory_Tocolytic),
  442. Label: "保胎类",
  443. Disabled: true,
  444. }, &pasturePb.ConfigOptionsList{
  445. Value: int32(pasturePb.DrugCategory_Immunity),
  446. Label: "疫苗类",
  447. Disabled: true,
  448. })
  449. return configOptions
  450. }
  451. func (s *StoreEntry) DrugUsageEnumList() []*pasturePb.ConfigOptionsList {
  452. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  453. configOptions = append(configOptions,
  454. &pasturePb.ConfigOptionsList{
  455. Value: int32(pasturePb.DrugUsage_Oral_Medications),
  456. Label: "口服",
  457. Disabled: true,
  458. }, &pasturePb.ConfigOptionsList{
  459. Value: int32(pasturePb.DrugUsage_Injectable_Medications),
  460. Label: "肌注",
  461. Disabled: true,
  462. }, &pasturePb.ConfigOptionsList{
  463. Value: int32(pasturePb.DrugUsage_Topical_Medications),
  464. Label: "外用",
  465. Disabled: true,
  466. }, &pasturePb.ConfigOptionsList{
  467. Value: int32(pasturePb.DrugUsage_Inhalation_Medications),
  468. Label: "吸入",
  469. Disabled: true,
  470. }, &pasturePb.ConfigOptionsList{
  471. Value: int32(pasturePb.DrugUsage_Drink_Medications),
  472. Label: "饮水",
  473. Disabled: true,
  474. })
  475. return configOptions
  476. }
  477. func (s *StoreEntry) UnitEnumList() []*pasturePb.ConfigOptionsList {
  478. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  479. configOptions = append(configOptions,
  480. &pasturePb.ConfigOptionsList{
  481. Value: int32(pasturePb.Unit_Pieces),
  482. Label: "个",
  483. Disabled: true,
  484. }, &pasturePb.ConfigOptionsList{
  485. Value: int32(pasturePb.Unit_Package),
  486. Label: "包/袋",
  487. Disabled: true,
  488. }, &pasturePb.ConfigOptionsList{
  489. Value: int32(pasturePb.Unit_Bottle),
  490. Label: "瓶",
  491. Disabled: true,
  492. }, &pasturePb.ConfigOptionsList{
  493. Value: int32(pasturePb.Unit_Box),
  494. Label: "盒",
  495. Disabled: true,
  496. }, &pasturePb.ConfigOptionsList{
  497. Value: int32(pasturePb.Unit_Boxful),
  498. Label: "箱",
  499. Disabled: true,
  500. }, &pasturePb.ConfigOptionsList{
  501. Value: int32(pasturePb.Unit_Branch),
  502. Label: "支",
  503. Disabled: true,
  504. }, &pasturePb.ConfigOptionsList{
  505. Value: int32(pasturePb.Unit_Barrel),
  506. Label: "桶",
  507. Disabled: true,
  508. }, &pasturePb.ConfigOptionsList{
  509. Value: int32(pasturePb.Unit_Pot),
  510. Label: "罐",
  511. Disabled: true,
  512. }, &pasturePb.ConfigOptionsList{
  513. Value: int32(pasturePb.Unit_ML),
  514. Label: "毫升",
  515. Disabled: true,
  516. }, &pasturePb.ConfigOptionsList{
  517. Value: int32(pasturePb.Unit_L),
  518. Label: "升",
  519. Disabled: true,
  520. })
  521. return configOptions
  522. }
  523. func (s *StoreEntry) ExposeEstrusTypeEnumList() []*pasturePb.ConfigOptionsList {
  524. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  525. configOptions = append(configOptions,
  526. &pasturePb.ConfigOptionsList{
  527. Value: int32(pasturePb.ExposeEstrusType_Neck_Ring),
  528. Label: "脖环揭发",
  529. Disabled: true,
  530. }, &pasturePb.ConfigOptionsList{
  531. Value: int32(pasturePb.ExposeEstrusType_Foot_Ring),
  532. Label: "脚环/计步器揭发",
  533. Disabled: true,
  534. }, &pasturePb.ConfigOptionsList{
  535. Value: int32(pasturePb.ExposeEstrusType_Manual_Observation),
  536. Label: "人工观察",
  537. Disabled: true,
  538. })
  539. return configOptions
  540. }
  541. func (s *StoreEntry) FrozenSemenTypeEnumList() []*pasturePb.ConfigOptionsList {
  542. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  543. configOptions = append(configOptions,
  544. &pasturePb.ConfigOptionsList{
  545. Value: int32(pasturePb.FrozenSemenType_Ordinary),
  546. Label: "常规冻精",
  547. Disabled: true,
  548. }, &pasturePb.ConfigOptionsList{
  549. Value: int32(pasturePb.FrozenSemenType_Gender_Control),
  550. Label: "性控冻精",
  551. Disabled: true,
  552. })
  553. return configOptions
  554. }
  555. func (s *StoreEntry) BullNumberEnumList() []*pasturePb.BullOptionsList {
  556. frozenSemenList := make([]*model.EventFrozenSemen, 0)
  557. bullNumberList := make([]*pasturePb.BullOptionsList, 0)
  558. if err := s.DB.Where("quantity > 0").Group("bull_id").Find(&frozenSemenList).Error; err != nil {
  559. zaplog.Error("BullNumberEnumList", zap.Any("Find", err))
  560. }
  561. for _, v := range frozenSemenList {
  562. bullNumberList = append(bullNumberList, &pasturePb.BullOptionsList{
  563. Value: v.BullId,
  564. Label: v.BullId,
  565. Disabled: true,
  566. })
  567. }
  568. return bullNumberList
  569. }
  570. func (s *StoreEntry) WeekEnumList() []*pasturePb.ConfigOptionsList {
  571. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  572. configOptions = append(configOptions,
  573. &pasturePb.ConfigOptionsList{
  574. Value: int32(pasturePb.Week_Monday),
  575. Label: "周一",
  576. Disabled: true,
  577. }, &pasturePb.ConfigOptionsList{
  578. Value: int32(pasturePb.Week_Tuesday),
  579. Label: "周二",
  580. Disabled: true,
  581. }, &pasturePb.ConfigOptionsList{
  582. Value: int32(pasturePb.Week_Wednesday),
  583. Label: "周三",
  584. Disabled: true,
  585. }, &pasturePb.ConfigOptionsList{
  586. Value: int32(pasturePb.Week_Thursday),
  587. Label: "周四",
  588. Disabled: true,
  589. }, &pasturePb.ConfigOptionsList{
  590. Value: int32(pasturePb.Week_Friday),
  591. Label: "周五",
  592. Disabled: true,
  593. }, &pasturePb.ConfigOptionsList{
  594. Value: int32(pasturePb.Week_Saturday),
  595. Label: "周六",
  596. Disabled: true,
  597. }, &pasturePb.ConfigOptionsList{
  598. Value: int32(pasturePb.Week_Sunday),
  599. Label: "周日",
  600. Disabled: true,
  601. })
  602. return configOptions
  603. }