From ad380958a09b14c67128943c047a450995d3ae3d Mon Sep 17 00:00:00 2001 From: ziming Date: Fri, 1 Aug 2025 10:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/timeslicequery/query.go | 2 +- internal/biz/vo/cmb.go | 3 ++- internal/biz/vo/order_notify_event.go | 2 +- test/coupon.go | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 test/coupon.go diff --git a/internal/biz/timeslicequery/query.go b/internal/biz/timeslicequery/query.go index 30ef5c5..998046c 100644 --- a/internal/biz/timeslicequery/query.go +++ b/internal/biz/timeslicequery/query.go @@ -47,7 +47,7 @@ func (v *Query) queryExpired(ctx context.Context, order *bo.OrderBo) error { return err } - return nil // 过期不做通知 + return v.notify(ctx, order) } func (v *Query) notify(ctx context.Context, order *bo.OrderBo) error { diff --git a/internal/biz/vo/cmb.go b/internal/biz/vo/cmb.go index 7707d5d..d89d0b1 100644 --- a/internal/biz/vo/cmb.go +++ b/internal/biz/vo/cmb.go @@ -18,7 +18,8 @@ type CmbStatus string const ( CmbStatusSuccess CmbStatus = "0" // 券可用 CmbStatusUse CmbStatus = "1" // 券使用 - CmbStatusExpired CmbStatus = "2" // 券过期-待确认是否通知 + //CmbStatusExpired CmbStatus = "2" // 券过期-待确认是否通知 + CmbStatusExpired CmbStatus = "0" // 券过期-等于券没有使用 ) func (s CmbStatus) GetValue() string { diff --git a/internal/biz/vo/order_notify_event.go b/internal/biz/vo/order_notify_event.go index 84c6782..db5fb45 100644 --- a/internal/biz/vo/order_notify_event.go +++ b/internal/biz/vo/order_notify_event.go @@ -40,7 +40,7 @@ func (s OrderNotifyEvent) IsExpired() bool { } func (s OrderNotifyEvent) CanNotify() bool { - return s.IsSendDEd() || s.IsUsed() + return s.IsSendDEd() || s.IsUsed() || s.IsExpired() } var OrderNotifyEventMapCmbStatus = map[OrderNotifyEvent]CmbStatus{ diff --git a/test/coupon.go b/test/coupon.go new file mode 100644 index 0000000..56e5404 --- /dev/null +++ b/test/coupon.go @@ -0,0 +1 @@ +package test