config_data.go 24 KB

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