通知查询检索调整
This commit is contained in:
parent
87e3b7a4ca
commit
eb10f82c4c
|
|
@ -79,9 +79,9 @@ func (v *Cmb) bizContent(_ context.Context, order *bo.OrderBo, orderNotify *bo.O
|
||||||
return string(bizJsonBytes), nil
|
return string(bizJsonBytes), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *Cmb) NotifyRequest(ctx context.Context, order *bo.OrderBo, req *bo.OrderNotifyBo) (*v1.CmbRequest, error) {
|
func (v *Cmb) NotifyRequest(ctx context.Context, order *bo.OrderBo, orderNotify *bo.OrderNotifyBo) (*v1.CmbRequest, error) {
|
||||||
|
|
||||||
bizContent, err := v.bizContent(ctx, order, req)
|
bizContent, err := v.bizContent(ctx, order, orderNotify)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,18 +108,28 @@ func (v *VoucherBiz) isCanNotice(ctx context.Context) error {
|
||||||
|
|
||||||
func (v *VoucherBiz) cmbOrderNotice(ctx context.Context, order *bo.OrderBo) error {
|
func (v *VoucherBiz) cmbOrderNotice(ctx context.Context, order *bo.OrderBo) error {
|
||||||
|
|
||||||
// 批量通知不做数据存储,量可能会很大很大
|
// 批量通知不做数据存储,量会很大
|
||||||
|
|
||||||
if err := v.Query(ctx, order); err != nil {
|
status, err := v.WechatCpnRepo.Query(ctx, order)
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
event, err := order.Status.GetOrderNotifyEvent()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
req := &bo.OrderNotifyBo{
|
if order.Status == status {
|
||||||
|
log.Warnf("notice 券状态未改变:%s,忽略不处理,orderNo:%s", order.Status.GetText(), order.OrderNo)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = v.UpdateOrderStatus(ctx, order.ID, status); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
event, err := status.GetOrderNotifyEvent()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
orderNotify := &bo.OrderNotifyBo{
|
||||||
OrderNo: order.OrderNo,
|
OrderNo: order.OrderNo,
|
||||||
NotifyUrl: order.NotifyUrl,
|
NotifyUrl: order.NotifyUrl,
|
||||||
Channel: order.Channel,
|
Channel: order.Channel,
|
||||||
|
|
@ -127,7 +137,7 @@ func (v *VoucherBiz) cmbOrderNotice(ctx context.Context, order *bo.OrderBo) erro
|
||||||
Type: order.Type,
|
Type: order.Type,
|
||||||
}
|
}
|
||||||
|
|
||||||
request, err := v.Cmb.NotifyRequest(ctx, order, req)
|
request, err := v.Cmb.NotifyRequest(ctx, order, orderNotify)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -138,7 +148,7 @@ func (v *VoucherBiz) cmbOrderNotice(ctx context.Context, order *bo.OrderBo) erro
|
||||||
}
|
}
|
||||||
|
|
||||||
if reply.RespCode != vo.CmbResponseStatusSuccess.GetValue() {
|
if reply.RespCode != vo.CmbResponseStatusSuccess.GetValue() {
|
||||||
return fmt.Errorf(reply.RespMsg)
|
return errors.New(reply.RespMsg)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue