Эх сурвалжийг харах

feed_template: 配方下发调试

Yi 1 жил өмнө
parent
commit
083a85f39f

+ 2 - 10
models/feed_template.go

@@ -3,9 +3,6 @@ package models
 import (
 	"fmt"
 	"time"
-	"tmr-watch/pkg/logger/zaplog"
-
-	"go.uber.org/zap"
 
 	operationPb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/operation"
 
@@ -48,14 +45,9 @@ func (f *FeedTemplate) TableName() string {
 	return "feedtemplet"
 }
 
-func NewFeedTemplateByGroup(req *operationPb.DistributeFeedRequest) *FeedTemplate {
-	zaplog.Info("NewFeedTemplateByGroup",
-		zap.Any("PastureId-int64", int64(req.PastureDataId)),
-		zap.Any("PastureId", req.PastureDataId),
-		zap.Any("req", req),
-	)
+func NewFeedTemplateByGroup(pastureId int64, req *operationPb.DistributeFeedRequest) *FeedTemplate {
 	res := &FeedTemplate{
-		PastureId:    int64(req.PastureId),
+		PastureId:    pastureId,
 		TCode:        req.EncodeNumber,
 		TName:        req.Name,
 		TColor:       req.Colour,

+ 1 - 1
service/group/group.go

@@ -18,7 +18,7 @@ func DistributeFeedFormulaService(req *operationPb.DistributeDataRequest) error
 	zaplog.Info("DistributeFeedFormulaService", zap.Any("request", req))
 	feedTemplateList := make([]*models.FeedTemplate, 0)
 	for _, b := range req.FeedFormulaList {
-		feedTemplateList = append(feedTemplateList, models.NewFeedTemplateByGroup(b))
+		feedTemplateList = append(feedTemplateList, models.NewFeedTemplateByGroup(int64(req.PastureId), b))
 	}
 	return module.DistributeFeedFormula(feedTemplateList)
 }