package backend import ( "kpt-pasture/model" pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow" ) func (s *StoreEntry) DrugCategoryMaps(userModel *model.UserModel) map[pasturePb.DrugCategory_Kind]string { res := make(map[pasturePb.DrugCategory_Kind]string) for _, v := range s.DrugCategoryEnumList(userModel, "") { res[pasturePb.DrugCategory_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) DrugUsageMaps(userModel *model.UserModel) map[pasturePb.DrugUsage_Kind]string { res := make(map[pasturePb.DrugUsage_Kind]string) for _, v := range s.DrugUsageEnumList(userModel, "") { res[pasturePb.DrugUsage_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) ExposeEstrusTypeMap(userModel *model.UserModel) map[pasturePb.ExposeEstrusType_Kind]string { res := make(map[pasturePb.ExposeEstrusType_Kind]string) for _, v := range s.ExposeEstrusTypeEnumList(userModel, "") { res[pasturePb.ExposeEstrusType_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) FrozenSemenTypeMap(userModel *model.UserModel) map[pasturePb.FrozenSemenType_Kind]string { res := make(map[pasturePb.FrozenSemenType_Kind]string) for _, v := range s.FrozenSemenTypeEnumList(userModel, "") { res[pasturePb.FrozenSemenType_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) UnitMap(userModel *model.UserModel) map[pasturePb.Unit_Kind]string { res := make(map[pasturePb.Unit_Kind]string) for _, v := range s.UnitEnumList(userModel, "") { res[pasturePb.Unit_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) WeekMap(userModel *model.UserModel) map[pasturePb.Week_Kind]string { res := make(map[pasturePb.Week_Kind]string) for _, v := range s.WeekEnumList(userModel, "") { res[pasturePb.Week_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) MonthMap(userModel *model.UserModel) map[int32]string { res := make(map[int32]string) for _, v := range s.MonthEnumList(userModel, "") { res[v.Value] = v.Label } return res } func (s *StoreEntry) CowTypeMap(userModel *model.UserModel) map[pasturePb.CowType_Kind]string { res := make(map[pasturePb.CowType_Kind]string) optionName, isAll := "", "" for _, v := range s.CowTypeEnumList(userModel, optionName, isAll) { res[pasturePb.CowType_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) CowTypeMap2(userModel *model.UserModel) map[string]pasturePb.CowType_Kind { res := make(map[string]pasturePb.CowType_Kind) optionName, isAll := "", "" for _, v := range s.CowTypeEnumList(userModel, optionName, isAll) { res[v.Label] = pasturePb.CowType_Kind(v.Value) } return res } func (s *StoreEntry) CowBreedStatusMap(userModel *model.UserModel) map[pasturePb.BreedStatus_Kind]string { res := make(map[pasturePb.BreedStatus_Kind]string) for _, v := range s.BreedStatusEnumList(userModel, "") { res[pasturePb.BreedStatus_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) CowKindMap(userModel *model.UserModel) map[pasturePb.CowKind_Kind]string { res := make(map[pasturePb.CowKind_Kind]string) for _, v := range s.CowKindEnumList(userModel, "") { res[pasturePb.CowKind_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) CowKindMap2(userModel *model.UserModel) map[string]pasturePb.CowKind_Kind { res := make(map[string]pasturePb.CowKind_Kind) for _, v := range s.CowKindEnumList(userModel, "") { res[v.Label] = pasturePb.CowKind_Kind(v.Value) } return res } func (s *StoreEntry) CowSourceMap(userModel *model.UserModel) map[pasturePb.CowSource_Kind]string { res := make(map[pasturePb.CowSource_Kind]string) for _, v := range s.CowSourceEnumList(userModel, "") { res[pasturePb.CowSource_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) CowSourceMap2(userModel *model.UserModel) map[string]pasturePb.CowSource_Kind { res := make(map[string]pasturePb.CowSource_Kind) for _, v := range s.CowSourceEnumList(userModel, "") { res[v.Label] = pasturePb.CowSource_Kind(v.Value) } return res } func (s *StoreEntry) WorkOrderCategoryMap(userModel *model.UserModel) map[pasturePb.WorkOrderCategory_Kind]string { res := make(map[pasturePb.WorkOrderCategory_Kind]string) for _, v := range s.WorkOrderCategoryEnumList(userModel, "") { res[pasturePb.WorkOrderCategory_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) WorkOrderFrequencyMap(userModel *model.UserModel) map[pasturePb.WorkOrderFrequency_Kind]string { res := make(map[pasturePb.WorkOrderFrequency_Kind]string) for _, v := range s.WorkOrderFrequencyEnumList(userModel, "") { res[pasturePb.WorkOrderFrequency_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) WorkOrderSubUnitMap(userModel *model.UserModel) map[pasturePb.WorkOrderSubscribeUnit_Kind]string { res := make(map[pasturePb.WorkOrderSubscribeUnit_Kind]string) for _, v := range s.WorkOrderSubUnitEnumList(userModel, "") { res[pasturePb.WorkOrderSubscribeUnit_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) WorkOrderPriorityMap(userModel *model.UserModel) map[pasturePb.Priority_Kind]string { res := make(map[pasturePb.Priority_Kind]string) for _, v := range s.WorkOrderPriorityEnumList(userModel, "") { res[pasturePb.Priority_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) SameTimeCowTypeMap(userModel *model.UserModel) map[pasturePb.SameTimeCowType_Kind]string { res := make(map[pasturePb.SameTimeCowType_Kind]string) for _, v := range s.SameTimeCowTypeEnumList(userModel, "") { res[pasturePb.SameTimeCowType_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) CalendarTypeMap(userModel *model.UserModel) map[pasturePb.CalendarType_Kind]string { res := make(map[pasturePb.CalendarType_Kind]string) for _, v := range s.CalendarTypeEnumList(userModel, "") { res[pasturePb.CalendarType_Kind(v.Value)] = v.Label } return res } func CalendarTypeMap() map[pasturePb.CalendarType_Kind]string { res := make(map[pasturePb.CalendarType_Kind]string) for _, v := range CalendarTypeEnumList("") { res[pasturePb.CalendarType_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) AbortionReasonsMap(userModel *model.UserModel) map[pasturePb.AbortionReasons_Kind]string { res := make(map[pasturePb.AbortionReasons_Kind]string) for _, v := range s.AbortionReasonsEnumList(userModel, "") { res[pasturePb.AbortionReasons_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) PregnantCheckMethodMap(userModel *model.UserModel) map[pasturePb.PregnantCheckMethod_Kind]string { res := make(map[pasturePb.PregnantCheckMethod_Kind]string) for _, v := range s.PregnantCheckMethodEnumList(userModel, "") { res[pasturePb.PregnantCheckMethod_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) PregnantCheckResultMap(userModel *model.UserModel) map[pasturePb.PregnantCheckResult_Kind]string { res := make(map[pasturePb.PregnantCheckResult_Kind]string) for _, v := range s.PregnantCheckResultEnumList(userModel, "") { res[pasturePb.PregnantCheckResult_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) HealthStatusMap(userModel *model.UserModel) map[pasturePb.HealthStatus_Kind]string { res := make(map[pasturePb.HealthStatus_Kind]string) for _, v := range s.HealthStatusEnumList(userModel, "") { res[pasturePb.HealthStatus_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) PurposeMap(userModel *model.UserModel) map[pasturePb.Purpose_Kind]string { res := make(map[pasturePb.Purpose_Kind]string) for _, v := range s.CowPurposeList(userModel, "") { res[pasturePb.Purpose_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) PurposeMap2(userModel *model.UserModel) map[string]pasturePb.Purpose_Kind { res := make(map[string]pasturePb.Purpose_Kind) for _, v := range s.CowPurposeList(userModel, "") { res[v.Label] = pasturePb.Purpose_Kind(v.Value) } return res } func (s *StoreEntry) DiseaseTypeMap(userModel *model.UserModel) map[int32]string { res := make(map[int32]string) for _, v := range s.diseaseTypeEnumList(userModel, "") { res[v.Value] = v.Label } return res } func (s *StoreEntry) MultiFactorAnalysisMethodMap() map[pasturePb.MultiFactorAnalysisMethod_Kind]string { return map[pasturePb.MultiFactorAnalysisMethod_Kind]string{ pasturePb.MultiFactorAnalysisMethod_Months: "months", pasturePb.MultiFactorAnalysisMethod_Week: "week", pasturePb.MultiFactorAnalysisMethod_Operation: "operation_name", pasturePb.MultiFactorAnalysisMethod_Bull: "frozen_semen_number", pasturePb.MultiFactorAnalysisMethod_Lact: "lact", pasturePb.MultiFactorAnalysisMethod_Mating_Times: "mating_times", pasturePb.MultiFactorAnalysisMethod_Breeding_Method: "expose_estrus_type", } } func (s *StoreEntry) NeckRingIsBindMap(userModel *model.UserModel) map[pasturePb.NeckRingIsBind_Kind]string { res := make(map[pasturePb.NeckRingIsBind_Kind]string) for _, v := range s.NeckRingIsBindEnumList(userModel, "") { res[pasturePb.NeckRingIsBind_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) NeckRingStatusMap(userModel *model.UserModel) map[pasturePb.NeckRingStatus_Kind]string { res := make(map[pasturePb.NeckRingStatus_Kind]string) for _, v := range s.NeckRingStatusEnumList(userModel, "") { res[pasturePb.NeckRingStatus_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) SaleCowAnalysisMap(userModel *model.UserModel) map[pasturePb.SaleCowAnalysisMethod_Kind]string { res := make(map[pasturePb.SaleCowAnalysisMethod_Kind]string) for _, v := range s.SaleCowAnalysisMethodEnumList(userModel, "") { res[pasturePb.SaleCowAnalysisMethod_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) OutTypeMap(userModel *model.UserModel) map[pasturePb.OutType_Kind]string { res := make(map[pasturePb.OutType_Kind]string) for _, v := range s.OutTypeEnumList(userModel, "") { res[pasturePb.OutType_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) AuditStatusMap(userModel *model.UserModel) map[pasturePb.AuditStatus_Kind]string { res := make(map[pasturePb.AuditStatus_Kind]string) for _, v := range s.AuditStatusEnumList(userModel, "") { res[pasturePb.AuditStatus_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) AdmissionStatusMap(userModel *model.UserModel) map[pasturePb.AdmissionStatus_Kind]string { res := make(map[pasturePb.AdmissionStatus_Kind]string) for _, v := range s.AdmissionStatusEnumList(userModel, "") { res[pasturePb.AdmissionStatus_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) SameTimeTypeMap(userModel *model.UserModel) map[pasturePb.SameTimeType_Kind]string { res := make(map[pasturePb.SameTimeType_Kind]string) for _, v := range s.SameTimeTypeEnumList(userModel, "") { res[pasturePb.SameTimeType_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) EventTypeMap(userModel *model.UserModel) map[pasturePb.EventType_Kind]string { res := make(map[pasturePb.EventType_Kind]string) for _, v := range s.EventTypeEnumList(userModel, "") { res[pasturePb.EventType_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) CalvingLevelMap(userModel *model.UserModel) map[pasturePb.CalvingLevel_Kind]string { res := make(map[pasturePb.CalvingLevel_Kind]string) for _, v := range s.CalvingLevelEnumList(userModel, "") { res[pasturePb.CalvingLevel_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) DystociaReasonMap(userModel *model.UserModel) map[pasturePb.DystociaReason_Kind]string { res := make(map[pasturePb.DystociaReason_Kind]string) for _, v := range s.DystociaReasonEnumList(userModel, "") { res[pasturePb.DystociaReason_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) DeadReasonMap(userModel *model.UserModel) map[pasturePb.DeathReason_Kind]string { res := make(map[pasturePb.DeathReason_Kind]string) for _, v := range s.DeathReasonEnumList(userModel, "") { res[pasturePb.DeathReason_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) MatingResultMap(userModel *model.UserModel) map[pasturePb.MatingResult_Kind]string { res := make(map[pasturePb.MatingResult_Kind]string) for _, v := range s.MatingResultEnumList(userModel, "") { res[pasturePb.MatingResult_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) EventCategoryMap(userModel *model.UserModel) map[pasturePb.EventCategory_Kind]string { res := make(map[pasturePb.EventCategory_Kind]string) for _, v := range s.EventCategoryEnumList(userModel, "") { res[pasturePb.EventCategory_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) GroupTransferReasonMap(userModel *model.UserModel) map[int32]string { res := make(map[int32]string) for _, v := range s.TransferPenEnumList(userModel, "") { res[v.Value] = v.Label } return res } func (s *StoreEntry) BarnTypeMap(userModel *model.UserModel) map[pasturePb.PenType_Kind]string { res := make(map[pasturePb.PenType_Kind]string) for _, v := range s.BarnTypeEnumList(userModel, nil, "") { res[pasturePb.PenType_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) UnMatingReasonsMap(userModel *model.UserModel) map[pasturePb.UnMatingReasons_Kind]string { res := make(map[pasturePb.UnMatingReasons_Kind]string) for _, v := range s.UnMatingReasonsEnumList(userModel, "") { res[pasturePb.UnMatingReasons_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) ForbiddenMatingReasonsMap(userModel *model.UserModel) map[pasturePb.ForbiddenMatingReasons_Kind]string { res := make(map[pasturePb.ForbiddenMatingReasons_Kind]string) for _, v := range s.ForbiddenMatingReasonsEnumList(userModel, "") { res[pasturePb.ForbiddenMatingReasons_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) CowOutReasonsMap(userModel *model.UserModel) map[pasturePb.OutReasons_Kind]string { res := make(map[pasturePb.OutReasons_Kind]string) for _, v := range s.CowOutReasonEnumList(userModel, "") { res[pasturePb.OutReasons_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) CowDeathDestinationMap(userModel *model.UserModel) map[pasturePb.DeathDestination_Kind]string { res := make(map[pasturePb.DeathDestination_Kind]string) for _, v := range s.CowDeathDestinationList(userModel, "") { res[pasturePb.DeathDestination_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) WarningHealthLevelMap(userModel *model.UserModel) map[pasturePb.WarningHealthLevel_Kind]string { res := make(map[pasturePb.WarningHealthLevel_Kind]string) for _, v := range s.WarningHealthLevel(userModel, "") { res[pasturePb.WarningHealthLevel_Kind(v.Value)] = v.Label } return res } func (s *StoreEntry) eventCategoryMap() map[pasturePb.EventType_Kind]pasturePb.EventCategory_Kind { return map[pasturePb.EventType_Kind]pasturePb.EventCategory_Kind{ pasturePb.EventType_Enter: pasturePb.EventCategory_Base, pasturePb.EventType_Transfer_Ben: pasturePb.EventCategory_Base, pasturePb.EventType_Body_Score: pasturePb.EventCategory_Base, pasturePb.EventType_Pregnancy_Check: pasturePb.EventCategory_Base, pasturePb.EventType_Weight: pasturePb.EventCategory_Base, pasturePb.EventType_Death: pasturePb.EventCategory_Base, pasturePb.EventType_Out: pasturePb.EventCategory_Base, pasturePb.EventType_Dry_Milk: pasturePb.EventCategory_Breed, pasturePb.EventType_Estrus: pasturePb.EventCategory_Breed, pasturePb.EventType_Calving: pasturePb.EventCategory_Breed, pasturePb.EventType_Seme_Time: pasturePb.EventCategory_Breed, pasturePb.EventType_Mating: pasturePb.EventCategory_Breed, pasturePb.EventType_Birth: pasturePb.EventCategory_Breed, pasturePb.EventType_ForbiddenMating: pasturePb.EventCategory_Breed, pasturePb.EventType_UnForbiddenMating: pasturePb.EventCategory_Breed, pasturePb.EventType_Immunication: pasturePb.EventCategory_Health, pasturePb.EventType_Castrated: pasturePb.EventCategory_Health, pasturePb.EventType_Insect_Repellent: pasturePb.EventCategory_Health, pasturePb.EventType_Disease: pasturePb.EventCategory_Health, pasturePb.EventType_Weaning: pasturePb.EventCategory_Breed, pasturePb.EventType_Sale: pasturePb.EventCategory_Other, pasturePb.EventType_Abort: pasturePb.EventCategory_Other, } }