Procházet zdrojové kódy

enum: 牛群基础枚举整理

ping před 10 měsíci
rodič
revize
eeb777aefe

+ 1 - 1
go.mod

@@ -3,7 +3,7 @@ module kpt-pasture
 go 1.17
 
 require (
-	gitee.com/xuyiping_admin/go_proto v0.0.0-20240522153423-c5213c1ab719
+	gitee.com/xuyiping_admin/go_proto v0.0.0-20240523051616-68e1b54a803c
 	gitee.com/xuyiping_admin/pkg v0.0.0-20231218082641-aac597b8a015
 	github.com/dgrijalva/jwt-go v3.2.0+incompatible
 	github.com/getsentry/sentry-go v0.23.0

+ 10 - 0
go.sum

@@ -50,6 +50,16 @@ gitee.com/xuyiping_admin/go_proto v0.0.0-20240522132434-29109fbe0da6 h1:dITVurOH
 gitee.com/xuyiping_admin/go_proto v0.0.0-20240522132434-29109fbe0da6/go.mod h1:BKrFW6YLDectlQcQk3FYKBeXvjEiodAKJ5rq7O/QiPE=
 gitee.com/xuyiping_admin/go_proto v0.0.0-20240522153423-c5213c1ab719 h1:v3a2H1upuU+UNWeIsgkIHpeCkL7Xze69ZO9ldhmaBOk=
 gitee.com/xuyiping_admin/go_proto v0.0.0-20240522153423-c5213c1ab719/go.mod h1:BKrFW6YLDectlQcQk3FYKBeXvjEiodAKJ5rq7O/QiPE=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20240523021247-64be0e0ac610 h1:QJaPQlw7MXvBaxKHq+gIcFaYIYJ1/p85TvAQoBpZZ5M=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20240523021247-64be0e0ac610/go.mod h1:BKrFW6YLDectlQcQk3FYKBeXvjEiodAKJ5rq7O/QiPE=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20240523024301-0bde8a607012 h1:VCUJZkgpiu2F2fhToJxFVP8LRUFYaOZv6ux/7ENwu74=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20240523024301-0bde8a607012/go.mod h1:BKrFW6YLDectlQcQk3FYKBeXvjEiodAKJ5rq7O/QiPE=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20240523045719-55e9d14c06c7 h1:x3BNUcGCB/S39ug2wHG5WkzmRnDWuC9T2GzNg7EpBvE=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20240523045719-55e9d14c06c7/go.mod h1:BKrFW6YLDectlQcQk3FYKBeXvjEiodAKJ5rq7O/QiPE=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20240523050521-fe80bc2e6c39 h1:mAKmKfbZ3xAaJhgFgUEmqmdkA13eEEpEc54d/OTjEjA=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20240523050521-fe80bc2e6c39/go.mod h1:BKrFW6YLDectlQcQk3FYKBeXvjEiodAKJ5rq7O/QiPE=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20240523051616-68e1b54a803c h1:lrHdU6l2vlM+bz5jzYCyNwToNqXtrt8SNWer8StkMvU=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20240523051616-68e1b54a803c/go.mod h1:BKrFW6YLDectlQcQk3FYKBeXvjEiodAKJ5rq7O/QiPE=
 gitee.com/xuyiping_admin/pkg v0.0.0-20231218082641-aac597b8a015 h1:dfb5dRd57L2HKjdwLT93UFmPYFPOmEl56gtZmqcNnaE=
 gitee.com/xuyiping_admin/pkg v0.0.0-20231218082641-aac597b8a015/go.mod h1:Fk4GYI/v0IK3XFrm1Gn+VkgCz5Y7mfswD5hsTJYOG6A=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=

+ 3 - 3
model/barn.go

@@ -60,15 +60,15 @@ func (p PenSlice) ToPB(configBarnTypes []*ConfigPenType) []*pasturePb.SearchBarn
 	return res
 }
 
