소스 검색

Merge branch 'feature/bug-list' of xuyiping/kpt-tmr-group into develop

xuyiping 1 년 전
부모
커밋
1703fbb2db
3개의 변경된 파일24개의 추가작업 그리고 21개의 파일을 삭제
  1. 8 8
      backend/operation/feed_formula.proto
  2. 8 5
      module/backend/feed_service.go
  3. 8 8
      proto/go/backend/operation/feed_formula.pb.go

+ 8 - 8
backend/operation/feed_formula.proto

@@ -172,13 +172,13 @@ message PastureData {
 }
 }
 
 
 message MixedFeedFormulaRequest {
 message MixedFeedFormulaRequest {
-  string name = 1;
-  string colour = 2;
-  int32 cattle_category_id = 3;
-  string cattle_category_name = 4;
-  int32 formula_type_id = 5;
-  string formula_type_name = 6;
-  int32 data_source_id = 7;
-  string remarks = 8;
+  string name = 1;                          // 配方名称
+  string colour = 2;                        // 颜色
+  int32 cattle_category_id = 3;            // 分类id
+  string cattle_category_name = 4;          // 分类名称
+  int32 formula_type_id = 5;                // 配方类型id
+  string formula_type_name = 6;             // 配方类型名称
+  int32 data_source_id = 7;                 // 来源id
+  string remarks = 8;                       // 备注
   repeated AddFeedFormulaDetail feed_list = 9;
   repeated AddFeedFormulaDetail feed_list = 9;
 }
 }

+ 8 - 5
module/backend/feed_service.go

@@ -579,10 +579,16 @@ func (s *StoreEntry) EditRecodeFeedFormula(ctx context.Context, req *operationPb
 }
 }
 
 
 func (s *StoreEntry) FeedFormulaDetailList(ctx context.Context, req *operationPb.FeedFormulaDetailRequest) (*operationPb.FeedFormulaDetailResponse, error) {
 func (s *StoreEntry) FeedFormulaDetailList(ctx context.Context, req *operationPb.FeedFormulaDetailRequest) (*operationPb.FeedFormulaDetailResponse, error) {
+	res := &operationPb.FeedFormulaDetailResponse{
+		Code: http.StatusOK,
+		Msg:  "ok",
+		Data: make([]*operationPb.AddFeedFormulaDetail, 0),
+	}
 	feedFormula, err := s.SearchFeedFormulaById(ctx, int64(req.FeedFormulaId))
 	feedFormula, err := s.SearchFeedFormulaById(ctx, int64(req.FeedFormulaId))
 	if err != nil {
 	if err != nil {
 		return nil, xerr.WithStack(err)
 		return nil, xerr.WithStack(err)
 	}
 	}
+
 	feedFormulaId := feedFormula.Id
 	feedFormulaId := feedFormula.Id
 	if feedFormula.PastureDataId > 0 {
 	if feedFormula.PastureDataId > 0 {
 		feedFormulaId = feedFormula.PastureDataId
 		feedFormulaId = feedFormula.PastureDataId
@@ -593,11 +599,8 @@ func (s *StoreEntry) FeedFormulaDetailList(ctx context.Context, req *operationPb
 		return nil, xerr.WithStack(err)
 		return nil, xerr.WithStack(err)
 	}
 	}
 
 
-	return &operationPb.FeedFormulaDetailResponse{
-		Code: http.StatusOK,
-		Msg:  "ok",
-		Data: model.FeedFormulaDetailSlice(list).ToPB(),
-	}, nil
+	res.Data = model.FeedFormulaDetailSlice(list).ToPB()
+	return res, nil
 }
 }
 
 
 // FeedFormulaUsage 配方使用概况
 // FeedFormulaUsage 配方使用概况

+ 8 - 8
proto/go/backend/operation/feed_formula.pb.go

@@ -1529,14 +1529,14 @@ type MixedFeedFormulaRequest struct {
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 	unknownFields protoimpl.UnknownFields
 
 
-	Name               string                  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
-	Colour             string                  `protobuf:"bytes,2,opt,name=colour,proto3" json:"colour,omitempty"`
-	CattleCategoryId   int32                   `protobuf:"varint,3,opt,name=cattle_category_id,json=cattleCategoryId,proto3" json:"cattle_category_id,omitempty"`
-	CattleCategoryName string                  `protobuf:"bytes,4,opt,name=cattle_category_name,json=cattleCategoryName,proto3" json:"cattle_category_name,omitempty"`
-	FormulaTypeId      int32                   `protobuf:"varint,5,opt,name=formula_type_id,json=formulaTypeId,proto3" json:"formula_type_id,omitempty"`
-	FormulaTypeName    string                  `protobuf:"bytes,6,opt,name=formula_type_name,json=formulaTypeName,proto3" json:"formula_type_name,omitempty"`
-	DataSourceId       int32                   `protobuf:"varint,7,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"`
-	Remarks            string                  `protobuf:"bytes,8,opt,name=remarks,proto3" json:"remarks,omitempty"`
+	Name               string                  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                                                         // 配方名称
+	Colour             string                  `protobuf:"bytes,2,opt,name=colour,proto3" json:"colour,omitempty"`                                                     // 颜色
+	CattleCategoryId   int32                   `protobuf:"varint,3,opt,name=cattle_category_id,json=cattleCategoryId,proto3" json:"cattle_category_id,omitempty"`      // 分类id
+	CattleCategoryName string                  `protobuf:"bytes,4,opt,name=cattle_category_name,json=cattleCategoryName,proto3" json:"cattle_category_name,omitempty"` // 分类名称
+	FormulaTypeId      int32                   `protobuf:"varint,5,opt,name=formula_type_id,json=formulaTypeId,proto3" json:"formula_type_id,omitempty"`               // 配方类型id
+	FormulaTypeName    string                  `protobuf:"bytes,6,opt,name=formula_type_name,json=formulaTypeName,proto3" json:"formula_type_name,omitempty"`          // 配方类型名称
+	DataSourceId       int32                   `protobuf:"varint,7,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"`                  // 来源id
+	Remarks            string                  `protobuf:"bytes,8,opt,name=remarks,proto3" json:"remarks,omitempty"`                                                   // 备注
 	FeedList           []*AddFeedFormulaDetail `protobuf:"bytes,9,rep,name=feed_list,json=feedList,proto3" json:"feed_list,omitempty"`
 	FeedList           []*AddFeedFormulaDetail `protobuf:"bytes,9,rep,name=feed_list,json=feedList,proto3" json:"feed_list,omitempty"`
 }
 }