config_data_base.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. package backend
  2. import (
  3. "kpt-pasture/model"
  4. pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
  5. )
  6. func (s *StoreEntry) OutReasonEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  7. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  8. if isAll == model.IsAllYes {
  9. configOptions = append(configOptions,
  10. &pasturePb.ConfigOptionsList{
  11. Value: int32(0),
  12. Label: "全部",
  13. Disabled: true,
  14. })
  15. }
  16. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  17. Value: int32(pasturePb.OutReasons_Respiratory_System_Disease),
  18. Label: "呼吸系统疾病",
  19. Disabled: true,
  20. }, &pasturePb.ConfigOptionsList{
  21. Value: int32(pasturePb.OutReasons_Nutritional_Metabolic_Disease),
  22. Label: "营养代谢疾病",
  23. Disabled: true,
  24. }, &pasturePb.ConfigOptionsList{
  25. Value: int32(pasturePb.OutReasons_Breeding_Disease),
  26. Label: "繁殖疾病",
  27. Disabled: true,
  28. }, &pasturePb.ConfigOptionsList{
  29. Value: int32(pasturePb.OutReasons_Breast_Disease),
  30. Label: "乳房疾病",
  31. Disabled: true,
  32. }, &pasturePb.ConfigOptionsList{
  33. Value: int32(pasturePb.OutReasons_Long_Term_infertility),
  34. Label: "久配不孕",
  35. Disabled: true,
  36. }, &pasturePb.ConfigOptionsList{
  37. Value: int32(pasturePb.OutReasons_Multiple_Miscarriages),
  38. Label: "多次流产",
  39. Disabled: true,
  40. }, &pasturePb.ConfigOptionsList{
  41. Value: int32(pasturePb.OutReasons_Long_Treatment_Without_Recovery),
  42. Label: "久治不愈",
  43. Disabled: true,
  44. }, &pasturePb.ConfigOptionsList{
  45. Value: int32(pasturePb.OutReasons_Postpartum_Paralysis),
  46. Label: "产后瘫痪",
  47. Disabled: true,
  48. }, &pasturePb.ConfigOptionsList{
  49. Value: int32(pasturePb.OutReasons_Mastitis),
  50. Label: "乳房炎",
  51. Disabled: true,
  52. }, &pasturePb.ConfigOptionsList{
  53. Value: int32(pasturePb.OutReasons_Hoof_Disease),
  54. Label: "蹄病",
  55. Disabled: true,
  56. }, &pasturePb.ConfigOptionsList{
  57. Value: int32(pasturePb.OutReasons_Congenital_Malformation),
  58. Label: "先天畸形",
  59. Disabled: true,
  60. }, &pasturePb.ConfigOptionsList{
  61. Value: int32(pasturePb.OutReasons_Congenital_Malformation),
  62. Label: "先天畸形",
  63. Disabled: true,
  64. }, &pasturePb.ConfigOptionsList{
  65. Value: int32(pasturePb.OutReasons_Dysplasia),
  66. Label: "发育不良",
  67. Disabled: true,
  68. }, &pasturePb.ConfigOptionsList{
  69. Value: int32(pasturePb.OutReasons_Hernia),
  70. Label: "疝气",
  71. Disabled: true,
  72. }, &pasturePb.ConfigOptionsList{
  73. Value: int32(pasturePb.OutReasons_Excessive_Age),
  74. Label: "月龄过大",
  75. Disabled: true,
  76. }, &pasturePb.ConfigOptionsList{
  77. Value: int32(pasturePb.OutReasons_Excessive_Age),
  78. Label: "月龄过大",
  79. Disabled: true,
  80. }, &pasturePb.ConfigOptionsList{
  81. Value: int32(pasturePb.OutReasons_Excessive_Weight),
  82. Label: "体重过肥",
  83. Disabled: true,
  84. }, &pasturePb.ConfigOptionsList{
  85. Value: int32(pasturePb.OutReasons_Other_Disease),
  86. Label: "其他疾病",
  87. Disabled: true,
  88. }, &pasturePb.ConfigOptionsList{
  89. Value: int32(pasturePb.OutReasons_Weak_Child),
  90. Label: "弱仔",
  91. Disabled: true,
  92. }, &pasturePb.ConfigOptionsList{
  93. Value: int32(pasturePb.OutReasons_Obsessive_Bull),
  94. Label: "恶癖牛",
  95. Disabled: true,
  96. }, &pasturePb.ConfigOptionsList{
  97. Value: int32(pasturePb.OutReasons_Low_Milk),
  98. Label: "低产",
  99. Disabled: true,
  100. }, &pasturePb.ConfigOptionsList{
  101. Value: int32(pasturePb.OutReasons_Slow_Growing),
  102. Label: "生长缓慢",
  103. Disabled: true,
  104. }, &pasturePb.ConfigOptionsList{
  105. Value: int32(pasturePb.OutReasons_Other),
  106. Label: "其他",
  107. Disabled: true,
  108. }, &pasturePb.ConfigOptionsList{
  109. Value: int32(pasturePb.OutReasons_Unknown),
  110. Label: "未知原因",
  111. Disabled: true,
  112. })
  113. return configOptions
  114. }
  115. func (s *StoreEntry) DeathReasonEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  116. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  117. if isAll == model.IsAllYes {
  118. configOptions = append(configOptions,
  119. &pasturePb.ConfigOptionsList{
  120. Value: int32(0),
  121. Label: "全部",
  122. Disabled: true,
  123. })
  124. }
  125. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  126. Value: int32(pasturePb.DeathReason_Digestive_System_Diseases),
  127. Label: "消化性疾病",
  128. Disabled: true,
  129. }, &pasturePb.ConfigOptionsList{
  130. Value: int32(pasturePb.DeathReason_Respiratory_System_Diseases),
  131. Label: "呼吸性疾病",
  132. Disabled: true,
  133. }, &pasturePb.ConfigOptionsList{
  134. Value: int32(pasturePb.DeathReason_Reproductive_System_Diseases),
  135. Label: "繁殖性疾病",
  136. Disabled: true,
  137. }, &pasturePb.ConfigOptionsList{
  138. Value: int32(pasturePb.DeathReason_Metabolic_System_Diseases),
  139. Label: "代谢性疾病",
  140. Disabled: true,
  141. }, &pasturePb.ConfigOptionsList{
  142. Value: int32(pasturePb.DeathReason_Infectious_Diseases),
  143. Label: "传染性疾病",
  144. Disabled: true,
  145. }, &pasturePb.ConfigOptionsList{
  146. Value: int32(pasturePb.DeathReason_Difficult_Birth),
  147. Label: "难产",
  148. Disabled: true,
  149. }, &pasturePb.ConfigOptionsList{
  150. Value: int32(pasturePb.DeathReason_Accident_Dead),
  151. Label: "意外死亡",
  152. Disabled: true,
  153. }, &pasturePb.ConfigOptionsList{
  154. Value: int32(pasturePb.DeathReason_Stress),
  155. Label: "应激",
  156. Disabled: true,
  157. }, &pasturePb.ConfigOptionsList{
  158. Value: int32(pasturePb.DeathReason_Trauma),
  159. Label: "外伤",
  160. Disabled: true,
  161. }, &pasturePb.ConfigOptionsList{
  162. Value: int32(pasturePb.DeathReason_Pneumonia),
  163. Label: "肺炎",
  164. Disabled: true,
  165. }, &pasturePb.ConfigOptionsList{
  166. Value: int32(pasturePb.DeathReason_Diarrhea),
  167. Label: "腹泻",
  168. Disabled: true,
  169. }, &pasturePb.ConfigOptionsList{
  170. Value: int32(pasturePb.DeathReason_Ketosis),
  171. Label: "酮症",
  172. Disabled: true,
  173. }, &pasturePb.ConfigOptionsList{
  174. Value: int32(pasturePb.DeathReason_Acidosis),
  175. Label: "酸中毒",
  176. Disabled: true,
  177. }, &pasturePb.ConfigOptionsList{
  178. Value: int32(pasturePb.DeathReason_Rumina_Impaction),
  179. Label: "瘤胃积食",
  180. Disabled: true,
  181. }, &pasturePb.ConfigOptionsList{
  182. Value: int32(pasturePb.DeathReason_Intestinal_Torsion),
  183. Label: "肠扭转",
  184. Disabled: true,
  185. }, &pasturePb.ConfigOptionsList{
  186. Value: int32(pasturePb.DeathReason_Other),
  187. Label: "其他",
  188. Disabled: true,
  189. })
  190. return configOptions
  191. }
  192. func (s *StoreEntry) MatingResultEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  193. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  194. if isAll == model.IsAllYes {
  195. configOptions = append(configOptions,
  196. &pasturePb.ConfigOptionsList{
  197. Value: int32(0),
  198. Label: "全部",
  199. Disabled: true,
  200. })
  201. }
  202. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  203. Value: int32(pasturePb.MatingResult_Unknown),
  204. Label: "未知",
  205. Disabled: true,
  206. }, &pasturePb.ConfigOptionsList{
  207. Value: int32(pasturePb.MatingResult_ReMatch),
  208. Label: "复配",
  209. Disabled: true,
  210. }, &pasturePb.ConfigOptionsList{
  211. Value: int32(pasturePb.MatingResult_Pregnant),
  212. Label: "怀孕",
  213. Disabled: true,
  214. }, &pasturePb.ConfigOptionsList{
  215. Value: int32(pasturePb.MatingResult_Empty),
  216. Label: "空怀",
  217. Disabled: true,
  218. }, &pasturePb.ConfigOptionsList{
  219. Value: int32(pasturePb.MatingResult_Abort),
  220. Label: "流产",
  221. Disabled: true,
  222. })
  223. return configOptions
  224. }
  225. func (s *StoreEntry) EventCategoryEnumList(isAll string) []*pasturePb.ConfigOptionsList {
  226. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  227. if isAll == model.IsAllYes {
  228. configOptions = append(configOptions,
  229. &pasturePb.ConfigOptionsList{
  230. Value: int32(0),
  231. Label: "全部",
  232. Disabled: true,
  233. })
  234. }
  235. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  236. Value: int32(pasturePb.EventCategory_Base),
  237. Label: "基础事件",
  238. Disabled: true,
  239. }, &pasturePb.ConfigOptionsList{
  240. Value: int32(pasturePb.EventCategory_Breed),
  241. Label: "繁殖事件",
  242. Disabled: true,
  243. }, &pasturePb.ConfigOptionsList{
  244. Value: int32(pasturePb.EventCategory_Health),
  245. Label: "兽医事件",
  246. Disabled: true,
  247. }, &pasturePb.ConfigOptionsList{
  248. Value: int32(pasturePb.EventCategory_Other),
  249. Label: "其他事件",
  250. Disabled: true,
  251. })
  252. return configOptions
  253. }
  254. func (s *StoreEntry) IndicatorsDetailsList(isAll string) []*pasturePb.ConfigOptionsList {
  255. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  256. if isAll == model.IsAllYes {
  257. configOptions = append(configOptions,
  258. &pasturePb.ConfigOptionsList{
  259. Value: int32(0),
  260. Label: "全部",
  261. Disabled: true,
  262. })
  263. }
  264. indicatorsDetailsList, _ := s.FindIndicatorsDetailsList()
  265. if len(indicatorsDetailsList) <= 0 {
  266. return configOptions
  267. }
  268. for _, v := range indicatorsDetailsList {
  269. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  270. Label: v.Name,
  271. Disabled: true,
  272. Props: v.Kind,
  273. })
  274. }
  275. return configOptions
  276. }
  277. func (s *StoreEntry) CowPurposeList(isAll string) []*pasturePb.ConfigOptionsList {
  278. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  279. if isAll == model.IsAllYes {
  280. configOptions = append(configOptions,
  281. &pasturePb.ConfigOptionsList{
  282. Value: int32(0),
  283. Label: "全部",
  284. Disabled: true,
  285. })
  286. }
  287. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  288. Value: int32(pasturePb.Purpose_Breeding),
  289. Label: "繁殖",
  290. Disabled: true,
  291. }, &pasturePb.ConfigOptionsList{
  292. Value: int32(pasturePb.Purpose_Fatten),
  293. Label: "育肥",
  294. Disabled: true,
  295. })
  296. return configOptions
  297. }
  298. func (s *StoreEntry) CowOutReasonList(isAll string) []*pasturePb.ConfigOptionsList {
  299. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  300. if isAll == model.IsAllYes {
  301. configOptions = append(configOptions,
  302. &pasturePb.ConfigOptionsList{
  303. Value: int32(0),
  304. Label: "全部",
  305. Disabled: true,
  306. })
  307. }
  308. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  309. Value: int32(pasturePb.OutReasons_Respiratory_System_Disease),
  310. Label: "呼吸系统疾病",
  311. Disabled: true,
  312. }, &pasturePb.ConfigOptionsList{
  313. Value: int32(pasturePb.OutReasons_Nutritional_Metabolic_Disease),
  314. Label: "营养代谢疾病",
  315. Disabled: true,
  316. }, &pasturePb.ConfigOptionsList{
  317. Value: int32(pasturePb.OutReasons_Breeding_Disease),
  318. Label: "繁殖疾病",
  319. Disabled: true,
  320. }, &pasturePb.ConfigOptionsList{
  321. Value: int32(pasturePb.OutReasons_Breast_Disease),
  322. Label: "乳房疾病",
  323. Disabled: true,
  324. }, &pasturePb.ConfigOptionsList{
  325. Value: int32(pasturePb.OutReasons_Hoof_Disease),
  326. Label: "蹄病",
  327. Disabled: true,
  328. }, &pasturePb.ConfigOptionsList{
  329. Value: int32(pasturePb.OutReasons_Low_Milk),
  330. Label: "低产",
  331. Disabled: true,
  332. }, &pasturePb.ConfigOptionsList{
  333. Value: int32(pasturePb.OutReasons_Slow_Growing),
  334. Label: "生长缓慢",
  335. Disabled: true,
  336. }, &pasturePb.ConfigOptionsList{
  337. Value: int32(pasturePb.OutReasons_Slow_Growing),
  338. Label: "生长缓慢",
  339. Disabled: true,
  340. }, &pasturePb.ConfigOptionsList{
  341. Value: int32(pasturePb.OutReasons_Other),
  342. Label: "其他原因",
  343. Disabled: true,
  344. })
  345. return configOptions
  346. }
  347. func (s *StoreEntry) CowDeathDestinationList(isAll string) []*pasturePb.ConfigOptionsList {
  348. configOptions := make([]*pasturePb.ConfigOptionsList, 0)
  349. if isAll == model.IsAllYes {
  350. configOptions = append(configOptions,
  351. &pasturePb.ConfigOptionsList{
  352. Value: int32(0),
  353. Label: "全部",
  354. Disabled: true,
  355. })
  356. }
  357. configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
  358. Value: int32(pasturePb.DeathDestination_NuisanceLess),
  359. Label: "无公害处理",
  360. Disabled: true,
  361. }, &pasturePb.ConfigOptionsList{
  362. Value: int32(pasturePb.DeathDestination_Slaughterhouse),
  363. Label: "屠宰场",
  364. Disabled: true,
  365. }, &pasturePb.ConfigOptionsList{
  366. Value: int32(pasturePb.DeathDestination_Other),
  367. Label: "其他",
  368. Disabled: true,
  369. })
  370. return configOptions
  371. }