diff --git a/internal/biz/cmb.go b/internal/biz/cmb.go index b2d8931..a5edca9 100644 --- a/internal/biz/cmb.go +++ b/internal/biz/cmb.go @@ -31,7 +31,7 @@ func (v *VoucherBiz) CmbOrder(ctx context.Context, req *bo.OrderCreateReqBo) (or if order != nil { - if order.ProductNo != "001" && order.Status.IsFail() { + if order.Status.IsFail() { if err4 := v.orderRetry(ctx, order); err4 != nil { return orderNo, err4 diff --git a/internal/biz/order.go b/internal/biz/order.go index c9ef474..268a5d0 100644 --- a/internal/biz/order.go +++ b/internal/biz/order.go @@ -18,11 +18,6 @@ func (v *VoucherBiz) order(ctx context.Context, req *bo.OrderCreateReqBo, produc return nil, err } - if product.ProductNo == "001" { - // 压测商品-直接返回 - return order, nil - } - // 注册通知标签 order.MerchantNo 批次创建商户, order.BatchNo 商品批次号 if err = v.registerNotifyTag(ctx, order.MerchantNo, order.BatchNo); err != nil { return nil, err @@ -37,13 +32,6 @@ func (v *VoucherBiz) order(ctx context.Context, req *bo.OrderCreateReqBo, produc return nil, err } - // 模拟一次失败 - if err3 := v.fail(ctx, order, "mock 满足招行第一次失败,二次成功"); err3 != nil { - return nil, err3 - } - - return order, fmt.Errorf("mock 满足招行第一次失败,二次成功") - return order, v.success(ctx, order, voucherNo) } diff --git a/internal/data/repoimpl/order.go b/internal/data/repoimpl/order.go index 0a42cdb..c51e3eb 100644 --- a/internal/data/repoimpl/order.go +++ b/internal/data/repoimpl/order.go @@ -76,11 +76,6 @@ func (p *OrderRepoImpl) Create(ctx context.Context, req *bo.OrderBo) (*bo.OrderB UpdateTime: &now, } - if req.ProductNo == "001" { - info.VoucherNo = req.OrderNo - info.Status = vo.OrderStatusSuccess.GetValue() - } - db := p.DB(ctx) tx := db.Create(info) diff --git a/internal/service/cmb_order.go b/internal/service/cmb_order.go index c04690c..c4fd75e 100644 --- a/internal/service/cmb_order.go +++ b/internal/service/cmb_order.go @@ -49,9 +49,6 @@ func (c *CmbService) OrderFail(ctx context.Context, err error) (*v1.CmbReply, er func (c *CmbService) Order(ctx context.Context, request *v1.CmbRequest) (*v1.CmbReply, error) { - //ctx2, cancel := context.WithCancel(ctx) - //defer cancel() - orderNo, err := c.order(ctx, request) if err != nil {