瀏覽代碼

feed_template: 集团配方下发测试

Yi 1 年之前
父節點
當前提交
2f40863b23
共有 4 個文件被更改,包括 12 次插入2 次删除
  1. 1 1
      go.mod
  2. 2 0
      go.sum
  3. 1 1
      http/handle/group/feed_formula.go
  4. 8 0
      models/feed_template.go

+ 1 - 1
go.mod

@@ -3,7 +3,7 @@ module tmr-watch
 go 1.17
 
 require (
-	gitee.com/xuyiping_admin/go_proto v0.0.0-20231018071345-6ac61c4e4fd2
+	gitee.com/xuyiping_admin/go_proto v0.0.0-20231018084013-d0e29bb3008f
 	gitee.com/xuyiping_admin/pkg v0.0.0-20230816061144-c1f079802584
 	github.com/360EntSecGroup-Skylar/excelize v1.4.1
 	github.com/Anderson-Lu/gofasion v0.0.0-20190530065914-6a05b679ee48

+ 2 - 0
go.sum

@@ -9,6 +9,8 @@ gitee.com/xuyiping_admin/go_proto v0.0.0-20230823061528-20b02d357f02 h1:e4BzweXQ
 gitee.com/xuyiping_admin/go_proto v0.0.0-20230823061528-20b02d357f02/go.mod h1:x47UOU+lOkZnrtAENAsOGd7mZ5I8D2JRkMKMqLLRlVw=
 gitee.com/xuyiping_admin/go_proto v0.0.0-20231018071345-6ac61c4e4fd2 h1:wwzYo7WbLblOUmQr+1CsNtJ88+nydCiHTa3qlAYORWQ=
 gitee.com/xuyiping_admin/go_proto v0.0.0-20231018071345-6ac61c4e4fd2/go.mod h1:x47UOU+lOkZnrtAENAsOGd7mZ5I8D2JRkMKMqLLRlVw=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20231018084013-d0e29bb3008f h1:Nk4irm5KOfOnO1KT21/1elo3VtKNZnFGh0/4tf96cNg=
+gitee.com/xuyiping_admin/go_proto v0.0.0-20231018084013-d0e29bb3008f/go.mod h1:x47UOU+lOkZnrtAENAsOGd7mZ5I8D2JRkMKMqLLRlVw=
 gitee.com/xuyiping_admin/pkg v0.0.0-20230816061144-c1f079802584 h1:5RE5yrMMvnDITrnoX821mFl7dNYfsFA1osDobUV/TDo=
 gitee.com/xuyiping_admin/pkg v0.0.0-20230816061144-c1f079802584/go.mod h1:VQ7WztVDQRlXE1dUu/Yqo3ZdhKsfv7IGJtV+vqNqJVw=
 github.com/360EntSecGroup-Skylar/excelize v1.4.1 h1:l55mJb6rkkaUzOpSsgEeKYtS6/0gHwBYyfo5Jcjv/Ks=

+ 1 - 1
http/handle/group/feed_formula.go

@@ -26,7 +26,7 @@ func Handle404(c *gin.Context) {
 	c.String(http.StatusNotFound, "404 NotFound")
 }
 
-// DistributeFeedFormula 饲料配方下发
+// DistributeFeedFormula 接受集团饲料配方下发
 func DistributeFeedFormula(c *gin.Context) {
 	var req operationPb.DistributeDataRequest
 	if err := ginutil.BindProto(c, &req); err != nil {

+ 8 - 0
models/feed_template.go

@@ -3,6 +3,9 @@ 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"
 
@@ -46,6 +49,11 @@ func (f *FeedTemplate) TableName() string {
 }
 
 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),
+	)
 	res := &FeedTemplate{
 		PastureId:    int64(req.PastureId),
 		TCode:        req.EncodeNumber,