From 07bacd006bf4d827cca2d38ea039f31d21eb1498 Mon Sep 17 00:00:00 2001 From: ziming Date: Fri, 13 Mar 2026 16:05:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/repo/order.go | 4 +- internal/data/repoimpl/order.go | 72 ++++++++++++++++----------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/internal/biz/repo/order.go b/internal/biz/repo/order.go index 2da57b0..1b4a592 100644 --- a/internal/biz/repo/order.go +++ b/internal/biz/repo/order.go @@ -12,8 +12,8 @@ type OrderRepo interface { FinUsedInBatches(ctx context.Context, req *do.WechatUsedQuery, fun func(ctx context.Context, rows []*bo.OrderBo) error) error SpecifyFindInBatches(ctx context.Context, w *bo.FindInBatchesBo, fun func(ctx context.Context, rows []*bo.OrderBo) error) error FinSucByStockIdInBatches(ctx context.Context, req *do.WechatQuery, fun func(ctx context.Context, rows []*bo.OrderBo) error) error - FinFailByStockIdInBatches(ctx context.Context, batchNo string, fun func(ctx context.Context, rows []*bo.OrderBo) error) error - FindIngInBatches(ctx context.Context, fun func(ctx context.Context, rows []*bo.OrderBo) error) error + //FinFailByStockIdInBatches(ctx context.Context, batchNo string, fun func(ctx context.Context, rows []*bo.OrderBo) error) error + //FindIngInBatches(ctx context.Context, fun func(ctx context.Context, rows []*bo.OrderBo) error) error FindInBatches(ctx context.Context, w *bo.FindInBatchesUseBo, fun func(ctx context.Context, rows []*bo.OrderBo) error) error FindRetryQuery(ctx context.Context, req *do.RetryQueryNotice, fun func(ctx context.Context, rows []*bo.OrderBo) error) error GetByOutBizNo(ctx context.Context, t vo.OrderType, outBizNo string) (*bo.OrderBo, error) diff --git a/internal/data/repoimpl/order.go b/internal/data/repoimpl/order.go index 03a25c7..93fca53 100644 --- a/internal/data/repoimpl/order.go +++ b/internal/data/repoimpl/order.go @@ -145,43 +145,43 @@ func (p *OrderRepoImpl) FinUsedInBatches(ctx context.Context, req *do.WechatUsed return nil } -func (p *OrderRepoImpl) FinFailByStockIdInBatches(ctx context.Context, batchNo string, fun func(ctx context.Context, rows []*bo.OrderBo) error) error { +//func (p *OrderRepoImpl) FinFailByStockIdInBatches(ctx context.Context, batchNo string, fun func(ctx context.Context, rows []*bo.OrderBo) error) error { +// +// var results = make([]*model.Order, 0) +// +// result := p.DB(ctx). +// Where("batch_no = ?", batchNo). +// Where("`status` = ?", vo.OrderStatusFail.GetValue()). +// Order("receive_success_time asc"). // 显式清除排序,移除默认的 ORDER BY +// FindInBatches(&results, 200, func(tx *gorm.DB, batch int) error { +// return fun(ctx, p.ToBos(results)) +// }) +// +// if result.Error != nil { +// return result.Error +// } +// +// return nil +//} - var results = make([]*model.Order, 0) - - result := p.DB(ctx). - Where("batch_no = ?", batchNo). - Where("`status` = ?", vo.OrderStatusFail.GetValue()). - Order("receive_success_time asc"). // 显式清除排序,移除默认的 ORDER BY - FindInBatches(&results, 200, func(tx *gorm.DB, batch int) error { - return fun(ctx, p.ToBos(results)) - }) - - if result.Error != nil { - return result.Error - } - - return nil -} - -func (p *OrderRepoImpl) FindIngInBatches(ctx context.Context, fun func(ctx context.Context, rows []*bo.OrderBo) error) error { - - var results = make([]*model.Order, 0) - - result := p.DB(ctx). - Where("`status` = ?", vo.OrderStatusIng.GetValue()). - Limit(20). - Order("receive_success_time asc"). // 显式清除排序,移除默认的 ORDER BY - FindInBatches(&results, 10, func(tx *gorm.DB, batch int) error { - return fun(ctx, p.ToBos(results)) - }) - - if result.Error != nil { - return result.Error - } - - return nil -} +//func (p *OrderRepoImpl) FindIngInBatches(ctx context.Context, fun func(ctx context.Context, rows []*bo.OrderBo) error) error { +// +// var results = make([]*model.Order, 0) +// +// result := p.DB(ctx). +// Where("`status` = ?", vo.OrderStatusIng.GetValue()). +// Limit(20). +// Order("receive_success_time asc"). // 显式清除排序,移除默认的 ORDER BY +// FindInBatches(&results, 10, func(tx *gorm.DB, batch int) error { +// return fun(ctx, p.ToBos(results)) +// }) +// +// if result.Error != nil { +// return result.Error +// } +// +// return nil +//} func (p *OrderRepoImpl) FindInBatches(ctx context.Context, req *bo.FindInBatchesUseBo, fun func(ctx context.Context, rows []*bo.OrderBo) error) error {