Browse Source

feet_template: 饲喂配方同步

Yi 1 year ago
parent
commit
876ae8f251
2 changed files with 2 additions and 3 deletions
  1. 2 1
      models/feed_template.go
  2. 0 2
      module/group.go

+ 2 - 1
models/feed_template.go

@@ -73,7 +73,7 @@ func NewFeedTemplateByGroup(pastureId int64, req *operationPb.DistributeFeedRequ
 			PastureId:      pastureId,
 			FId:            int64(v.ForageId),
 			FName:          v.ForageName,
-			FWeight:        float64(v.Weight / 100),
+			FWeight:        float64(v.Weight),
 			IsLockCount:    v.IsLockCowCountRatio,
 			Sort:           v.Sort,
 			FeedGroup:      v.ForageGroupName,
@@ -83,6 +83,7 @@ func NewFeedTemplateByGroup(pastureId int64, req *operationPb.DistributeFeedRequ
 			SplitFtPreId:   0,
 			Deviation:      v.AllowError,
 			IsModify:       int32(v.IsModify),
+			IsShow:         int32(operationPb.IsShow_OK),
 		})
 	}
 	return res

+ 0 - 2
module/group.go

@@ -27,11 +27,9 @@ func DistributeFeedFormula(feedTemplateList []*models.FeedTemplate) error {
 		if len(feedTemplate.FeedFormulaDetail) <= 0 {
 			continue
 		}
-		zaplog.Info("======feedTemplate=====", zap.Any("before", feedTemplate))
 		if _, err := tx.Table(new(models.FeedTemplate)).Insert(feedTemplate); err != nil {
 			return err
 		}
-		zaplog.Info("======feedTemplate=====", zap.Any("after", feedTemplate))
 		feedFormulaDetail := make([]*models.FeedTemplateDetail, 0)
 		for _, f := range feedTemplate.FeedFormulaDetail {
 			f.FtId = feedTemplate.Id