config_data.go 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  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_Unmarried),
  54. Label: "未配",
  55. Disabled: true,
  56. }, &pasturePb.ConfigOptionsList{
  57. Value: int32(pasturePb.BreedStatus_InCheck_Unpregnant),
  58. Label: "初检无胎",
  59. Disabled: true,
  60. }, &pasturePb.ConfigOptionsList{
  61. Value: int32(pasturePb.BreedStatus_InCheck_Pregnant),
  62. Label: "初检有胎",
  63. Disabled: true,
  64. }, &pasturePb.ConfigOptionsList{
  65. Value: int32(pasturePb.BreedStatus_Recheck_Unpregnant),
  66. Label: "复检无胎",
  67. Disabled: true,
  68. }, &pasturePb.ConfigOptionsList{
  69. Value: int32(pasturePb.BreedStatus_Recheck_Pregnant),
  70. Label: "复检有胎",
  71. Disabled: true,
  72. }, &pasturePb.ConfigOptionsList{
  73. Value: int32(pasturePb.BreedStatus_Pause_Pregnant),
  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) CowStatusEnumList() []*pasturePb.ConfigOptionsList {
  130. cowStatusList := make([]*pasturePb.ConfigOptionsList, 0)
  131. cowStatusList = append(cowStatusList, &pasturePb.ConfigOptionsList{
  132. Value: int32(pasturePb.CowStatus_Calving),
  133. Label: "产犊",
  134. Disabled: true,
  135. }, &pasturePb.ConfigOptionsList{
  136. Value: int32(pasturePb.CowStatus_Empty),
  137. Label: "空怀",
  138. Disabled: true,
  139. }, &pasturePb.ConfigOptionsList{
  140. Value: int32(pasturePb.CowStatus_Breeding),
  141. Label: "配种",
  142. Disabled: true,
  143. }, &pasturePb.ConfigOptionsList{
  144. Value: int32(pasturePb.CowStatus_Pregnant),
  145. Label: "怀孕",
  146. Disabled: true,
  147. }, &pasturePb.ConfigOptionsList{
  148. Value: int32(pasturePb.CowStatus_Dry_Milk),
  149. Label: "干奶",
  150. Disabled: true,
  151. }, &pasturePb.ConfigOptionsList{
  152. Value: int32(pasturePb.CowStatus_Peripartum),
  153. Label: "围产",
  154. Disabled: true,
  155. }, &pasturePb.ConfigOptionsList{
  156. Value: int32(pasturePb.CowStatus_No_Pregnant),
  157. Label: "禁配",
  158. Disabled: true,
  159. })
  160. return cowStatusList
  161. }
  162. func (s *StoreEntry) CowTypeEnumList() []*pasturePb.ConfigOptionsList {
  163. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  164. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  165. Value: int32(pasturePb.CowType_Lactating_Calf),
  166. Label: "哺乳犊牛",
  167. Disabled: true,
  168. }, &pasturePb.ConfigOptionsList{
  169. Value: int32(pasturePb.CowType_Weaned_Calf),
  170. Label: "断奶犊牛",
  171. Disabled: true,
  172. }, &pasturePb.ConfigOptionsList{
  173. Value: int32(pasturePb.CowType_Youth_Calf),
  174. Label: "青年牛",
  175. Disabled: true,
  176. }, &pasturePb.ConfigOptionsList{
  177. Value: int32(pasturePb.CowType_Fattening_Calf),
  178. Label: "育肥牛",
  179. Disabled: true,
  180. }, &pasturePb.ConfigOptionsList{
  181. Value: int32(pasturePb.CowType_Reserve_Calf),
  182. Label: "后备牛",
  183. Disabled: true,
  184. }, &pasturePb.ConfigOptionsList{
  185. Value: int32(pasturePb.CowType_Breeding_Calf),
  186. Label: "种母牛",
  187. Disabled: true,
  188. }, &pasturePb.ConfigOptionsList{
  189. Value: int32(pasturePb.CowType_Breeding_Bull),
  190. Label: "种公牛",
  191. Disabled: true,
  192. })
  193. return cowTypeList
  194. }
  195. func (s *StoreEntry) SemeTimeCowTypeEnumList() []*pasturePb.ConfigOptionsList {
  196. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  197. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  198. Value: int32(pasturePb.CowType_Reserve_Calf),
  199. Label: "后备牛",
  200. Disabled: true,
  201. }, &pasturePb.ConfigOptionsList{
  202. Value: int32(pasturePb.CowType_Breeding_Calf),
  203. Label: "种母牛",
  204. Disabled: true,
  205. })
  206. return cowTypeList
  207. }
  208. func (s *StoreEntry) ImmunizationCowTypeEnumList() []*pasturePb.ConfigOptionsList {
  209. cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
  210. cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
  211. Value: int32(pasturePb.ImmunizationCowType_Reserve_Cattle),
  212. Label: "后备牛",
  213. Disabled: true,
  214. }, &pasturePb.ConfigOptionsList{
  215. Value: int32(pasturePb.ImmunizationCowType_Adult_Cow),
  216. Label: "种母牛",
  217. Disabled: true,
  218. }, &pasturePb.ConfigOptionsList{
  219. Value: int32(pasturePb.ImmunizationCowType_Adult_bulls),
  220. Label: "种公牛",
  221. Disabled: true,
  222. }, &pasturePb.ConfigOptionsList{
  223. Value: int32(pasturePb.ImmunizationCowType_Calf),
  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_Month),
  245. Label: "每年月份",
  246. Disabled: true,
  247. }, &pasturePb.ConfigOptionsList{
  248. Value: int32(pasturePb.ImmunizationConditions_Admission_Days),
  249. Label: "入场天数",
  250. Disabled: true,
  251. })
  252. return cowTypeList
  253. }
  254. func (s *StoreEntry) TransferPenEnumList() []*pasturePb.ConfigOptionsList {
  255. transferPenList := make([]*pasturePb.ConfigOptionsList, 0)
  256. transferPenList = append(transferPenList, &pasturePb.ConfigOptionsList{
  257. Value: int32(pasturePb.TransferPenReason_Normal),
  258. Label: "正常转群",
  259. Disabled: true,
  260. }, &pasturePb.ConfigOptionsList{
  261. Value: int32(pasturePb.TransferPenReason_Feed),
  262. Label: "饲喂转群",
  263. Disabled: true,
  264. }, &pasturePb.ConfigOptionsList{
  265. Value: int32(pasturePb.TransferPenReason_Dry_Milk),
  266. Label: "干奶转群",
  267. Disabled: true,
  268. }, &pasturePb.ConfigOptionsList{
  269. Value: int32(pasturePb.TransferPenReason_Pregnant),
  270. Label: "怀孕转群",
  271. Disabled: true,
  272. }, &pasturePb.ConfigOptionsList{
  273. Value: int32(pasturePb.TransferPenReason_Overantibody),
  274. Label: "过抗转群",
  275. Disabled: true,
  276. })
  277. return transferPenList
  278. }
  279. func (s *StoreEntry) ChildNumberEnumList() []*pasturePb.ConfigOptionsList {
  280. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  281. configOptions = append(configOptions,
  282. &pasturePb.ConfigOptionsList{
  283. Value: int32(pasturePb.ChildNumber_One),
  284. Label: "单胎",
  285. Disabled: true,
  286. }, &pasturePb.ConfigOptionsList{
  287. Value: int32(pasturePb.ChildNumber_Two),
  288. Label: "双胎",
  289. Disabled: true,
  290. }, &pasturePb.ConfigOptionsList{
  291. Value: int32(pasturePb.ChildNumber_Three),
  292. Label: "三胎",
  293. Disabled: true,
  294. }, &pasturePb.ConfigOptionsList{
  295. Value: int32(pasturePb.ChildNumber_Four),
  296. Label: "四胎",
  297. Disabled: true,
  298. })
  299. return configOptions
  300. }
  301. func (s *StoreEntry) CalvingLevelEnumList() []*pasturePb.ConfigOptionsList {
  302. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  303. configOptions = append(configOptions,
  304. &pasturePb.ConfigOptionsList{
  305. Value: int32(pasturePb.CalvingLevel_Natural_Childbirth),
  306. Label: "自然分娩",
  307. Disabled: true,
  308. }, &pasturePb.ConfigOptionsList{
  309. Value: int32(pasturePb.CalvingLevel_Artificial_Midwifery1),
  310. Label: "人工助产(1-2人)",
  311. Disabled: true,
  312. }, &pasturePb.ConfigOptionsList{
  313. Value: int32(pasturePb.CalvingLevel_Artificial_Midwifery2),
  314. Label: "人工助产(3人以上)",
  315. Disabled: true,
  316. }, &pasturePb.ConfigOptionsList{
  317. Value: int32(pasturePb.CalvingLevel_Caesarean_Section),
  318. Label: "剖腹产",
  319. Disabled: true,
  320. })
  321. return configOptions
  322. }
  323. func (s *StoreEntry) DystociaReasonEnumList() []*pasturePb.ConfigOptionsList {
  324. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  325. configOptions = append(configOptions,
  326. &pasturePb.ConfigOptionsList{
  327. Value: int32(pasturePb.DystociaReason_Malposition),
  328. Label: "胎位不正",
  329. Disabled: true,
  330. }, &pasturePb.ConfigOptionsList{
  331. Value: int32(pasturePb.DystociaReason_Fetal_Overgrowth),
  332. Label: "胎儿过大",
  333. Disabled: true,
  334. }, &pasturePb.ConfigOptionsList{
  335. Value: int32(pasturePb.DystociaReason_Uterine_Atony),
  336. Label: "子宫收缩无力",
  337. Disabled: true,
  338. }, &pasturePb.ConfigOptionsList{
  339. Value: int32(pasturePb.DystociaReason_Pelvic_Stenosis),
  340. Label: "盆骨狭小",
  341. Disabled: true,
  342. }, &pasturePb.ConfigOptionsList{
  343. Value: int32(pasturePb.DystociaReason_Sub_Health),
  344. Label: "母牛亚健康状态",
  345. Disabled: true,
  346. })
  347. return configOptions
  348. }
  349. func (s *StoreEntry) PregnantCheckResultEnumList() []*pasturePb.ConfigOptionsList {
  350. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  351. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  352. Value: int32(pasturePb.PregnantCheckResult_InCheck_UnPregnant),
  353. Label: "初检未孕",
  354. Disabled: true,
  355. }, &pasturePb.ConfigOptionsList{
  356. Value: int32(pasturePb.PregnantCheckResult_InCheck_Pregnant),
  357. Label: "初检已孕",
  358. Disabled: true,
  359. }, &pasturePb.ConfigOptionsList{
  360. Value: int32(pasturePb.PregnantCheckResult_Recheck_UnPregnant),
  361. Label: "复检未孕",
  362. Disabled: true,
  363. }, &pasturePb.ConfigOptionsList{
  364. Value: int32(pasturePb.PregnantCheckResult_Recheck_Pregnant),
  365. Label: "初检已孕",
  366. Disabled: true,
  367. })
  368. return configOptions
  369. }
  370. func (s *StoreEntry) PregnantCheckMethodEnumList() []*pasturePb.ConfigOptionsList {
  371. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  372. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  373. Value: int32(pasturePb.PregnantCheckMethod_B_Ultrasound),
  374. Label: "B超",
  375. Disabled: true,
  376. }, &pasturePb.ConfigOptionsList{
  377. Value: int32(pasturePb.PregnantCheckMethod_Blood_Testing),
  378. Label: "血检",
  379. Disabled: true,
  380. }, &pasturePb.ConfigOptionsList{
  381. Value: int32(pasturePb.PregnantCheckMethod_Manual_Inspection),
  382. Label: "人工检查",
  383. Disabled: true,
  384. })
  385. return configOptions
  386. }
  387. func (s *StoreEntry) DrugCategoryEnumList() []*pasturePb.ConfigOptionsList {
  388. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  389. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  390. Value: int32(pasturePb.DrugCategory_Antibiotics),
  391. Label: "抗生素类",
  392. Disabled: true,
  393. }, &pasturePb.ConfigOptionsList{
  394. Value: int32(pasturePb.DrugCategory_Antivirals),
  395. Label: "抗病毒类",
  396. Disabled: true,
  397. }, &pasturePb.ConfigOptionsList{
  398. Value: int32(pasturePb.DrugCategory_Antifungals),
  399. Label: "抗真菌类",
  400. Disabled: true,
  401. }, &pasturePb.ConfigOptionsList{
  402. Value: int32(pasturePb.DrugCategory_Antiparasitics),
  403. Label: "驱虫类",
  404. Disabled: true,
  405. }, &pasturePb.ConfigOptionsList{
  406. Value: int32(pasturePb.DrugCategory_Analgesics),
  407. Label: "镇痛类",
  408. Disabled: true,
  409. }, &pasturePb.ConfigOptionsList{
  410. Value: int32(pasturePb.DrugCategory_Antipyretic),
  411. Label: "退烧类",
  412. Disabled: true,
  413. }, &pasturePb.ConfigOptionsList{
  414. Value: int32(pasturePb.DrugCategory_Vitamin),
  415. Label: "维生素类",
  416. Disabled: true,
  417. }, &pasturePb.ConfigOptionsList{
  418. Value: int32(pasturePb.DrugCategory_Brine),
  419. Label: "盐水",
  420. Disabled: true,
  421. }, &pasturePb.ConfigOptionsList{
  422. Value: int32(pasturePb.DrugCategory_Glucose),
  423. Label: "葡萄糖",
  424. Disabled: true,
  425. }, &pasturePb.ConfigOptionsList{
  426. Value: int32(pasturePb.DrugCategory_Hormone),
  427. Label: "激素类",
  428. Disabled: true,
  429. }, &pasturePb.ConfigOptionsList{
  430. Value: int32(pasturePb.DrugCategory_Anti_Stress),
  431. Label: "抗应激类",
  432. Disabled: true,
  433. }, &pasturePb.ConfigOptionsList{
  434. Value: int32(pasturePb.DrugCategory_Disinfect),
  435. Label: "消毒类",
  436. Disabled: true,
  437. }, &pasturePb.ConfigOptionsList{
  438. Value: int32(pasturePb.DrugCategory_Chinese_Herbal),
  439. Label: "中药合剂",
  440. Disabled: true,
  441. }, &pasturePb.ConfigOptionsList{
  442. Value: int32(pasturePb.DrugCategory_Tocolytic),
  443. Label: "保胎类",
  444. Disabled: true,
  445. }, &pasturePb.ConfigOptionsList{
  446. Value: int32(pasturePb.DrugCategory_Immunity),
  447. Label: "疫苗类",
  448. Disabled: true,
  449. })
  450. return configOptions
  451. }
  452. func (s *StoreEntry) DrugUsageEnumList() []*pasturePb.ConfigOptionsList {
  453. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  454. configOptions = append(configOptions,
  455. &pasturePb.ConfigOptionsList{
  456. Value: int32(pasturePb.DrugUsage_Oral_Medications),
  457. Label: "口服",
  458. Disabled: true,
  459. }, &pasturePb.ConfigOptionsList{
  460. Value: int32(pasturePb.DrugUsage_Injectable_Medications),
  461. Label: "肌注",
  462. Disabled: true,
  463. }, &pasturePb.ConfigOptionsList{
  464. Value: int32(pasturePb.DrugUsage_Topical_Medications),
  465. Label: "外用",
  466. Disabled: true,
  467. }, &pasturePb.ConfigOptionsList{
  468. Value: int32(pasturePb.DrugUsage_Inhalation_Medications),
  469. Label: "吸入",
  470. Disabled: true,
  471. }, &pasturePb.ConfigOptionsList{
  472. Value: int32(pasturePb.DrugUsage_Drink_Medications),
  473. Label: "饮水",
  474. Disabled: true,
  475. })
  476. return configOptions
  477. }
  478. func (s *StoreEntry) UnitEnumList() []*pasturePb.ConfigOptionsList {
  479. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  480. configOptions = append(configOptions,
  481. &pasturePb.ConfigOptionsList{
  482. Value: int32(pasturePb.Unit_Pieces),
  483. Label: "个",
  484. Disabled: true,
  485. }, &pasturePb.ConfigOptionsList{
  486. Value: int32(pasturePb.Unit_Package),
  487. Label: "包/袋",
  488. Disabled: true,
  489. }, &pasturePb.ConfigOptionsList{
  490. Value: int32(pasturePb.Unit_Bottle),
  491. Label: "瓶",
  492. Disabled: true,
  493. }, &pasturePb.ConfigOptionsList{
  494. Value: int32(pasturePb.Unit_Box),
  495. Label: "盒",
  496. Disabled: true,
  497. }, &pasturePb.ConfigOptionsList{
  498. Value: int32(pasturePb.Unit_Boxful),
  499. Label: "箱",
  500. Disabled: true,
  501. }, &pasturePb.ConfigOptionsList{
  502. Value: int32(pasturePb.Unit_Branch),
  503. Label: "支",
  504. Disabled: true,
  505. }, &pasturePb.ConfigOptionsList{
  506. Value: int32(pasturePb.Unit_Barrel),
  507. Label: "桶",
  508. Disabled: true,
  509. }, &pasturePb.ConfigOptionsList{
  510. Value: int32(pasturePb.Unit_Pot),
  511. Label: "罐",
  512. Disabled: true,
  513. }, &pasturePb.ConfigOptionsList{
  514. Value: int32(pasturePb.Unit_ML),
  515. Label: "毫升",
  516. Disabled: true,
  517. }, &pasturePb.ConfigOptionsList{
  518. Value: int32(pasturePb.Unit_L),
  519. Label: "升",
  520. Disabled: true,
  521. })
  522. return configOptions
  523. }
  524. func (s *StoreEntry) ExposeEstrusTypeEnumList() []*pasturePb.ConfigOptionsList {
  525. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  526. configOptions = append(configOptions,
  527. &pasturePb.ConfigOptionsList{
  528. Value: int32(pasturePb.ExposeEstrusType_Neck_Ring),
  529. Label: "脖环揭发",
  530. Disabled: true,
  531. }, &pasturePb.ConfigOptionsList{
  532. Value: int32(pasturePb.ExposeEstrusType_Foot_Ring),
  533. Label: "脚环/计步器揭发",
  534. Disabled: true,
  535. }, &pasturePb.ConfigOptionsList{
  536. Value: int32(pasturePb.ExposeEstrusType_Manual_Observation),
  537. Label: "人工观察",
  538. Disabled: true,
  539. })
  540. return configOptions
  541. }
  542. func (s *StoreEntry) FrozenSemenTypeEnumList() []*pasturePb.ConfigOptionsList {
  543. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  544. configOptions = append(configOptions,
  545. &pasturePb.ConfigOptionsList{
  546. Value: int32(pasturePb.FrozenSemenType_Ordinary),
  547. Label: "常规冻精",
  548. Disabled: true,
  549. }, &pasturePb.ConfigOptionsList{
  550. Value: int32(pasturePb.FrozenSemenType_Gender_Control),
  551. Label: "性控冻精",
  552. Disabled: true,
  553. })
  554. return configOptions
  555. }
  556. func (s *StoreEntry) BullNumberEnumList() []*pasturePb.BullOptionsList {
  557. frozenSemenList := make([]*model.EventFrozenSemen, 0)
  558. bullNumberList := make([]*pasturePb.BullOptionsList, 0)
  559. if err := s.DB.Where("quantity > 0").Group("bull_id").Find(&frozenSemenList).Error; err != nil {
  560. zaplog.Error("BullNumberEnumList", zap.Any("Find", err))
  561. }
  562. for _, v := range frozenSemenList {
  563. bullNumberList = append(bullNumberList, &pasturePb.BullOptionsList{
  564. Value: v.BullId,
  565. Label: v.BullId,
  566. Disabled: true,
  567. })
  568. }
  569. return bullNumberList
  570. }
  571. func (s *StoreEntry) WeekEnumList() []*pasturePb.ConfigOptionsList {
  572. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  573. configOptions = append(configOptions,
  574. &pasturePb.ConfigOptionsList{
  575. Value: int32(pasturePb.Week_Monday),
  576. Label: "周一",
  577. Disabled: true,
  578. }, &pasturePb.ConfigOptionsList{
  579. Value: int32(pasturePb.Week_Tuesday),
  580. Label: "周二",
  581. Disabled: true,
  582. }, &pasturePb.ConfigOptionsList{
  583. Value: int32(pasturePb.Week_Wednesday),
  584. Label: "周三",
  585. Disabled: true,
  586. }, &pasturePb.ConfigOptionsList{
  587. Value: int32(pasturePb.Week_Thursday),
  588. Label: "周四",
  589. Disabled: true,
  590. }, &pasturePb.ConfigOptionsList{
  591. Value: int32(pasturePb.Week_Friday),
  592. Label: "周五",
  593. Disabled: true,
  594. }, &pasturePb.ConfigOptionsList{
  595. Value: int32(pasturePb.Week_Saturday),
  596. Label: "周六",
  597. Disabled: true,
  598. }, &pasturePb.ConfigOptionsList{
  599. Value: int32(pasturePb.Week_Sunday),
  600. Label: "周日",
  601. Disabled: true,
  602. })
  603. return configOptions
  604. }
  605. func (s *StoreEntry) monthEnumList() []*pasturePb.ConfigOptionsList {
  606. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  607. for v := 1; v <= 31; v++ {
  608. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  609. Value: int32(v),
  610. Label: fmt.Sprintf("%d号", v),
  611. Disabled: true,
  612. })
  613. }
  614. return configOptions
  615. }
  616. func (s *StoreEntry) WorkOrderFrequencyEnumList() []*pasturePb.ConfigOptionsList {
  617. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  618. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  619. Value: int32(pasturePb.WorkOrderFrequency_None),
  620. Label: "一次性",
  621. Disabled: true,
  622. }, &pasturePb.ConfigOptionsList{
  623. Value: int32(pasturePb.WorkOrderFrequency_Daily),
  624. Label: "每天",
  625. Disabled: true,
  626. }, &pasturePb.ConfigOptionsList{
  627. Value: int32(pasturePb.WorkOrderFrequency_Weekly),
  628. Label: "每周",
  629. Disabled: true,
  630. }, &pasturePb.ConfigOptionsList{
  631. Value: int32(pasturePb.WorkOrderFrequency_Monthly),
  632. Label: "每月",
  633. Disabled: true,
  634. })
  635. return configOptions
  636. }
  637. func (s *StoreEntry) WorkOrderSubUnitEnumList() []*pasturePb.ConfigOptionsList {
  638. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  639. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  640. Value: int32(pasturePb.WorkOrderSubscribeUnit_Person),
  641. Label: "个人",
  642. Disabled: true,
  643. }, &pasturePb.ConfigOptionsList{
  644. Value: int32(pasturePb.WorkOrderSubscribeUnit_dept),
  645. Label: "部门",
  646. Disabled: true,
  647. })
  648. return configOptions
  649. }
  650. func (s *StoreEntry) WorkOrderPriorityEnumList() []*pasturePb.ConfigOptionsList {
  651. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  652. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  653. Value: int32(pasturePb.Priority_Low),
  654. Label: "低",
  655. Disabled: true,
  656. }, &pasturePb.ConfigOptionsList{
  657. Value: int32(pasturePb.Priority_Middle),
  658. Label: "一般",
  659. Disabled: true,
  660. }, &pasturePb.ConfigOptionsList{
  661. Value: int32(pasturePb.Priority_High),
  662. Label: "紧急",
  663. Disabled: true,
  664. })
  665. return configOptions
  666. }
  667. func (s *StoreEntry) WorkOrderCategoryEnumList() []*pasturePb.ConfigOptionsList {
  668. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  669. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  670. Value: int32(pasturePb.WorkOrderCategory_Health),
  671. Label: "保健",
  672. Disabled: true,
  673. }, &pasturePb.ConfigOptionsList{
  674. Value: int32(pasturePb.WorkOrderCategory_Breed),
  675. Label: "繁殖",
  676. Disabled: true,
  677. }, &pasturePb.ConfigOptionsList{
  678. Value: int32(pasturePb.WorkOrderCategory_Nutrition),
  679. Label: "营养",
  680. Disabled: true,
  681. }, &pasturePb.ConfigOptionsList{
  682. Value: int32(pasturePb.WorkOrderCategory_Ordinary),
  683. Label: "日常",
  684. Disabled: true,
  685. }, &pasturePb.ConfigOptionsList{
  686. Value: int32(pasturePb.WorkOrderCategory_Other),
  687. Label: "其他",
  688. Disabled: true,
  689. })
  690. return configOptions
  691. }