-func (p PenSlice) ToPB2(req []*ConfigPenType) []*pasturePb.ConfigOptionsList {
+func (p PenSlice) ToPB2(req []*pasturePb.ConfigOptionsList) []*pasturePb.ConfigOptionsList {
 	res := make([]*pasturePb.ConfigOptionsList, len(p))
 	for i, d := range p {
 		label := d.Name
 		for _, r := range req {
-			if r.Id != int64(d.PenType) {
+			if r.Value != d.PenType {
 				continue
 			}
-			label = fmt.Sprintf("%s-%s", label, r.Name)
+			label = fmt.Sprintf("%s-%s", label, r.Label)
 		}
 		res[i] = &pasturePb.ConfigOptionsList{
 			Value:    int32(d.Id),

+ 0 - 12
model/config_barn_type.go

@@ -19,18 +19,6 @@ func (c *ConfigPenType) TableName() string {
 
 type ConfigBarnTypeSlice []*ConfigPenType
 
-func (c ConfigBarnTypeSlice) ToPB2() []*pasturePb.ConfigOptionsList {
-	res := make([]*pasturePb.ConfigOptionsList, len(c))
-	for i, d := range c {
-		res[i] = &pasturePb.ConfigOptionsList{
-			Value:    int32(d.Id),
-			Label:    d.Name,
-			Disabled: true,
-		}
-	}
-	return res
-}
-
 func (c ConfigBarnTypeSlice) ToPB() []*pasturePb.SearchBaseConfigList {
 	res := make([]*pasturePb.SearchBaseConfigList, len(c))
 	for i, d := range c {

+ 0 - 12
model/config_breed_status.go

@@ -33,15 +33,3 @@ func (c ConfigBreedStatusSlice) ToPB() []*pasturePb.SearchBaseConfigList {
 	}
 	return res
 }
-
-func (c ConfigBreedStatusSlice) ToPB2() []*pasturePb.ConfigOptionsList {
-	res := make([]*pasturePb.ConfigOptionsList, len(c))
-	for i, d := range c {
-		res[i] = &pasturePb.ConfigOptionsList{
-			Value:    int32(d.Id),
-			Label:    d.Name,
-			Disabled: true,
-		}
-	}
-	return res
-}

+ 0 - 12
model/config_cow_kind.go

@@ -33,15 +33,3 @@ func (c ConfigCowKindSlice) ToPB() []*pasturePb.SearchBaseConfigList {
 	}
 	return res
 }
-
-func (c ConfigCowKindSlice) ToPB2() []*pasturePb.ConfigOptionsList {
-	res := make([]*pasturePb.ConfigOptionsList, len(c))
-	for i, d := range c {
-		res[i] = &pasturePb.ConfigOptionsList{
-			Value:    int32(d.Id),
-			Label:    d.Name,
-			Disabled: true,
-		}
-	}
-	return res
-}

+ 0 - 12
model/config_cow_source.go

@@ -33,15 +33,3 @@ func (c ConfigCowSourceSlice) ToPB() []*pasturePb.SearchBaseConfigList {
 	}
 	return res
 }
-
-func (c ConfigCowSourceSlice) ToPB2() []*pasturePb.ConfigOptionsList {
-	res := make([]*pasturePb.ConfigOptionsList, len(c))
-	for i, d := range c {
-		res[i] = &pasturePb.ConfigOptionsList{
-			Value:    int32(d.Id),
-			Label:    d.Name,
-			Disabled: true,
-		}
-	}
-	return res
-}

+ 0 - 12
model/config_cow_status.go

@@ -33,15 +33,3 @@ func (c ConfigCowStatusSlice) ToPB() []*pasturePb.SearchBaseConfigList {
 	}
 	return res
 }
-
-func (c ConfigCowStatusSlice) ToPB2() []*pasturePb.ConfigOptionsList {
-	res := make([]*pasturePb.ConfigOptionsList, len(c))
-	for i, d := range c {
-		res[i] = &pasturePb.ConfigOptionsList{
-			Value:    int32(d.Id),
-			Label:    d.Name,
-			Disabled: true,
-		}
-	}
-	return res
-}

+ 0 - 12
model/config_cow_type.go

@@ -33,15 +33,3 @@ func (c ConfigCowTypeSlice) ToPB() []*pasturePb.SearchBaseConfigList {
 	}
 	return res
 }
-
-func (c ConfigCowTypeSlice) ToPB2() []*pasturePb.ConfigOptionsList {
-	res := make([]*pasturePb.ConfigOptionsList, len(c))
-	for i, d := range c {
-		res[i] = &pasturePb.ConfigOptionsList{
-			Value:    int32(d.Id),
-			Label:    d.Name,
-			Disabled: true,
-		}
-	}
-	return res
-}

+ 0 - 12
model/config_transfer_pen_reason.go

@@ -33,15 +33,3 @@ func (c ConfigTransferPenReasonSlice) ToPB() []*pasturePb.SearchBaseConfigList {
 	}
 	return res
 }
-
-func (c ConfigTransferPenReasonSlice) ToPB2() []*pasturePb.ConfigOptionsList {
-	res := make([]*pasturePb.ConfigOptionsList, len(c))
-	for i, d := range c {
-		res[i] = &pasturePb.ConfigOptionsList{
-			Value:    int32(d.Id),
-			Label:    d.Name,
-			Disabled: true,
-		}
-	}
-	return res
-}

+ 224 - 49
module/backend/config_data.go

@@ -10,19 +10,225 @@ import (
 	pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
 )
 
-func (s *StoreEntry) BarnTypeOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error) {
-	configBarnTypeList := make([]*model.ConfigPenType, 0)
-	if err := s.DB.Table(new(model.ConfigPenType).TableName()).Find(&configBarnTypeList).Error; err != nil {
-		return nil, err
-	}
+func (s *StoreEntry) BarnTypeEnumList() []*pasturePb.ConfigOptionsList {
+	barnTypeList := make([]*pasturePb.ConfigOptionsList, 0)
+	barnTypeList = append(barnTypeList, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.PenType_Lactating_Calves),
+		Label:    "哺乳犊牛舍",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.PenType_Weaned_Calves),
+		Label:    "断奶犊牛舍",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.PenType_Youth),
+		Label:    "育成牛舍",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.PenType_Nurturing),
+		Label:    "育成牛舍",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.PenType_Lactation),
+		Label:    "泌乳牛舍",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.PenType_Peripartum),
+		Label:    "围产牛舍",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.PenType_Dry_Milking),
+		Label:    "干奶牛舍",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.PenType_Sick_Cow),
+		Label:    "病牛舍",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.PenType_Eliminate),
+		Label:    "淘汰牛舍",
+		Disabled: true,
+	})
+	return barnTypeList
+}
+func (s *StoreEntry) BreedStatusEnumList() []*pasturePb.ConfigOptionsList {
+	breedStatusList := make([]*pasturePb.ConfigOptionsList, 0)
+	breedStatusList = append(breedStatusList, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.BreedStatus_Unmarried),
+		Label:    "未配",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.BreedStatus_InCheck_Unpregnant),
+		Label:    "初检无胎",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.BreedStatus_InCheck_Pregnant),
+		Label:    "初检有胎",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.BreedStatus_Recheck_Unpregnant),
+		Label:    "复检无胎",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.BreedStatus_Recheck_Pregnant),
+		Label:    "复检有胎",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.BreedStatus_Pause_Pregnant),
+		Label:    "停配",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.BreedStatus_No_Pregnant),
+		Label:    "禁配",
+		Disabled: true,
+	})
+	return breedStatusList
+}
+
+func (s *StoreEntry) CowKindEnumList() []*pasturePb.ConfigOptionsList {
+	cowKindList := make([]*pasturePb.ConfigOptionsList, 0)
+	cowKindList = append(cowKindList, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowKind_HST),
+		Label:    "荷斯坦",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowKind_JSN),
+		Label:    "娟姗牛",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowKind_SHN),
+		Label:    "三河牛",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowKind_XJHN),
+		Label:    "新疆褐牛",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowKind_MN),
+		Label:    "牦牛",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowKind_XMTEN),
+		Label:    "西门塔尔牛",
+		Disabled: true,
+	})
+	return cowKindList
+}
+
+func (s *StoreEntry) CowSourceEnumList() []*pasturePb.ConfigOptionsList {
+	cowSourceList := make([]*pasturePb.ConfigOptionsList, 0)
+	cowSourceList = append(cowSourceList, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowSource_Calving),
+		Label:    "产犊",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowSource_Transfer_In),
+		Label:    "调入",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowSource_Buy),
+		Label:    "购买",
+		Disabled: true,
+	})
+	return cowSourceList
+}
 
