|
@@ -733,7 +733,30 @@ func (s *StoreEntry) FeedMixedAndTmrName(ctx context.Context, req *operationPb.M
|
|
|
},
|
|
|
}
|
|
|
response := &model.PastureCommonResponse{Data: &model.PastureCommonData{}}
|
|
|
- if err := s.PastureHttpClient(ctx, model.UrlDataByName, int64(req.PastureId), body, response); err != nil {
|
|
|
+ if err = s.PastureHttpClient(ctx, model.UrlDataByName, int64(req.PastureId), body, response); err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ return response, nil
|
|
|
+}
|
|
|
+
|
|
|
+func (s *StoreEntry) FeedTemplateHistory(ctx context.Context, req *operationPb.FeedTemplateHistoryRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ pastureId := req.PastureId
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ pastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
+ body := &model.PastureFeedTemplateHistoryRequest{
|
|
|
+ PastureId: fmt.Sprintf("%d", pastureId),
|
|
|
+ FTid: int64(req.Ftid),
|
|
|
+ StartDate: req.StartTime,
|
|
|
+ EndDate: req.EndTime,
|
|
|
+ }
|
|
|
+ response := &model.PastureCommonResponse{Data: &model.PastureCommonData{}}
|
|
|
+ if err = s.PastureHttpClient(ctx, model.UrlFeedTemplateHistory, int64(req.PastureId), body, response); err != nil {
|
|
|
return nil, xerr.WithStack(err)
|
|
|
}
|
|
|
return response, nil
|