123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- 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,
- })
- 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: "月份",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.MultiFactorAnalysisMethod_Week),
- Label: "周",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.MultiFactorAnalysisMethod_Operation),
- Label: "配种员",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.MultiFactorAnalysisMethod_Bull),
- Label: "公牛",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.MultiFactorAnalysisMethod_Lact),
- Label: "胎次",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.MultiFactorAnalysisMethod_Mating_Times),
- Label: "配次",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.MultiFactorAnalysisMethod_Breeding_Method),
- Label: "配种方式",
- 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_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
- }
|