+func (s *StoreEntry) CowStatusEnumList() []*pasturePb.ConfigOptionsList {
+	cowStatusList := make([]*pasturePb.ConfigOptionsList, 0)
+	cowStatusList = append(cowStatusList, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowStatus_Calving),
+		Label:    "产犊",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowStatus_Empty),
+		Label:    "空怀",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowStatus_Breeding),
+		Label:    "配种",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowStatus_Pregnant),
+		Label:    "怀孕",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowStatus_Dry_Milk),
+		Label:    "干奶",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowStatus_Peripartum),
+		Label:    "围产",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowStatus_No_Pregnant),
+		Label:    "禁配",
+		Disabled: true,
+	})
+	return cowStatusList
+}
+
+func (s *StoreEntry) CowTypeEnumList() []*pasturePb.ConfigOptionsList {
+	cowTypeList := make([]*pasturePb.ConfigOptionsList, 0)
+	cowTypeList = append(cowTypeList, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowType_Lactating_Calf),
+		Label:    "哺乳犊牛",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowType_Weaned_Calf),
+		Label:    "断奶犊牛",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowType_Youth),
+		Label:    "青年牛",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowType_Nurturing),
+		Label:    "育成牛",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowType_Lactation),
+		Label:    "泌乳牛",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.CowType_Dry_Milk),
+		Label:    "干奶牛",
+		Disabled: true,
+	})
+	return cowTypeList
+}
+
+func (s *StoreEntry) TransferPenEnumList() []*pasturePb.ConfigOptionsList {
+	transferPenList := make([]*pasturePb.ConfigOptionsList, 0)
+	transferPenList = append(transferPenList, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.TransferPenReason_Normal),
+		Label:    "正常转群",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.TransferPenReason_Feed),
+		Label:    "饲喂转群",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.TransferPenReason_Dry_Milk),
+		Label:    "干奶转群",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.TransferPenReason_Pregnant),
+		Label:    "怀孕转群",
+		Disabled: true,
+	}, &pasturePb.ConfigOptionsList{
+		Value:    int32(pasturePb.TransferPenReason_Overantibody),
+		Label:    "过抗转群",
+		Disabled: true,
+	})
+	return transferPenList
+}
+func (s *StoreEntry) BarnTypeOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error) {
 	return &pasturePb.ConfigOptionsListResponse{
 		Code:    http.StatusOK,
 		Message: "ok",
-		Data:    model.ConfigBarnTypeSlice(configBarnTypeList).ToPB2(),
+		Data:    s.BarnTypeEnumList(),
 	}, nil
 }
