db fail
This commit is contained in:
parent
e511aae2d4
commit
17e6902994
|
|
@ -143,6 +143,16 @@ func (v *VoucherBiz) CmbProductQuery(ctx context.Context, productNo string) (rep
|
||||||
reps.SaleEndTime = reps.EndTime
|
reps.SaleEndTime = reps.EndTime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if wechatResp.StartTime != nil {
|
||||||
|
s, _ := time.Parse(inputFormat, *wechatResp.StartTime)
|
||||||
|
reps.SaleStartTime = s.Format(time.DateTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
if wechatResp.StopTime != nil {
|
||||||
|
e, _ := time.Parse(inputFormat, *wechatResp.StopTime)
|
||||||
|
reps.SaleEndTime = e.Format(time.DateTime)
|
||||||
|
}
|
||||||
|
|
||||||
reps.Amount = fmt.Sprintf("%d", *wechatResp.StockUseRule.FixedNormalCoupon.CouponAmount)
|
reps.Amount = fmt.Sprintf("%d", *wechatResp.StockUseRule.FixedNormalCoupon.CouponAmount)
|
||||||
reps.MinAmount = fmt.Sprintf("%d", *wechatResp.StockUseRule.FixedNormalCoupon.TransactionMinimum)
|
reps.MinAmount = fmt.Sprintf("%d", *wechatResp.StockUseRule.FixedNormalCoupon.TransactionMinimum)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,11 @@ func (v *VoucherBiz) notice(ctx context.Context, order *bo.OrderBo) error {
|
||||||
|
|
||||||
func (v *VoucherBiz) cmbNotice(ctx context.Context, order *bo.OrderBo, orderNotify *bo.OrderNotifyBo) error {
|
func (v *VoucherBiz) cmbNotice(ctx context.Context, order *bo.OrderBo, orderNotify *bo.OrderNotifyBo) error {
|
||||||
|
|
||||||
|
if !orderNotify.Event.CanNotify() {
|
||||||
|
log.Warnf("notice 券状态:%s,忽略不通知,orderNo:%s", orderNotify.Event.GetText(), order.OrderNo)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
request, err := v.Cmb.NotifyRequest(ctx, order, orderNotify)
|
request, err := v.Cmb.NotifyRequest(ctx, order, orderNotify)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,10 @@ func (s OrderNotifyEvent) IsUsed() bool {
|
||||||
return s == OrderNotifyEventUsed
|
return s == OrderNotifyEventUsed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s OrderNotifyEvent) CanNotify() bool {
|
||||||
|
return s.IsSendDEd() || s.IsUsed()
|
||||||
|
}
|
||||||
|
|
||||||
func (s OrderNotifyEvent) IsExpired() bool {
|
func (s OrderNotifyEvent) IsExpired() bool {
|
||||||
return s == OrderNotifyEventExpired
|
return s == OrderNotifyEventExpired
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue