config_data.go 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842
  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_Out),
  45. Label: "淘汰牛舍",
  46. Disabled: true,
  47. }, &pasturePb.ConfigOptionsList{
  48. Value: int32(pasturePb.PenType_Segregate),
  49. Label: "隔离牛舍",
  50. Disabled: true,
  51. })
  52. return barnTypeList
  53. }
  54. func (s *StoreEntry) BreedStatusEnumList() []*pasturePb.ConfigOptionsList {
  55. breedStatusList := make([]*pasturePb.ConfigOptionsList, 0)
  56. breedStatusList = append(breedStatusList, &pasturePb.ConfigOptionsList{
  57. Value: int32(pasturePb.BreedStatus_UnBreed),
  58. Label: "未配",
  59. Disabled: true,
  60. }, &pasturePb.ConfigOptionsList{
  61. Value: int32(pasturePb.BreedStatus_Breeding),
  62. Label: "已配未检",
  63. Disabled: true,
  64. }, &pasturePb.ConfigOptionsList{
  65. Value: int32(pasturePb.BreedStatus_Pregnant),
  66. Label: "怀孕",
  67. Disabled: true,
  68. }, &pasturePb.ConfigOptionsList{
  69. Value: int32(pasturePb.BreedStatus_Empty),
  70. Label: "空怀",
  71. Disabled: true,
  72. }, &pasturePb.ConfigOptionsList{
  73. Value: int32(pasturePb.BreedStatus_Calving),
  74. Label: "产犊",
  75. Disabled: true,
  76. }, &pasturePb.ConfigOptionsList{
  77. Value: int32(pasturePb.BreedStatus_Abort),
  78. Label: "流产",
  79. Disabled: true,
  80. }, &pasturePb.ConfigOptionsList{
  81. Value: int32(pasturePb.BreedStatus_No_Mating),
  82. Label: "禁配",
  83. Disabled: true,
  84. })
  85. return breedStatusList
  86. }
  87. func (s *StoreEntry) CowKindEnumList() []*pasturePb.ConfigOptionsList {
  88. cowKindList := make([]*pasturePb.ConfigOptionsList, 0)
  89. cowKindList = append(cowKindList, &pasturePb.ConfigOptionsList{
  90. Value: int32(pasturePb.CowKind_XMTEN),
  91. Label: "西门塔尔牛",
  92. Disabled: true,
  93. }, &pasturePb.ConfigOptionsList{
  94. Value: int32(pasturePb.CowKind_AGSN),
  95. Label: "安格斯牛",
  96. Disabled: true,
  97. }, &pasturePb.ConfigOptionsList{
  98. Value: int32(pasturePb.CowKind_XNLN),
  99. Label: "夏洛莱牛",
  100. Disabled: true,
  101. }, &pasturePb.ConfigOptionsList{
  102. Value: int32(pasturePb.CowKind_LMZN),
  103. Label: "利木赞牛",
  104. Disabled: true,
  105. }, &pasturePb.ConfigOptionsList{
  106. Value: int32(pasturePb.CowKind_HFTN),
  107. Label: "海福特牛",
  108. Disabled: true,
  109. }, &pasturePb.ConfigOptionsList{
  110. Value: int32(pasturePb.CowKind_HN),
  111. Label: "和牛",
  112. Disabled: true,
  113. })
  114. return cowKindList
  115. }
  116. func (s *StoreEntry) CowSourceEnumList() []*pasturePb.ConfigOptionsList {
  117. cowSourceList := make([]*pasturePb.ConfigOptionsList, 0)
  118. cowSourceList = append(cowSourceList, &pasturePb.ConfigOptionsList{
  119. Value: int32(pasturePb.CowSource_Calving),
  120. Label: "产犊",
  121. Disabled: true,
  122. }, &pasturePb.ConfigOptionsList{
  123. Value: int32(pasturePb.CowSource_Transfer_In),
  124. Label: "调入",
  125. Disabled: true,
  126. }, &pasturePb.ConfigOptionsList{
  127. Value: int32(pasturePb.CowSource_Buy),
  128. Label: "购买",
  129. Disabled: true,
  130. })
  131. return cowSourceList
  132. }
  133. func (s *StoreEntry) CowTypeEnumList(optionName string) []*pasturePb.ConfigOptionsList {
  134. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  135. if optionName == "breed" {
  136. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  137. Value: int32(pasturePb.CowType_Reserve_Calf),
  138. Label: "后备牛",
  139. Disabled: true,
  140. }, &pasturePb.ConfigOptionsList{
  141. Value: int32(pasturePb.CowType_Breeding_Calf),
  142. Label: "经产牛",
  143. Disabled: true,
  144. })
  145. return cowTypeList
  146. }
  147. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  148. Value: int32(pasturePb.CowType_Lactating_Calf),
  149. Label: "哺乳犊牛",
  150. Disabled: true,
  151. }, &pasturePb.ConfigOptionsList{
  152. Value: int32(pasturePb.CowType_Weaned_Calf),
  153. Label: "育成牛",
  154. Disabled: true,
  155. }, &pasturePb.ConfigOptionsList{
  156. Value: int32(pasturePb.CowType_Youth_Calf),
  157. Label: "青年牛",
  158. Disabled: true,
  159. }, &pasturePb.ConfigOptionsList{
  160. Value: int32(pasturePb.CowType_Fattening_Calf),
  161. Label: "育肥牛",
  162. Disabled: true,
  163. }, &pasturePb.ConfigOptionsList{
  164. Value: int32(pasturePb.CowType_Reserve_Calf),
  165. Label: "后备牛",
  166. Disabled: true,
  167. }, &pasturePb.ConfigOptionsList{
  168. Value: int32(pasturePb.CowType_Breeding_Calf),
  169. Label: "种母牛",
  170. Disabled: true,
  171. }, &pasturePb.ConfigOptionsList{
  172. Value: int32(pasturePb.CowType_Breeding_Bull),
  173. Label: "种公牛",
  174. Disabled: true,
  175. })
  176. return cowTypeList
  177. }
  178. func (s *StoreEntry) SameTimeCowTypeEnumList() []*pasturePb.ConfigOptionsList {
  179. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  180. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  181. Value: int32(pasturePb.SameTimeCowType_Empty),
  182. Label: "空怀牛",
  183. Disabled: true,
  184. }, &pasturePb.ConfigOptionsList{
  185. Value: int32(pasturePb.SameTimeCowType_Breeding_Calf),
  186. Label: "种母牛",
  187. Disabled: true,
  188. })
  189. return cowTypeList
  190. }
  191. func (s *StoreEntry) SameTimeTypeEnumList() []*pasturePb.ConfigOptionsList {
  192. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  193. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  194. Value: int32(pasturePb.SameTimeType_PGBJ),
  195. Label: "PG保健",
  196. Disabled: true,
  197. }, &pasturePb.ConfigOptionsList{
  198. Value: int32(pasturePb.SameTimeType_PGTQ),
  199. Label: "PG同期",
  200. Disabled: true,
  201. }, &pasturePb.ConfigOptionsList{
  202. Value: int32(pasturePb.SameTimeType_RnGH),
  203. Label: "RnGH",
  204. Disabled: true,
  205. }, &pasturePb.ConfigOptionsList{
  206. Value: int32(pasturePb.SameTimeType_TAI),
  207. Label: "TAI输精",
  208. Disabled: true,
  209. })
  210. return cowTypeList
  211. }
  212. func (s *StoreEntry) ImmunizationCowTypeEnumList() []*pasturePb.ConfigOptionsList {
  213. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  214. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  215. Value: int32(pasturePb.CowType_Lactating_Calf),
  216. Label: "犊牛",
  217. Disabled: true,
  218. }, &pasturePb.ConfigOptionsList{
  219. Value: int32(pasturePb.CowType_Weaned_Calf),
  220. Label: "育成牛",
  221. Disabled: true,
  222. }, &pasturePb.ConfigOptionsList{
  223. Value: int32(pasturePb.CowType_Youth_Calf),
  224. Label: "青年牛",
  225. Disabled: true,
  226. }, &pasturePb.ConfigOptionsList{
  227. Value: int32(pasturePb.CowType_Fattening_Calf),
  228. Label: "育肥牛",
  229. Disabled: true,
  230. }, &pasturePb.ConfigOptionsList{
  231. Value: int32(pasturePb.CowType_Reserve_Calf),
  232. Label: "后备牛",
  233. Disabled: true,
  234. }, &pasturePb.ConfigOptionsList{
  235. Value: int32(pasturePb.CowType_Reserve_Calf),
  236. Label: "种母牛",
  237. Disabled: true,
  238. }, &pasturePb.ConfigOptionsList{
  239. Value: int32(pasturePb.CowType_Breeding_Bull),
  240. Label: "种公牛",
  241. Disabled: true,
  242. })
  243. return cowTypeList
  244. }
  245. func (s *StoreEntry) ImmunizationConditionsEnumList() []*pasturePb.ConfigOptionsList {
  246. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  247. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  248. Value: int32(pasturePb.ImmunizationConditions_Days_Age),
  249. Label: "日龄",
  250. Disabled: true,
  251. }, &pasturePb.ConfigOptionsList{
  252. Value: int32(pasturePb.ImmunizationConditions_Days_After_Delivery),
  253. Label: "产后天数",
  254. Disabled: true,
  255. }, &pasturePb.ConfigOptionsList{
  256. Value: int32(pasturePb.ImmunizationConditions_Days_Of_Pregnancy),
  257. Label: "怀孕天数",
  258. Disabled: true,
  259. }, &pasturePb.ConfigOptionsList{
  260. Value: int32(pasturePb.ImmunizationConditions_Admission_Days),
  261. Label: "入场天数",
  262. Disabled: true,
  263. }, &pasturePb.ConfigOptionsList{
  264. Value: int32(pasturePb.ImmunizationConditions_Other_Vaccine_After),
  265. Label: "基于其他疫苗之后",
  266. Disabled: true,
  267. })
  268. return cowTypeList
  269. }
  270. func (s *StoreEntry) TransferPenEnumList() []*pasturePb.ConfigOptionsList {
  271. transferPenList := make([]*pasturePb.ConfigOptionsList, 0)
  272. transferPenList = append(transferPenList, &pasturePb.ConfigOptionsList{
  273. Value: int32(pasturePb.TransferPenReason_Normal),
  274. Label: "正常转群",
  275. Disabled: true,
  276. }, &pasturePb.ConfigOptionsList{
  277. Value: int32(pasturePb.TransferPenReason_Feed),
  278. Label: "饲喂转群",
  279. Disabled: true,
  280. }, &pasturePb.ConfigOptionsList{
  281. Value: int32(pasturePb.TransferPenReason_Dry_Milk),
  282. Label: "干奶转群",
  283. Disabled: true,
  284. }, &pasturePb.ConfigOptionsList{
  285. Value: int32(pasturePb.TransferPenReason_Pregnant),
  286. Label: "怀孕转群",
  287. Disabled: true,
  288. }, &pasturePb.ConfigOptionsList{
  289. Value: int32(pasturePb.TransferPenReason_Overantibody),
  290. Label: "过抗转群",
  291. Disabled: true,
  292. })
  293. return transferPenList
  294. }
  295. func (s *StoreEntry) ChildNumberEnumList() []*pasturePb.ConfigOptionsList {
  296. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  297. configOptions = append(configOptions,
  298. &pasturePb.ConfigOptionsList{
  299. Value: int32(pasturePb.ChildNumber_One),
  300. Label: "单胎",
  301. Disabled: true,
  302. }, &pasturePb.ConfigOptionsList{
  303. Value: int32(pasturePb.ChildNumber_Two),
  304. Label: "双胎",
  305. Disabled: true,
  306. }, &pasturePb.ConfigOptionsList{
  307. Value: int32(pasturePb.ChildNumber_Three),
  308. Label: "三胎",
  309. Disabled: true,
  310. }, &pasturePb.ConfigOptionsList{
  311. Value: int32(pasturePb.ChildNumber_Four),
  312. Label: "四胎",
  313. Disabled: true,
  314. })
  315. return configOptions
  316. }
  317. func (s *StoreEntry) CalvingLevelEnumList() []*pasturePb.ConfigOptionsList {
  318. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  319. configOptions = append(configOptions,
  320. &pasturePb.ConfigOptionsList{
  321. Value: int32(pasturePb.CalvingLevel_Natural_Childbirth),
  322. Label: "自然分娩",
  323. Disabled: true,
  324. }, &pasturePb.ConfigOptionsList{
  325. Value: int32(pasturePb.CalvingLevel_Artificial_Midwifery1),
  326. Label: "人工助产(1-2人)",
  327. Disabled: true,
  328. }, &pasturePb.ConfigOptionsList{
  329. Value: int32(pasturePb.CalvingLevel_Artificial_Midwifery2),
  330. Label: "人工助产(3人以上)",
  331. Disabled: true,
  332. }, &pasturePb.ConfigOptionsList{
  333. Value: int32(pasturePb.CalvingLevel_Caesarean_Section),
  334. Label: "剖腹产",
  335. Disabled: true,
  336. })
  337. return configOptions
  338. }
  339. func (s *StoreEntry) DystociaReasonEnumList() []*pasturePb.ConfigOptionsList {
  340. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  341. configOptions = append(configOptions,
  342. &pasturePb.ConfigOptionsList{
  343. Value: int32(pasturePb.DystociaReason_Malposition),
  344. Label: "胎位不正",
  345. Disabled: true,
  346. }, &pasturePb.ConfigOptionsList{
  347. Value: int32(pasturePb.DystociaReason_Fetal_Overgrowth),
  348. Label: "胎儿过大",
  349. Disabled: true,
  350. }, &pasturePb.ConfigOptionsList{
  351. Value: int32(pasturePb.DystociaReason_Uterine_Atony),
  352. Label: "子宫收缩无力",
  353. Disabled: true,
  354. }, &pasturePb.ConfigOptionsList{
  355. Value: int32(pasturePb.DystociaReason_Pelvic_Stenosis),
  356. Label: "盆骨狭小",
  357. Disabled: true,
  358. }, &pasturePb.ConfigOptionsList{
  359. Value: int32(pasturePb.DystociaReason_Sub_Health),
  360. Label: "母牛亚健康状态",
  361. Disabled: true,
  362. })
  363. return configOptions
  364. }
  365. func (s *StoreEntry) PregnantCheckResultEnumList() []*pasturePb.ConfigOptionsList {
  366. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  367. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  368. Value: int32(pasturePb.PregnantCheckResult_Pregnant),
  369. Label: "有胎",
  370. Disabled: true,
  371. }, &pasturePb.ConfigOptionsList{
  372. Value: int32(pasturePb.PregnantCheckResult_UnPregnant),
  373. Label: "无胎",
  374. Disabled: true,
  375. })
  376. return configOptions
  377. }
  378. func (s *StoreEntry) PregnantCheckMethodEnumList() []*pasturePb.ConfigOptionsList {
  379. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  380. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  381. Value: int32(pasturePb.PregnantCheckMethod_B_Ultrasound),
  382. Label: "B超",
  383. Disabled: true,
  384. }, &pasturePb.ConfigOptionsList{
  385. Value: int32(pasturePb.PregnantCheckMethod_Blood_Testing),
  386. Label: "血检",
  387. Disabled: true,
  388. }, &pasturePb.ConfigOptionsList{
  389. Value: int32(pasturePb.PregnantCheckMethod_Manual_Inspection),
  390. Label: "人工检查",
  391. Disabled: true,
  392. })
  393. return configOptions
  394. }
  395. func (s *StoreEntry) DrugCategoryEnumList() []*pasturePb.ConfigOptionsList {
  396. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  397. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  398. Value: int32(pasturePb.DrugCategory_Antibiotics),
  399. Label: "抗生素类",
  400. Disabled: true,
  401. }, &pasturePb.ConfigOptionsList{
  402. Value: int32(pasturePb.DrugCategory_Antivirals),
  403. Label: "抗病毒类",
  404. Disabled: true,
  405. }, &pasturePb.ConfigOptionsList{
  406. Value: int32(pasturePb.DrugCategory_Antifungals),
  407. Label: "抗真菌类",
  408. Disabled: true,
  409. }, &pasturePb.ConfigOptionsList{
  410. Value: int32(pasturePb.DrugCategory_Antiparasitics),
  411. Label: "驱虫类",
  412. Disabled: true,
  413. }, &pasturePb.ConfigOptionsList{
  414. Value: int32(pasturePb.DrugCategory_Analgesics),
  415. Label: "镇痛类",
  416. Disabled: true,
  417. }, &pasturePb.ConfigOptionsList{
  418. Value: int32(pasturePb.DrugCategory_Antipyretic),
  419. Label: "退烧类",
  420. Disabled: true,
  421. }, &pasturePb.ConfigOptionsList{
  422. Value: int32(pasturePb.DrugCategory_Vitamin),
  423. Label: "维生素类",
  424. Disabled: true,
  425. }, &pasturePb.ConfigOptionsList{
  426. Value: int32(pasturePb.DrugCategory_Brine),
  427. Label: "盐水",
  428. Disabled: true,
  429. }, &pasturePb.ConfigOptionsList{
  430. Value: int32(pasturePb.DrugCategory_Glucose),
  431. Label: "葡萄糖",
  432. Disabled: true,
  433. }, &pasturePb.ConfigOptionsList{
  434. Value: int32(pasturePb.DrugCategory_Hormone),
  435. Label: "激素类",
  436. Disabled: true,
  437. }, &pasturePb.ConfigOptionsList{
  438. Value: int32(pasturePb.DrugCategory_Anti_Stress),
  439. Label: "抗应激类",
  440. Disabled: true,
  441. }, &pasturePb.ConfigOptionsList{
  442. Value: int32(pasturePb.DrugCategory_Disinfect),
  443. Label: "消毒类",
  444. Disabled: true,
  445. }, &pasturePb.ConfigOptionsList{
  446. Value: int32(pasturePb.DrugCategory_Chinese_Herbal),
  447. Label: "中药合剂",
  448. Disabled: true,
  449. }, &pasturePb.ConfigOptionsList{
  450. Value: int32(pasturePb.DrugCategory_Tocolytic),
  451. Label: "保胎类",
  452. Disabled: true,
  453. }, &pasturePb.ConfigOptionsList{
  454. Value: int32(pasturePb.DrugCategory_Immunity),
  455. Label: "疫苗类",
  456. Disabled: true,
  457. })
  458. return configOptions
  459. }
  460. func (s *StoreEntry) DrugUsageEnumList() []*pasturePb.ConfigOptionsList {
  461. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  462. configOptions = append(configOptions,
  463. &pasturePb.ConfigOptionsList{
  464. Value: int32(pasturePb.DrugUsage_Oral_Medications),
  465. Label: "口服",
  466. Disabled: true,
  467. }, &pasturePb.ConfigOptionsList{
  468. Value: int32(pasturePb.DrugUsage_Injectable_Medications),
  469. Label: "肌注",
  470. Disabled: true,
  471. }, &pasturePb.ConfigOptionsList{
  472. Value: int32(pasturePb.DrugUsage_Topical_Medications),
  473. Label: "外用",
  474. Disabled: true,
  475. }, &pasturePb.ConfigOptionsList{
  476. Value: int32(pasturePb.DrugUsage_Inhalation_Medications),
  477. Label: "吸入",
  478. Disabled: true,
  479. }, &pasturePb.ConfigOptionsList{
  480. Value: int32(pasturePb.DrugUsage_Drink_Medications),
  481. Label: "饮水",
  482. Disabled: true,
  483. })
  484. return configOptions
  485. }
  486. func (s *StoreEntry) UnitEnumList() []*pasturePb.ConfigOptionsList {
  487. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  488. configOptions = append(configOptions,
  489. &pasturePb.ConfigOptionsList{
  490. Value: int32(pasturePb.Unit_Pieces),
  491. Label: "个",
  492. Disabled: true,
  493. }, &pasturePb.ConfigOptionsList{
  494. Value: int32(pasturePb.Unit_Package),
  495. Label: "包/袋",
  496. Disabled: true,
  497. }, &pasturePb.ConfigOptionsList{
  498. Value: int32(pasturePb.Unit_Bottle),
  499. Label: "瓶",
  500. Disabled: true,
  501. }, &pasturePb.ConfigOptionsList{
  502. Value: int32(pasturePb.Unit_Box),
  503. Label: "盒",
  504. Disabled: true,
  505. }, &pasturePb.ConfigOptionsList{
  506. Value: int32(pasturePb.Unit_Boxful),
  507. Label: "箱",
  508. Disabled: true,
  509. }, &pasturePb.ConfigOptionsList{
  510. Value: int32(pasturePb.Unit_Branch),
  511. Label: "支",
  512. Disabled: true,
  513. }, &pasturePb.ConfigOptionsList{
  514. Value: int32(pasturePb.Unit_Barrel),
  515. Label: "桶",
  516. Disabled: true,
  517. }, &pasturePb.ConfigOptionsList{
  518. Value: int32(pasturePb.Unit_Pot),
  519. Label: "罐",
  520. Disabled: true,
  521. }, &pasturePb.ConfigOptionsList{
  522. Value: int32(pasturePb.Unit_ML),
  523. Label: "毫升",
  524. Disabled: true,
  525. }, &pasturePb.ConfigOptionsList{
  526. Value: int32(pasturePb.Unit_L),
  527. Label: "升",
  528. Disabled: true,
  529. })
  530. return configOptions
  531. }
  532. func (s *StoreEntry) ExposeEstrusTypeEnumList() []*pasturePb.ConfigOptionsList {
  533. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  534. configOptions = append(configOptions,
  535. &pasturePb.ConfigOptionsList{
  536. Value: int32(pasturePb.ExposeEstrusType_Neck_Ring),
  537. Label: "脖环揭发",
  538. Disabled: true,
  539. }, &pasturePb.ConfigOptionsList{
  540. Value: int32(pasturePb.ExposeEstrusType_Foot_Ring),
  541. Label: "脚环揭发",
  542. Disabled: true,
  543. }, &pasturePb.ConfigOptionsList{
  544. Value: int32(pasturePb.ExposeEstrusType_Natural_Estrus),
  545. Label: "自然发情",
  546. Disabled: true,
  547. })
  548. return configOptions
  549. }
  550. func (s *StoreEntry) FrozenSemenTypeEnumList() []*pasturePb.ConfigOptionsList {
  551. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  552. configOptions = append(configOptions,
  553. &pasturePb.ConfigOptionsList{
  554. Value: int32(pasturePb.FrozenSemenType_Ordinary),
  555. Label: "常规冻精",
  556. Disabled: true,
  557. }, &pasturePb.ConfigOptionsList{
  558. Value: int32(pasturePb.FrozenSemenType_Gender_Control),
  559. Label: "性控冻精",
  560. Disabled: true,
  561. })
  562. return configOptions
  563. }
  564. func (s *StoreEntry) BullNumberEnumList() []*pasturePb.BullOptionsList {
  565. frozenSemenList := make([]*model.FrozenSemen, 0)
  566. bullNumberList := make([]*pasturePb.BullOptionsList, 0)
  567. if err := s.DB.Where("quantity > 0").Group("bull_id").Find(&frozenSemenList).Error; err != nil {
  568. zaplog.Error("BullNumberEnumList", zap.Any("Find", err))
  569. }
  570. for _, v := range frozenSemenList {
  571. bullNumberList = append(bullNumberList, &pasturePb.BullOptionsList{
  572. Value: v.BullId,
  573. Label: v.BullId,
  574. Disabled: true,
  575. })
  576. }
  577. return bullNumberList
  578. }
  579. func (s *StoreEntry) WeekEnumList() []*pasturePb.ConfigOptionsList {
  580. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  581. configOptions = append(configOptions,
  582. &pasturePb.ConfigOptionsList{
  583. Value: int32(pasturePb.Week_Monday),
  584. Label: "周一",
  585. Disabled: true,
  586. }, &pasturePb.ConfigOptionsList{
  587. Value: int32(pasturePb.Week_Tuesday),
  588. Label: "周二",
  589. Disabled: true,
  590. }, &pasturePb.ConfigOptionsList{
  591. Value: int32(pasturePb.Week_Wednesday),
  592. Label: "周三",
  593. Disabled: true,
  594. }, &pasturePb.ConfigOptionsList{
  595. Value: int32(pasturePb.Week_Thursday),
  596. Label: "周四",
  597. Disabled: true,
  598. }, &pasturePb.ConfigOptionsList{
  599. Value: int32(pasturePb.Week_Friday),
  600. Label: "周五",
  601. Disabled: true,
  602. }, &pasturePb.ConfigOptionsList{
  603. Value: int32(pasturePb.Week_Saturday),
  604. Label: "周六",
  605. Disabled: true,
  606. }, &pasturePb.ConfigOptionsList{
  607. Value: int32(pasturePb.Week_Sunday),
  608. Label: "周日",
  609. Disabled: true,
  610. })
  611. return configOptions
  612. }
  613. func (s *StoreEntry) MonthEnumList() []*pasturePb.ConfigOptionsList {
  614. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  615. for v := 1; v <= 31; v++ {
  616. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  617. Value: int32(v),
  618. Label: fmt.Sprintf("%d号", v),
  619. Disabled: true,
  620. })
  621. }
  622. return configOptions
  623. }
  624. func (s *StoreEntry) WorkOrderFrequencyEnumList() []*pasturePb.ConfigOptionsList {
  625. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  626. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  627. Value: int32(pasturePb.WorkOrderFrequency_None),
  628. Label: "一次性",
  629. Disabled: true,
  630. }, &pasturePb.ConfigOptionsList{
  631. Value: int32(pasturePb.WorkOrderFrequency_Daily),
  632. Label: "每天",
  633. Disabled: true,
  634. }, &pasturePb.ConfigOptionsList{
  635. Value: int32(pasturePb.WorkOrderFrequency_Weekly),
  636. Label: "每周",
  637. Disabled: true,
  638. }, &pasturePb.ConfigOptionsList{
  639. Value: int32(pasturePb.WorkOrderFrequency_Monthly),
  640. Label: "每月",
  641. Disabled: true,
  642. })
  643. return configOptions
  644. }
  645. func (s *StoreEntry) WorkOrderSubUnitEnumList() []*pasturePb.ConfigOptionsList {
  646. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  647. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  648. Value: int32(pasturePb.WorkOrderSubscribeUnit_Person),
  649. Label: "个人",
  650. Disabled: true,
  651. }, &pasturePb.ConfigOptionsList{
  652. Value: int32(pasturePb.WorkOrderSubscribeUnit_dept),
  653. Label: "部门",
  654. Disabled: true,
  655. })
  656. return configOptions
  657. }
  658. func (s *StoreEntry) WorkOrderPriorityEnumList() []*pasturePb.ConfigOptionsList {
  659. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  660. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  661. Value: int32(pasturePb.Priority_Low),
  662. Label: "低",
  663. Disabled: true,
  664. }, &pasturePb.ConfigOptionsList{
  665. Value: int32(pasturePb.Priority_Middle),
  666. Label: "一般",
  667. Disabled: true,
  668. }, &pasturePb.ConfigOptionsList{
  669. Value: int32(pasturePb.Priority_High),
  670. Label: "紧急",
  671. Disabled: true,
  672. })
  673. return configOptions
  674. }
  675. func (s *StoreEntry) WorkOrderCategoryEnumList() []*pasturePb.ConfigOptionsList {
  676. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  677. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  678. Value: int32(pasturePb.WorkOrderCategory_Health),
  679. Label: "保健",
  680. Disabled: true,
  681. }, &pasturePb.ConfigOptionsList{
  682. Value: int32(pasturePb.WorkOrderCategory_Breed),
  683. Label: "繁殖",
  684. Disabled: true,
  685. }, &pasturePb.ConfigOptionsList{
  686. Value: int32(pasturePb.WorkOrderCategory_Nutrition),
  687. Label: "营养",
  688. Disabled: true,
  689. }, &pasturePb.ConfigOptionsList{
  690. Value: int32(pasturePb.WorkOrderCategory_Ordinary),
  691. Label: "日常",
  692. Disabled: true,
  693. }, &pasturePb.ConfigOptionsList{
  694. Value: int32(pasturePb.WorkOrderCategory_Other),
  695. Label: "其他",
  696. Disabled: true,
  697. })
  698. return configOptions
  699. }
  700. func CalendarTypeEnumList() []*pasturePb.ConfigOptionsList {
  701. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  702. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  703. Value: int32(pasturePb.CalendarType_Immunisation),
  704. Label: "免疫",
  705. Disabled: true,
  706. }, &pasturePb.ConfigOptionsList{
  707. Value: int32(pasturePb.CalendarType_PG),
  708. Label: "同期PG",
  709. Disabled: true,
  710. }, &pasturePb.ConfigOptionsList{
  711. Value: int32(pasturePb.CalendarType_RnGH),
  712. Label: "同期RnGH",
  713. Disabled: true,
  714. }, &pasturePb.ConfigOptionsList{
  715. Value: int32(pasturePb.CalendarType_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. }, &pasturePb.ConfigOptionsList{
  731. Value: int32(pasturePb.CalendarType_Mating),
  732. Label: "配种",
  733. Disabled: true,
  734. })
  735. return configOptions
  736. }
  737. func (s *StoreEntry) AbortionReasonsEnumList() []*pasturePb.ConfigOptionsList {
  738. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  739. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  740. Value: int32(pasturePb.AbortionReasons_Mechanical_Abortion),
  741. Label: "机械性流产",
  742. Disabled: true,
  743. }, &pasturePb.ConfigOptionsList{
  744. Value: int32(pasturePb.AbortionReasons_Malnutrition_Abortion),
  745. Label: "营养不良性流产",
  746. Disabled: true,
  747. }, &pasturePb.ConfigOptionsList{
  748. Value: int32(pasturePb.AbortionReasons_Mycotoxin_Abortion),
  749. Label: "霉菌毒素流产",
  750. Disabled: true,
  751. }, &pasturePb.ConfigOptionsList{
  752. Value: int32(pasturePb.AbortionReasons_Habitual_Abortion),
  753. Label: "习惯性流产",
  754. Disabled: true,
  755. }, &pasturePb.ConfigOptionsList{
  756. Value: int32(pasturePb.AbortionReasons_Brucellosis_Abortion),
  757. Label: "布病流产",
  758. Disabled: true,
  759. }, &pasturePb.ConfigOptionsList{
  760. Value: int32(pasturePb.AbortionReasons_Inflammatory_Abortion),
  761. Label: "产道炎症性流产",
  762. Disabled: true,
  763. }, &pasturePb.ConfigOptionsList{
  764. Value: int32(pasturePb.AbortionReasons_Heat_Stress_Abortion),
  765. Label: "热应激流产",
  766. Disabled: true,
  767. }, &pasturePb.ConfigOptionsList{
  768. Value: int32(pasturePb.AbortionReasons_Infectious_Abortion),
  769. Label: "传染病性流产",
  770. Disabled: true,
  771. }, &pasturePb.ConfigOptionsList{
  772. Value: int32(pasturePb.AbortionReasons_Other),
  773. Label: "其他",
  774. Disabled: true,
  775. })
  776. return configOptions
  777. }
  778. func (s *StoreEntry) HealthStatusEnumList() []*pasturePb.ConfigOptionsList {
  779. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  780. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  781. Value: int32(pasturePb.HealthStatus_Health),
  782. Label: "健康",
  783. Disabled: true,
  784. }, &pasturePb.ConfigOptionsList{
  785. Value: int32(pasturePb.HealthStatus_Disease),
  786. Label: "发病",
  787. Disabled: true,
  788. }, &pasturePb.ConfigOptionsList{
  789. Value: int32(pasturePb.HealthStatus_Treatment),
  790. Label: "治疗",
  791. Disabled: true,
  792. }, &pasturePb.ConfigOptionsList{
  793. Value: int32(pasturePb.HealthStatus_Curable),
  794. Label: "治愈",
  795. Disabled: true,
  796. }, &pasturePb.ConfigOptionsList{
  797. Value: int32(pasturePb.HealthStatus_Out),
  798. Label: "淘汰",
  799. Disabled: true,
  800. }, &pasturePb.ConfigOptionsList{
  801. Value: int32(pasturePb.HealthStatus_Dead),
  802. Label: "死亡",
  803. Disabled: true,
  804. })
  805. return configOptions
  806. }