-
 func (s *StoreEntry) BarnListOptions(ctx context.Context, penType int) (*pasturePb.ConfigOptionsListResponse, error) {
 	penList := make([]*model.Pen, 0)
 	if err := s.DB.Table(new(model.Pen).TableName()).
@@ -32,87 +238,56 @@ func (s *StoreEntry) BarnListOptions(ctx context.Context, penType int) (*pasture
 		return nil, err
 	}
 
-	configBarnTypeList := make([]*model.ConfigPenType, 0)
-	if err := s.DB.Table(new(model.ConfigPenType).TableName()).Find(&configBarnTypeList).Error; err != nil {
-		return nil, err
-	}
-
 	return &pasturePb.ConfigOptionsListResponse{
 		Code:    http.StatusOK,
 		Message: "ok",
-		Data:    model.PenSlice(penList).ToPB2(configBarnTypeList),
+		Data:    model.PenSlice(penList).ToPB2(s.BarnTypeEnumList()),
 	}, nil
 }
-
 func (s *StoreEntry) BreedStatusOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error) {
-	configBreedStatusList := make([]*model.ConfigBreedStatus, 0)
-	if err := s.DB.Table(new(model.ConfigBreedStatus).TableName()).Find(&configBreedStatusList).Error; err != nil {
-		return nil, xxerr.WithStack(err)
-	}
 	return &pasturePb.ConfigOptionsListResponse{
 		Code:    http.StatusOK,
 		Message: "ok",
-		Data:    model.ConfigBreedStatusSlice(configBreedStatusList).ToPB2(),
+		Data:    s.BreedStatusEnumList(),
 	}, nil
 }
