This commit is contained in:
parent
07f15ce605
commit
0dd2d8d3d6
|
|
@ -7,7 +7,7 @@ type ConsumeInformation struct {
|
||||||
ConsumeTime string `json:"consume_time"`
|
ConsumeTime string `json:"consume_time"`
|
||||||
ConsumeMchid string `json:"consume_mchid"`
|
ConsumeMchid string `json:"consume_mchid"`
|
||||||
TransactionID string `json:"transaction_id"`
|
TransactionID string `json:"transaction_id"`
|
||||||
ConsumeAmount int64 `json:"consume_amount,omitempty"`
|
ConsumeAmount int64 `json:"consume_amount,omitempty"` // 核销金额,仅有当business_type=MULTIUSE时,才会返回。单位,分
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlainText 定义明文数据结构体
|
// PlainText 定义明文数据结构体
|
||||||
|
|
@ -23,6 +23,7 @@ type PlainText struct {
|
||||||
NoCash bool `json:"no_cash"`
|
NoCash bool `json:"no_cash"`
|
||||||
Singleitem bool `json:"singleitem"`
|
Singleitem bool `json:"singleitem"`
|
||||||
ConsumeInformation ConsumeInformation `json:"consume_information,omitempty"`
|
ConsumeInformation ConsumeInformation `json:"consume_information,omitempty"`
|
||||||
|
BusinessType string `json:"business_type,omitempty"` // 枚举值 MULTIUSE:消费金,仅有当business_type=MULTIUSE时,才会返回
|
||||||
}
|
}
|
||||||
|
|
||||||
type WechatVoucherNotifyBo struct {
|
type WechatVoucherNotifyBo struct {
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,7 @@ func (v *VoucherBiz) bbToWx(ctx context.Context, order *bo.OrderBo, cmbReply *v1
|
||||||
return v.KxMixRepo.Request(ctx, req.GetNotice())
|
return v.KxMixRepo.Request(ctx, req.GetNotice())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *VoucherBiz) wxToBB(ctx context.Context, order *bo.OrderBo, wxReq *bo.WechatVoucherNotifyBo) error {
|
func (v *VoucherBiz) wxToBBUse(ctx context.Context, order *bo.OrderBo, wxReq *bo.WechatVoucherNotifyBo) error {
|
||||||
|
|
||||||
req := &kog.WechatToBBRequest{
|
req := &kog.WechatToBBRequest{
|
||||||
ActivityId: order.BatchNo,
|
ActivityId: order.BatchNo,
|
||||||
|
|
|
||||||
|
|
@ -23,24 +23,22 @@ func (v *VoucherBiz) WechatNotifyConsumer(ctx context.Context, tag string, req *
|
||||||
|
|
||||||
if req.PlainText.Status.IsSended() {
|
if req.PlainText.Status.IsSended() {
|
||||||
|
|
||||||
err = v.available(ctx, order)
|
return v.available(ctx, order)
|
||||||
|
|
||||||
} else if req.PlainText.Status.IsUsed() {
|
} else if req.PlainText.Status.IsUsed() {
|
||||||
|
|
||||||
err = v.used(ctx, order)
|
if err = v.used(ctx, order); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return v.wxToBBUse(ctx, order, req)
|
||||||
|
|
||||||
} else if req.PlainText.Status.IsExpired() {
|
} else if req.PlainText.Status.IsExpired() {
|
||||||
|
|
||||||
err = v.expired(ctx, order)
|
return v.expired(ctx, order)
|
||||||
} else {
|
} else {
|
||||||
return fmt.Errorf("未知通知类型:%s", req.PlainText.Status.GetText())
|
return fmt.Errorf("未知通知类型:%s", req.PlainText.Status.GetText())
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return v.wxToBB(ctx, order, req)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue