|
|
@@ -109,6 +109,7 @@ func DealInstallmentPaymentAutoRepaid(engine *xorm.Engine, args md.InstallmentPa |
|
|
|
} |
|
|
|
|
|
|
|
//3、新增`installment_payment_repaid_flow`数据 |
|
|
|
oid := zhios_order_relate_utils.OrderUUID(installmentPaymentList.Uid) |
|
|
|
installmentPaymentRepaidFlowDb := implement.NewInstallmentPaymentRepaidFlowDb(engine) |
|
|
|
_, err = installmentPaymentRepaidFlowDb.InsertInstallmentPaymentRepaidFlowBySession(session, &models.InstallmentPaymentRepaidFlow{ |
|
|
|
RecordId: installmentPaymentList.Id, |
|
|
@@ -117,6 +118,7 @@ func DealInstallmentPaymentAutoRepaid(engine *xorm.Engine, args md.InstallmentPa |
|
|
|
WhichRepaymentPeriod: installmentPaymentList.AlreadyRepaidInstallmentNums, |
|
|
|
CreateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
UpdateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
OrdId: zhios_order_relate_utils.StrToInt64(oid), |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
session.Rollback() |
|
|
@@ -138,5 +140,22 @@ func DealInstallmentPaymentAutoRepaid(engine *xorm.Engine, args md.InstallmentPa |
|
|
|
session.Rollback() |
|
|
|
return err |
|
|
|
} |
|
|
|
rewardData := md.ZhiosTaskReward{ |
|
|
|
Uid: zhios_order_relate_utils.IntToStr(installmentPaymentList.Uid), |
|
|
|
Mid: masterId, |
|
|
|
Reward: zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(installmentPaymentList.Commission)), |
|
|
|
Title: "分期付自动还款", |
|
|
|
Oid: oid, |
|
|
|
Provider: "installment_payment", |
|
|
|
} |
|
|
|
ch, err := rabbit.Cfg.Pool.GetChannel() |
|
|
|
if err != nil { |
|
|
|
return nil |
|
|
|
} |
|
|
|
defer ch.Release() |
|
|
|
err1 := ch.PublishV2(md.RelateReward, zhios_order_relate_utils.SerializeStr(rewardData), md.RelateRewardData) |
|
|
|
if err1 != nil { |
|
|
|
ch.PublishV2(md.RelateReward, zhios_order_relate_utils.SerializeStr(rewardData), md.RelateRewardData) |
|
|
|
} |
|
|
|
return |
|
|
|
} |