-
 func (s *StoreEntry) CowKindOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error) {
-	configCowKindList := make([]*model.ConfigCowKind, 0)
-	if err := s.DB.Table(new(model.ConfigCowKind).TableName()).Find(&configCowKindList).Error; err != nil {
-		return nil, xxerr.WithStack(err)
-	}
 	return &pasturePb.ConfigOptionsListResponse{
 		Code:    http.StatusOK,
 		Message: "ok",
-		Data:    model.ConfigCowKindSlice(configCowKindList).ToPB2(),
+		Data:    s.CowKindEnumList(),
 	}, nil
 }
 
 func (s *StoreEntry) CowSourceOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error) {
-	configCowSourceList := make([]*model.ConfigCowSource, 0)
-	if err := s.DB.Table(new(model.ConfigCowSource).TableName()).Find(&configCowSourceList).Error; err != nil {
-		return nil, xxerr.WithStack(err)
-	}
 	return &pasturePb.ConfigOptionsListResponse{
 		Code:    http.StatusOK,
 		Message: "ok",
-		Data:    model.ConfigCowSourceSlice(configCowSourceList).ToPB2(),
+		Data:    s.CowSourceEnumList(),
 	}, nil
 }
 
 func (s *StoreEntry) CowStatusOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error) {
-	configCowStatusList := make([]*model.ConfigCowStatus, 0)
-	if err := s.DB.Table(new(model.ConfigCowStatus).TableName()).Find(&configCowStatusList).Error; err != nil {
-		return nil, xxerr.WithStack(err)
-	}
 	return &pasturePb.ConfigOptionsListResponse{
 		Code:    http.StatusOK,
 		Message: "ok",
-		Data:    model.ConfigCowStatusSlice(configCowStatusList).ToPB2(),
+		Data:    s.CowStatusEnumList(),
 	}, nil
 }
 
 func (s *StoreEntry) CowTypeOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error) {
-	configCowTypeList := make([]*model.ConfigCowType, 0)
-	if err := s.DB.Table(new(model.ConfigCowType).TableName()).Find(&configCowTypeList).Error; err != nil {
-		return nil, xxerr.WithStack(err)
-	}
 	return &pasturePb.ConfigOptionsListResponse{
 		Code:    http.StatusOK,
 		Message: "ok",
-		Data:    model.ConfigCowTypeSlice(configCowTypeList).ToPB2(),
+		Data:    s.CowTypeEnumList(),
 	}, nil
 }
 
 func (s *StoreEntry) CowTransferPenReasonOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error) {
-	configTransferPenReasonList := make([]*model.ConfigTransferPenReason, 0)
-	if err := s.DB.Table(new(model.ConfigTransferPenReason).TableName()).Find(&configTransferPenReasonList).Error; err != nil {
-		return nil, xxerr.WithStack(err)
-	}
 	return &pasturePb.ConfigOptionsListResponse{
 		Code:    http.StatusOK,
 		Message: "ok",
-		Data:    model.ConfigTransferPenReasonSlice(configTransferPenReasonList).ToPB2(),
+		Data:    s.TransferPenEnumList(),
 	}, nil
 }
 
@@ -138,19 +313,19 @@ func (s *StoreEntry) SystemBaseConfigOptions(ctx context.Context, optionsName st
 	case "childNumber":
 		configOptions = append(configOptions,
 			&pasturePb.ConfigOptionsList{
-				Value:    1,
+				Value:    int32(pasturePb.ChildNumber_One),
 				Label:    "单胎",
 				Disabled: true,
 			}, &pasturePb.ConfigOptionsList{
-				Value:    2,
+				Value:    int32(pasturePb.ChildNumber_Two),
 				Label:    "双胎",
 				Disabled: true,
 			}, &pasturePb.ConfigOptionsList{
-				Value:    3,
+				Value:    int32(pasturePb.ChildNumber_Three),
 				Label:    "三胎",
 				Disabled: true,
 			}, &pasturePb.ConfigOptionsList{
-				Value:    4,
+				Value:    int32(pasturePb.ChildNumber_Four),
 				Label:    "四胎",
 				Disabled: true,
 			})