config_data.go 22 KB

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