|
@@ -762,6 +762,23 @@ func (s *StoreEntry) FeedTemplateHistory(ctx context.Context, req *operationPb.F
|
|
|
return response, nil
|
|
|
}
|
|
|
|
|
|
+func (s *StoreEntry) BarnHistory(ctx context.Context, req *operationPb.BarnHistoryRequest) (*model.PastureBarnHistoryResponse, error) {
|
|
|
+ _, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ body := &model.PastureBarnHistoryRequest{
|
|
|
+ BarName: req.BarnName,
|
|
|
+ StartDate: req.StartTime,
|
|
|
+ EndDate: req.EndTime,
|
|
|
+ }
|
|
|
+ response := &model.PastureBarnHistoryResponse{}
|
|
|
+ if err = s.PastureHttpClient(ctx, model.UrlBarnHistory, int64(req.PastureId), body, response); err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ return response, nil
|
|
|
+}
|
|
|
+
|
|
|
func sprinkleExecTimeAnalysis(sprinkleFeedTimeList map[int32]map[int32][]int64) (int32, int32) {
|
|
|
var infoSprinkleNumber, errorSprinkleNumber int32 = 0, 0
|
|
|
if len(sprinkleFeedTimeList) <= 0 {
|