package backend import ( "context" "kpt-pasture/model" pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow" ) func (s *StoreEntry) OutReasonEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(0), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Respiratory_System_Disease), Label: "呼吸系统疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Nutritional_Metabolic_Disease), Label: "营养代谢疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Breeding_Disease), Label: "繁殖疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Breast_Disease), Label: "乳房疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Long_Term_infertility), Label: "久配不孕", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Multiple_Miscarriages), Label: "多次流产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Long_Treatment_Without_Recovery), Label: "久治不愈", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Postpartum_Paralysis), Label: "产后瘫痪", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Mastitis), Label: "乳房炎", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Hoof_Disease), Label: "蹄病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Congenital_Malformation), Label: "先天畸形", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Congenital_Malformation), Label: "先天畸形", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Dysplasia), Label: "发育不良", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Hernia), Label: "疝气", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Excessive_Age), Label: "月龄过大", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Excessive_Age), Label: "月龄过大", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Excessive_Weight), Label: "体重过肥", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Other_Disease), Label: "其他疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Weak_Child), Label: "弱仔", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Obsessive_Bull), Label: "恶癖牛", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Low_Milk), Label: "低产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Slow_Growing), Label: "生长缓慢", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Other), Label: "其他", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Unknown), Label: "未知原因", Disabled: true, }) return configOptions } func (s *StoreEntry) DeathReasonEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(0), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Digestive_System_Diseases), Label: "消化性疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Respiratory_System_Diseases), Label: "呼吸性疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Reproductive_System_Diseases), Label: "繁殖性疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Metabolic_System_Diseases), Label: "代谢性疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Infectious_Diseases), Label: "传染性疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Difficult_Birth), Label: "难产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Accident_Dead), Label: "意外死亡", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Stress), Label: "应激", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Trauma), Label: "外伤", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Pneumonia), Label: "肺炎", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Diarrhea), Label: "腹泻", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Ketosis), Label: "酮症", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Acidosis), Label: "酸中毒", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Rumina_Impaction), Label: "瘤胃积食", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Intestinal_Torsion), Label: "肠扭转", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathReason_Other), Label: "其他", Disabled: true, }) return configOptions } func (s *StoreEntry) MatingResultEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(0), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MatingResult_Unknown), Label: "未知", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MatingResult_ReMatch), Label: "复配", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MatingResult_Pregnant), Label: "怀孕", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MatingResult_Empty), Label: "空怀", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MatingResult_Abort), Label: "流产", Disabled: true, }) return configOptions } func (s *StoreEntry) EventCategoryEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(0), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.EventCategory_Base), Label: "基础事件", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.EventCategory_Breed), Label: "繁殖事件", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.EventCategory_Health), Label: "兽医事件", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.EventCategory_Other), Label: "其他事件", Disabled: true, }) return configOptions } func (s *StoreEntry) IndicatorsDetailsList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(0), Label: "全部", Disabled: true, }) } indicatorsDetailsList, _ := s.FindIndicatorsDetailsList(context.Background()) if len(indicatorsDetailsList) <= 0 { return configOptions } for _, v := range indicatorsDetailsList { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Label: v.Name, Disabled: true, Props: v.Kind, }) } return configOptions } func (s *StoreEntry) CowPurposeList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(0), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.Purpose_Breeding), Label: "繁殖", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.Purpose_Fatten), Label: "育肥", Disabled: true, }) return configOptions } func (s *StoreEntry) CowOutReasonList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(0), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Respiratory_System_Disease), Label: "呼吸系统疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Nutritional_Metabolic_Disease), Label: "营养代谢疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Breeding_Disease), Label: "繁殖疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Breast_Disease), Label: "乳房疾病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Hoof_Disease), Label: "蹄病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Low_Milk), Label: "低产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Slow_Growing), Label: "生长缓慢", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Slow_Growing), Label: "生长缓慢", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.OutReasons_Other), Label: "其他原因", Disabled: true, }) return configOptions } func (s *StoreEntry) CowDeathDestinationList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(0), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathDestination_NuisanceLess), Label: "无公害处理", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathDestination_Slaughterhouse), Label: "屠宰场", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DeathDestination_Other), Label: "其他", Disabled: true, }) return configOptions }