切换主体
This commit is contained in:
parent
cfe1973bf9
commit
8cf3c66cb3
|
|
@ -13,6 +13,10 @@ import (
|
||||||
|
|
||||||
func (this *VoucherBiz) WechatNotifyConsumer(ctx context.Context, ip string, req *bo.WechatVoucherNotifyBo) error {
|
func (this *VoucherBiz) WechatNotifyConsumer(ctx context.Context, ip string, req *bo.WechatVoucherNotifyBo) error {
|
||||||
|
|
||||||
|
if req.PlainText.StockCreatorMchid == "" || req.PlainText.StockID == "" || req.PlainText.CouponID == "" {
|
||||||
|
return fmt.Errorf("回调必要信息不能为空")
|
||||||
|
}
|
||||||
|
|
||||||
// 商品数据量较少,先查询商品是否存在,过滤多余的通知信息
|
// 商品数据量较少,先查询商品是否存在,过滤多余的通知信息
|
||||||
_, err := this.ProductRepo.GetByMchStockId(ctx, req.PlainText.StockCreatorMchid, req.PlainText.StockID)
|
_, err := this.ProductRepo.GetByMchStockId(ctx, req.PlainText.StockCreatorMchid, req.PlainText.StockID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -57,10 +61,6 @@ func (this *VoucherBiz) WechatNotifyConsumer(ctx context.Context, ip string, req
|
||||||
|
|
||||||
func (this *VoucherBiz) getOrder(ctx context.Context, req *bo.WechatVoucherNotifyBo) (*bo.OrderBo, error) {
|
func (this *VoucherBiz) getOrder(ctx context.Context, req *bo.WechatVoucherNotifyBo) (*bo.OrderBo, error) {
|
||||||
|
|
||||||
if req.PlainText.StockCreatorMchid == "" || req.PlainText.StockID == "" || req.PlainText.CouponID == "" {
|
|
||||||
return nil, fmt.Errorf("订单查询参数错误")
|
|
||||||
}
|
|
||||||
|
|
||||||
order, err := this.OrderRepo.GetByCouponId(ctx, req.PlainText.StockCreatorMchid, req.PlainText.StockID, req.PlainText.CouponID)
|
order, err := this.OrderRepo.GetByCouponId(ctx, req.PlainText.StockCreatorMchid, req.PlainText.StockID, req.PlainText.CouponID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("订单查询错误 error: %w", err)
|
return nil, fmt.Errorf("订单查询错误 error: %w", err)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue