package backend import ( "kpt-pasture/model" pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow" "gitee.com/xuyiping_admin/pkg/logger/zaplog" "go.uber.org/zap" ) func (s *StoreEntry) LactEnumList(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(1), Label: "1", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(2), Label: "2", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(3), Label: "3", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(4), Label: ">3", Disabled: true, }) return configOptions } func (s *StoreEntry) DiseaseAnalysisMethodEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DiseaseAnalysisMethod_Invalid), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DiseaseAnalysisMethod_Months), Label: "按月份", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DiseaseAnalysisMethod_Disease_Category), Label: "疾病分类", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DiseaseAnalysisMethod_Disease), Label: "疾病名称", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DiseaseAnalysisMethod_Operator), Label: "兽医", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.DiseaseAnalysisMethod_Prescription), Label: "处方", Disabled: true, }) return configOptions } func (s *StoreEntry) diseaseTypeEnumList(isAll string) []*pasturePb.ConfigOptionsList { configDiseaseTypeList := make([]*model.ConfigDiseaseType, 0) configOptionsList := make([]*pasturePb.ConfigOptionsList, 0) if err := s.DB.Where("is_show = ?", pasturePb.IsShow_Ok).Find(&configDiseaseTypeList).Error; err != nil { zaplog.Error("diseaseTypeEnumList", zap.Any("Find", err)) } for _, v := range configDiseaseTypeList { configOptionsList = append(configOptionsList, &pasturePb.ConfigOptionsList{ Value: int32(v.Id), Label: v.Name, Disabled: true, }) } return configOptionsList } func (s *StoreEntry) SingleFactorAnalysisMethodEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SingleFactorAnalysisMethod_Cycle), Label: "按周期分析", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SingleFactorAnalysisMethod_Months), Label: "按月份分析", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SingleFactorAnalysisMethod_Mating_Times), Label: "按配种次数分析", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SingleFactorAnalysisMethod_Breeding_Method), Label: "按配种方式分析", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SingleFactorAnalysisMethod_Breeding_Company), Label: "按育种公司分析", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SingleFactorAnalysisMethod_Operation), Label: "按兽医人员分析", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SingleFactorAnalysisMethod_Mating_Interval), Label: "按配种间隔分析", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SingleFactorAnalysisMethod_Bull), Label: "按公牛号分析", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SingleFactorAnalysisMethod_Breeding_Cycle), Label: "按配种周期分析", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SingleFactorAnalysisMethod_Week), Label: "按星期分析", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SingleFactorAnalysisMethod_Lact), Label: "按胎次分析", Disabled: true, }) return configOptions } func (s *StoreEntry) LactIntervalSymbolEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CompareSymbol_Less_Than), Label: "<", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CompareSymbol_Less_Than_Or_Equal_To), Label: "<=", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CompareSymbol_Greater_Than), Label: ">", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CompareSymbol_Greater_Than_Or_Equal_To), Label: ">=", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CompareSymbol_Equal_To), Label: "=", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CompareSymbol_Not_Equal_To), Label: "!=", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CompareSymbol_Between), Label: "区间", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CompareSymbol_Include), Label: "包含", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CompareSymbol_Not_Include), Label: "不包含", Disabled: true, }) return configOptions } func (s *StoreEntry) MultiFactorAnalysisMethodEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MultiFactorAnalysisMethod_Months), Label: "月份", Props: "months", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MultiFactorAnalysisMethod_Week), Label: "周", Props: "week", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MultiFactorAnalysisMethod_Operation), Label: "配种员", Props: "operationName", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MultiFactorAnalysisMethod_Bull), Label: "公牛", Props: "bull", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MultiFactorAnalysisMethod_Lact), Label: "胎次", Props: "lact", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MultiFactorAnalysisMethod_Mating_Times), Label: "配次", Props: "matingTimes", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.MultiFactorAnalysisMethod_Breeding_Method), Label: "配种方式", Props: "exposeEstrusType", Disabled: true, }) return configOptions } func (s *StoreEntry) SaleCowAnalysisMethodEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SaleCowAnalysisMethod_Months), Label: "月份", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.SaleCowAnalysisMethod_Dealer), Label: "经销商", Disabled: true, }) return configOptions } func (s *StoreEntry) NeckRingStatusEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.NeckRingStatus_Invalid), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.NeckRingStatus_Unbind), Label: "未绑定", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.NeckRingStatus_Bind), Label: "绑定", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.NeckRingStatus_Normal), Label: "正常", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.NeckRingStatus_Offline), Label: "在线", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.NeckRingStatus_Error), Label: "异常", Disabled: true, }) return configOptions } func (s *StoreEntry) WorkOrderSubUnitEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.WorkOrderSubscribeUnit_Person), Label: "个人", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.WorkOrderSubscribeUnit_dept), Label: "部门", Disabled: true, }) return configOptions } func (s *StoreEntry) WorkOrderPriorityEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.Priority_Low), Label: "低", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.Priority_Middle), Label: "一般", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.Priority_High), Label: "紧急", Disabled: true, }) return configOptions } func (s *StoreEntry) WorkOrderCategoryEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.WorkOrderCategory_Health), Label: "保健", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.WorkOrderCategory_Breed), Label: "繁殖", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.WorkOrderCategory_Nutrition), Label: "营养", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.WorkOrderCategory_Ordinary), Label: "日常", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.WorkOrderCategory_Other), Label: "其他", Disabled: true, }) return configOptions } func CalendarTypeEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CalendarType_Invalid), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CalendarType_Immunisation), Label: "免疫", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CalendarType_PG), Label: "同期PG", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CalendarType_RnGH), Label: "同期RnGH", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CalendarType_Pregnancy_Check), Label: "孕检", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CalendarType_Weaning), Label: "断奶", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CalendarType_Mating), Label: "配种", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CalendarType_Calving), Label: "产犊", Disabled: true, }) return configOptions } func (s *StoreEntry) AbortionReasonsEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.AbortionReasons_Invalid), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.AbortionReasons_Mechanical_Abortion), Label: "机械性流产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.AbortionReasons_Malnutrition_Abortion), Label: "营养不良性流产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.AbortionReasons_Mycotoxin_Abortion), Label: "霉菌毒素流产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.AbortionReasons_Habitual_Abortion), Label: "习惯性流产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.AbortionReasons_Brucellosis_Abortion), Label: "布病流产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.AbortionReasons_Inflammatory_Abortion), Label: "产道炎症性流产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.AbortionReasons_Heat_Stress_Abortion), Label: "热应激流产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.AbortionReasons_Infectious_Abortion), Label: "传染病性流产", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.AbortionReasons_Unknown), Label: "未知原因", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.AbortionReasons_Other), Label: "其他", Disabled: true, }) return configOptions } func (s *StoreEntry) HealthStatusEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.HealthStatus_Invalid), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.HealthStatus_Health), Label: "健康", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.HealthStatus_Disease), Label: "发病", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.HealthStatus_Treatment), Label: "治疗中", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.HealthStatus_Curable), Label: "治愈", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.HealthStatus_Out), Label: "淘汰", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.HealthStatus_Dead), Label: "死亡", Disabled: true, }) return configOptions } func (s *StoreEntry) CalvingAnalysisMethodEnumList(isAll string) []*pasturePb.ConfigOptionsList { configOptions := make([]*pasturePb.ConfigOptionsList, 0) if isAll == model.IsAllYes { configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CalvingAnalysisMethod_Invalid), Label: "全部", Disabled: true, }) } configOptions = append(configOptions, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CalvingAnalysisMethod_Months), Label: "按月份统计", Disabled: true, }, &pasturePb.ConfigOptionsList{ Value: int32(pasturePb.CalvingAnalysisMethod_CowKind), Label: "按照品种统计", Disabled: true, }) return configOptions }