风险判定
This commit is contained in:
parent
6b9e51ffed
commit
fb4b094aed
|
|
@ -1,6 +1,9 @@
|
|||
package bo
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
"voucher/internal/biz/vo"
|
||||
)
|
||||
|
||||
// WechatNotifyRegisterTagBo 领域实体Bo结构,字段和模型字段保持一致
|
||||
type WechatNotifyRegisterTagBo struct {
|
||||
|
|
@ -8,7 +11,7 @@ type WechatNotifyRegisterTagBo struct {
|
|||
StockID string
|
||||
StockCreatorMchID string
|
||||
Tag string
|
||||
Status uint8
|
||||
Status vo.WechatNotifyRegisterTagStatus
|
||||
Remark string
|
||||
CreateTime *time.Time
|
||||
UpdateTime *time.Time
|
||||
|
|
|
|||
|
|
@ -106,17 +106,18 @@ func (v *VoucherBiz) registerNotifyTag(ctx context.Context, stockCreatorMchID, s
|
|||
}
|
||||
|
||||
if wechatNotifyTag != nil {
|
||||
|
||||
if wechatNotifyTag.Tag != v.bc.WechatNotifyMQ.Tag {
|
||||
return fmt.Errorf("tag不一致,请检查tag配置:%s", wechatNotifyTag.Tag)
|
||||
}
|
||||
|
||||
return v.setCache(ctx, c, wechatNotifyTag)
|
||||
}
|
||||
|
||||
wechatNotifyTag, err3 = v.createWechatNotifyRegisterTag(ctx, stockCreatorMchID, stockID)
|
||||
if err3 != nil {
|
||||
return err3
|
||||
if wechatNotifyTag.Status.IsSuccess() {
|
||||
return v.setCache(ctx, c, wechatNotifyTag)
|
||||
}
|
||||
} else {
|
||||
wechatNotifyTag, err3 = v.createWechatNotifyRegisterTag(ctx, stockCreatorMchID, stockID)
|
||||
if err3 != nil {
|
||||
return err3
|
||||
}
|
||||
}
|
||||
|
||||
if err = v.WechatCpnRepo.RegisterNotifyTag(ctx, stockID); err != nil {
|
||||
|
|
@ -150,12 +151,10 @@ func (v *VoucherBiz) setCache(ctx context.Context, c *vo.Cache, wechatNotifyTag
|
|||
}
|
||||
|
||||
func (v *VoucherBiz) ing(ctx context.Context, id uint64) error {
|
||||
|
||||
return v.OrderRepo.Ing(ctx, id)
|
||||
}
|
||||
|
||||
func (v *VoucherBiz) success(ctx context.Context, order *bo.OrderBo, voucherNo string) error {
|
||||
|
||||
return v.OrderRepo.Success(ctx, order.ID, voucherNo)
|
||||
}
|
||||
|
||||
|
|
@ -164,8 +163,8 @@ func (v *VoucherBiz) fail(ctx context.Context, order *bo.OrderBo, remark string)
|
|||
if err := v.OrderRepo.Fail(ctx, order.ID, remark); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return v.alarm(ctx, order, remark)
|
||||
return nil
|
||||
//return v.alarm(ctx, order, remark)
|
||||
}
|
||||
|
||||
func (v *VoucherBiz) alarm(ctx context.Context, order *bo.OrderBo, errMsg string) error {
|
||||
|
|
|
|||
|
|
@ -71,8 +71,7 @@ func (p *WechatNotifyRegisterTagRepoImpl) Success(ctx context.Context, id int32)
|
|||
|
||||
res := p.DB(ctx).
|
||||
Where(model.WechatNotifyRegisterTag{
|
||||
ID: id,
|
||||
Status: vo.WechatNotifyRegisterTagStatusWait.GetValue(),
|
||||
ID: id,
|
||||
}).
|
||||
Updates(model.WechatNotifyRegisterTag{
|
||||
Status: vo.WechatNotifyRegisterTagStatusSuccess.GetValue(),
|
||||
|
|
@ -99,8 +98,7 @@ func (p *WechatNotifyRegisterTagRepoImpl) Fail(ctx context.Context, id int32, re
|
|||
|
||||
res := p.DB(ctx).
|
||||
Where(model.WechatNotifyRegisterTag{
|
||||
ID: id,
|
||||
Status: vo.WechatNotifyRegisterTagStatusWait.GetValue(),
|
||||
ID: id,
|
||||
}).
|
||||
Updates(model.WechatNotifyRegisterTag{
|
||||
Status: vo.WechatNotifyRegisterTagStatusFail.GetValue(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue