cmb
This commit is contained in:
parent
5256a965d7
commit
53a323cae4
|
|
@ -10,6 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (j *VoucherBiz) WechatNotifyConsumer(ctx context.Context, tag string, req *bo.WechatVoucherNotifyBo) error {
|
func (j *VoucherBiz) WechatNotifyConsumer(ctx context.Context, tag string, req *bo.WechatVoucherNotifyBo) error {
|
||||||
|
|
||||||
c := vo.WechatNotifyConsumeLockKey.BuildCache([]string{tag, req.PlainText.StockID, req.PlainText.CouponID})
|
c := vo.WechatNotifyConsumeLockKey.BuildCache([]string{tag, req.PlainText.StockID, req.PlainText.CouponID})
|
||||||
|
|
||||||
return lock.NewMutex(j.rdb.Rdb, c.TTL).Lock(ctx, c.Key, func(ctx context.Context) error {
|
return lock.NewMutex(j.rdb.Rdb, c.TTL).Lock(ctx, c.Key, func(ctx context.Context) error {
|
||||||
|
|
@ -46,6 +47,7 @@ func (j *VoucherBiz) WechatNotifyConsumer(ctx context.Context, tag string, req *
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *VoucherBiz) wechatVoucherUsed(ctx context.Context, orderWechat *bo.OrderWechatBo) error {
|
func (v *VoucherBiz) wechatVoucherUsed(ctx context.Context, orderWechat *bo.OrderWechatBo) error {
|
||||||
|
|
||||||
if orderWechat.Status.IsUse() {
|
if orderWechat.Status.IsUse() {
|
||||||
log.Warnf("券状态已是已使用,忽略不处理,orderNo:%s", orderWechat.OrderNo)
|
log.Warnf("券状态已是已使用,忽略不处理,orderNo:%s", orderWechat.OrderNo)
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -64,6 +66,7 @@ func (v *VoucherBiz) wechatVoucherUsed(ctx context.Context, orderWechat *bo.Orde
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j *VoucherBiz) wechatVoucherExpired(ctx context.Context, orderWechat *bo.OrderWechatBo) error {
|
func (j *VoucherBiz) wechatVoucherExpired(ctx context.Context, orderWechat *bo.OrderWechatBo) error {
|
||||||
|
|
||||||
if orderWechat.Status.IsExpired() {
|
if orderWechat.Status.IsExpired() {
|
||||||
log.Warnf("券状态已是已过期,忽略不处理,orderNo:%s", orderWechat.OrderNo)
|
log.Warnf("券状态已是已过期,忽略不处理,orderNo:%s", orderWechat.OrderNo)
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue