|
@@ -57,6 +57,14 @@ func (s *StoreEntry) PastureHttpClient(ctx context.Context, apiUrl string, pastu
|
|
|
|
|
|
// SearchFormulaEstimateList 配方评估
|
|
|
func (s *StoreEntry) SearchFormulaEstimateList(ctx context.Context, req *operationPb.SearchFormulaEstimateRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
body := &model.PastureCommonRequest{
|
|
|
Name: req.ApiName,
|
|
|
Page: req.Pagination.Page,
|
|
@@ -81,6 +89,14 @@ func (s *StoreEntry) SearchFormulaEstimateList(ctx context.Context, req *operati
|
|
|
|
|
|
// SearchInventoryStatistics 库存管理-库存统计
|
|
|
func (s *StoreEntry) SearchInventoryStatistics(ctx context.Context, req *operationPb.SearchInventoryStatisticsRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
body := &model.PastureCommonRequest{
|
|
|
Name: req.ApiName,
|
|
|
Page: req.Pagination.Page,
|
|
@@ -194,6 +210,14 @@ func (s *StoreEntry) InventoryStatisticsExcelExport(ctx context.Context, req *op
|
|
|
|
|
|
// SearchUserMaterialsStatistics 库存管理-用料分析
|
|
|
func (s *StoreEntry) SearchUserMaterialsStatistics(ctx context.Context, req *operationPb.SearchUserMaterialsStatisticsRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
body := &model.PastureCommonRequest{
|
|
|
Name: req.ApiName,
|
|
|
Page: req.Pagination.Page,
|
|
@@ -299,6 +323,14 @@ func (s *StoreEntry) UserMaterialsStatisticsExcelExport(ctx context.Context, req
|
|
|
|
|
|
// SearchPriceStatistics 库存管理-价格分析
|
|
|
func (s *StoreEntry) SearchPriceStatistics(ctx context.Context, req *operationPb.SearchPriceStatisticsRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
body := &model.PastureCommonRequest{
|
|
|
Name: req.ApiName,
|
|
|
Page: req.Pagination.Page,
|
|
@@ -464,6 +496,14 @@ func FeedStatisticsConversions(req interface{}) *model.FeedStatisticsConversions
|
|
|
|
|
|
// FeedChartStatistics 饲喂效率图表分析
|
|
|
func (s *StoreEntry) FeedChartStatistics(ctx context.Context, req *operationPb.FeedChartStatisticsRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
body := &model.FeedChartParams{
|
|
|
ParamMaps: &model.ParamMaps{
|
|
|
PastureId: fmt.Sprintf("%d", req.PastureId),
|
|
@@ -485,6 +525,14 @@ func (s *StoreEntry) FeedChartStatistics(ctx context.Context, req *operationPb.F
|
|
|
|
|
|
// CowsAnalysis 饲喂效率-牛群评估
|
|
|
func (s *StoreEntry) CowsAnalysis(ctx context.Context, req *operationPb.CowsAnalysisRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
body := &model.PastureCommonRequest{
|
|
|
Name: req.ApiName,
|
|
|
Page: req.Pagination.Page,
|
|
@@ -506,6 +554,14 @@ func (s *StoreEntry) CowsAnalysis(ctx context.Context, req *operationPb.CowsAnal
|
|
|
|
|
|
// SearchAccuracyAggStatistics 准确性分析-汇总分析
|
|
|
func (s *StoreEntry) SearchAccuracyAggStatistics(ctx context.Context, req *operationPb.AccuracyAggStatisticsRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
body := &model.FeedChartParams{
|
|
|
ParamMaps: &model.AccuracyAggParams{
|
|
|
PastureId: fmt.Sprintf("%d", req.PastureId),
|
|
@@ -541,10 +597,19 @@ func (s *StoreEntry) SearchAccuracyAggStatistics(ctx context.Context, req *opera
|
|
|
|
|
|
// SearchMixFeedStatistics 准确性分析-混料统计
|
|
|
func (s *StoreEntry) SearchMixFeedStatistics(ctx context.Context, req *operationPb.MixFeedStatisticsRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
times := ""
|
|
|
if req.ClassNumber > 0 {
|
|
|
times = fmt.Sprintf("%d", req.ClassNumber)
|
|
|
}
|
|
|
+
|
|
|
body := &model.PastureCommonRequest{
|
|
|
Name: req.ApiName,
|
|
|
Page: req.Pagination.Page,
|
|
@@ -579,6 +644,14 @@ func (s *StoreEntry) SearchMixFeedStatistics(ctx context.Context, req *operation
|
|
|
|
|
|
// SearchSprinkleStatistics 准确性分析-撒料统计
|
|
|
func (s *StoreEntry) SearchSprinkleStatistics(ctx context.Context, req *operationPb.SprinkleStatisticsRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
times := ""
|
|
|
if req.ClassNumber > 0 {
|
|
|
times = fmt.Sprintf("%d", req.ClassNumber)
|
|
@@ -618,6 +691,14 @@ func (s *StoreEntry) SearchSprinkleStatistics(ctx context.Context, req *operatio
|
|
|
|
|
|
// SearchProcessAnalysis 过程分析
|
|
|
func (s *StoreEntry) SearchProcessAnalysis(ctx context.Context, req *operationPb.ProcessAnalysisRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
body := &model.PastureCommonRequest{
|
|
|
Name: req.ApiName,
|
|
|
Page: req.Pagination.Page,
|
|
@@ -652,6 +733,14 @@ func (s *StoreEntry) SearchProcessAnalysis(ctx context.Context, req *operationPb
|
|
|
|
|
|
// GetDataByName 共同接口
|
|
|
func (s *StoreEntry) GetDataByName(ctx context.Context, req *operationPb.GetDataByNameRequest) (*model.PastureCommonResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
body := &model.PastureCommonRequest{
|
|
|
Name: req.ApiName,
|
|
|
ParamMaps: &model.GetDataByNameParams{
|
|
@@ -669,6 +758,14 @@ func (s *StoreEntry) GetDataByName(ctx context.Context, req *operationPb.GetData
|
|
|
|
|
|
// GetTrainNumber 获取班次
|
|
|
func (s *StoreEntry) GetTrainNumber(ctx context.Context, req *operationPb.TrainNumberRequest) (*operationPb.TrainNumberResponse, error) {
|
|
|
+ groupPasture, err := s.GetGroupPastureListById(ctx, int64(req.PastureId))
|
|
|
+ if err != nil {
|
|
|
+ return nil, xerr.WithStack(err)
|
|
|
+ }
|
|
|
+ if groupPasture.PastureId > 0 {
|
|
|
+ req.PastureId = int32(groupPasture.PastureId)
|
|
|
+ }
|
|
|
+
|
|
|
body := &model.PastureCommonRequest{
|
|
|
Name: req.ApiName,
|
|
|
Page: req.Pagination.Page,
|