|
@@ -25,27 +25,7 @@ func (s *StoreEntry) LactEnumList(userModel *model.UserModel, isAll string) []*p
|
|
|
return make([]*pasturePb.ConfigOptionsList, 0)
|
|
|
}
|
|
|
|
|
|
- return model.ConfigLactSlice(configLactList).ToPB(userModel.Language)
|
|
|
- /*
|
|
|
- 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
|
|
|
- */
|
|
|
+ return model.ConfigLactSlice(configLactList).ToPB(userModel)
|
|
|
}
|
|
|
|
|
|
func (s *StoreEntry) DiseaseAnalysisMethodEnumList(userModel *model.UserModel, isAll string) []*pasturePb.ConfigOptionsList {
|
|
@@ -65,44 +45,27 @@ func (s *StoreEntry) DiseaseAnalysisMethodEnumList(userModel *model.UserModel, i
|
|
|
return make([]*pasturePb.ConfigOptionsList, 0)
|
|
|
}
|
|
|
|
|
|
- return model.ConfigDiseaseAnalysisMethodSlice(dataList).ToPB(userModel.Language)
|
|
|
- /*
|
|
|
- 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
|
|
|
- */
|
|
|
+ return model.ConfigDiseaseAnalysisMethodSlice(dataList).ToPB(userModel)
|
|
|
}
|
|
|
|
|
|
func (s *StoreEntry) diseaseTypeEnumList(userModel *model.UserModel, isAll string) []*pasturePb.ConfigOptionsList {
|
|
|
- configDiseaseTypeList := make([]*model.ConfigDiseaseType, 0)
|
|
|
- if err := s.DB.Model(new(model.ConfigDiseaseType)).
|
|
|
- Where("pasture_id = ?", userModel.AppPasture.Id).
|
|
|
- Where("is_show = ?", pasturePb.IsShow_Ok).
|
|
|
- Find(&configDiseaseTypeList).Error; err != nil {
|
|
|
- zaplog.Error("diseaseTypeEnumList", zap.Any("Find", err))
|
|
|
+ dataList := make([]*model.ConfigDiseaseType, 0)
|
|
|
+ pref := s.DB.Model(new(model.ConfigDiseaseType)).
|
|
|
+ Where("is_show =? ", pasturePb.IsShow_Ok).
|
|
|
+ Where("pasture_id =? ", userModel.AppPasture.Id)
|
|
|
+ if isAll == model.IsAllYes {
|
|
|
+ pref = pref.Where("kind >= ?", 0)
|
|
|
+ } else {
|
|
|
+ pref = pref.Where("kind > ?", 0)
|
|
|
+ }
|
|
|
+
|
|
|
+ if err := pref.Order("kind ASC").
|
|
|
+ Find(&dataList).Error; err != nil {
|
|
|
+ zaplog.Error("DiseaseAnalysisMethodEnumList", zap.Any("err", err))
|
|
|
return make([]*pasturePb.ConfigOptionsList, 0)
|
|
|
}
|
|
|
|
|
|
- return model.ConfigDiseaseTypeSlice(configDiseaseTypeList).ToPB3(userModel.Language)
|
|
|
+ return model.ConfigDiseaseTypeSlice(dataList).ToPB3(userModel)
|
|
|
}
|
|
|
|
|
|
func (s *StoreEntry) SingleFactorAnalysisMethodEnumList(userModel *model.UserModel, isAll string) []*pasturePb.ConfigOptionsList {
|
|
@@ -122,58 +85,7 @@ func (s *StoreEntry) SingleFactorAnalysisMethodEnumList(userModel *model.UserMod
|
|
|
return make([]*pasturePb.ConfigOptionsList, 0)
|
|
|
}
|
|
|
|
|
|
- return model.ConfigSingleFactorAnalysisMethodSlice(dataList).ToPB(userModel.Language)
|
|
|
-
|
|
|
- /*
|
|
|
- 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
|
|
|
- */
|
|
|
+ return model.ConfigSingleFactorAnalysisMethodSlice(dataList).ToPB(userModel)
|
|
|
}
|
|
|
|
|
|
func (s *StoreEntry) LactIntervalSymbolEnumList(userModel *model.UserModel, isAll string) []*pasturePb.ConfigOptionsList {
|
|
@@ -193,47 +105,7 @@ func (s *StoreEntry) LactIntervalSymbolEnumList(userModel *model.UserModel, isAl
|
|
|
return make([]*pasturePb.ConfigOptionsList, 0)
|
|
|
}
|
|
|
|
|
|
- return model.ConfigLactIntervalSymbolSlice(dataList).ToPB(userModel.Language)
|
|
|
-
|
|
|
- /*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*/
|
|
|
+ return model.ConfigLactIntervalSymbolSlice(dataList).ToPB(userModel)
|
|
|
}
|
|
|
|
|
|
func (s *StoreEntry) MultiFactorAnalysisMethodEnumList(userModel *model.UserModel, isAll string) []*pasturePb.ConfigOptionsList {
|
|
@@ -253,45 +125,7 @@ func (s *StoreEntry) MultiFactorAnalysisMethodEnumList(userModel *model.UserMode
|
|
|
return make([]*pasturePb.ConfigOptionsList, 0)
|
|
|
}
|
|
|
|
|
|
- return model.ConfigMultiFactorAnalysisMethodSlice(dataList).ToPB(userModel.Language)
|
|
|
- /*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*/
|
|
|
+ return model.ConfigMultiFactorAnalysisMethodSlice(dataList).ToPB(userModel)
|
|
|
}
|
|
|
|
|
|
func (s *StoreEntry) SaleCowAnalysisMethodEnumList(userModel *model.UserModel, isAll string) []*pasturePb.ConfigOptionsList {
|
|
@@ -312,17 +146,6 @@ func (s *StoreEntry) SaleCowAnalysisMethodEnumList(userModel *model.UserModel, i
|
|
|
}
|
|
|
|
|
|
return model.ConfigSaleCowAnalysisMethodSlice(dataList).ToPB(userModel)
|
|
|
- /*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) NeckRingIsBindEnumList(userModel *model.UserModel, isAll string) []*pasturePb.ConfigOptionsList {
|
|
@@ -342,26 +165,7 @@ func (s *StoreEntry) NeckRingIsBindEnumList(userModel *model.UserModel, isAll st
|
|
|
return make([]*pasturePb.ConfigOptionsList, 0)
|
|
|
}
|
|
|
|
|
|
- return model.ConfigNeckRingIsBindSlice(dataList).ToPB(userModel.Language)
|
|
|
- /*configOptions := make([]*pasturePb.ConfigOptionsList, 0)
|
|
|
- if isAll == model.IsAllYes {
|
|
|
- configOptions = append(configOptions,
|
|
|
- &pasturePb.ConfigOptionsList{
|
|
|
- Value: int32(pasturePb.NeckRingIsBind_Invalid),
|
|
|
- Label: "全部",
|
|
|
- Disabled: true,
|
|
|
- })
|
|
|
- }
|
|
|
- configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
|
|
|
- Value: int32(pasturePb.NeckRingIsBind_Bind),
|
|
|
- Label: "已绑定",
|
|
|
- Disabled: true,
|
|
|
- }, &pasturePb.ConfigOptionsList{
|
|
|
- Value: int32(pasturePb.NeckRingIsBind_Unbind),
|
|
|
- Label: "未绑定",
|
|
|
- Disabled: true,
|
|
|
- })
|
|
|
- return configOptions*/
|
|
|
+ return model.ConfigNeckRingIsBindSlice(dataList).ToPB(userModel)
|
|
|
}
|
|
|
|
|
|
func (s *StoreEntry) NeckRingStatusEnumList(userModel *model.UserModel, isAll string) []*pasturePb.ConfigOptionsList {
|
|
@@ -381,26 +185,7 @@ func (s *StoreEntry) NeckRingStatusEnumList(userModel *model.UserModel, isAll st
|
|
|
return make([]*pasturePb.ConfigOptionsList, 0)
|
|
|
}
|
|
|
|
|
|
- return model.ConfigNeckRingStatusSlice(dataList).ToPB(userModel.Language)
|
|
|
- /*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_Normal),
|
|
|
- Label: "正常",
|
|
|
- Disabled: true,
|
|
|
- }, &pasturePb.ConfigOptionsList{
|
|
|
- Value: int32(pasturePb.NeckRingStatus_Abnormal),
|
|
|
- Label: "异常",
|
|
|
- Disabled: true,
|
|
|
- })
|
|
|
- return configOptions*/
|
|
|
+ return model.ConfigNeckRingStatusSlice(dataList).ToPB(userModel)
|
|
|
}
|
|
|
|
|
|
func (s *StoreEntry) CalendarTypeEnumList(userModel *model.UserModel, isAll string) []*pasturePb.ConfigOptionsList {
|
|
@@ -420,7 +205,7 @@ func (s *StoreEntry) CalendarTypeEnumList(userModel *model.UserModel, isAll stri
|
|
|
return make([]*pasturePb.ConfigOptionsList, 0)
|
|
|
}
|
|
|
|
|
|
- return model.ConfigCalendarTypeSlice(dataList).ToPB(userModel.Language)
|
|
|
+ return model.ConfigCalendarTypeSlice(dataList).ToPB(userModel)
|
|
|
}
|
|
|
|
|
|
func CalendarTypeEnumList(isAll string) []*pasturePb.ConfigOptionsList {
|
|
@@ -509,23 +294,5 @@ func (s *StoreEntry) CalvingAnalysisMethodEnumList(userModel *model.UserModel, i
|
|
|
return make([]*pasturePb.ConfigOptionsList, 0)
|
|
|
}
|
|
|
|
|
|
- return model.ConfigCalvingAnalysisMethodSlice(dataList).ToPB(userModel.Language)
|
|
|
- /*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*/
|
|
|
+ return model.ConfigCalvingAnalysisMethodSlice(dataList).ToPB(userModel)
|
|
|
}
|