diff --git a/app/db/model/express_order.go b/app/db/model/express_order.go index 2a4899d..73d0991 100644 --- a/app/db/model/express_order.go +++ b/app/db/model/express_order.go @@ -49,5 +49,6 @@ type ExpressOrder struct { IsAgentSupplementPay int `json:"is_agent_supplement_pay" xorm:"default 0 INT(1)"` Platform int `json:"platform" xorm:"default 0 INT(1)"` Own int `json:"own" xorm:"default 0 INT(1)"` + ExpressPlatform int `json:"express_platform" xorm:"default 0 INT(1)"` NeedDeduct string `json:"need_deduct" xorm:"default 0.00000000 DECIMAL(20,8)"` } diff --git a/app/db/model/user.go b/app/db/model/user.go index d5a565f..16a28a8 100644 --- a/app/db/model/user.go +++ b/app/db/model/user.go @@ -27,4 +27,5 @@ type User struct { IsMarketer int `json:"is_marketer" xorm:"not null default 0 comment('是否市商 0否 1是') TINYINT(1)"` Zone string `json:"zone" xorm:"not null default '86' comment('区号') VARCHAR(100)"` SalePhone string `json:"sale_phone" xorm:"not null default '' comment('') VARCHAR(100)"` + IsNotUpLevel int `json:"is_not_up_level" xorm:"not null default 1 comment('()') INT(1)"` } diff --git a/app/db/offical/model/express_agent_money_flow.go b/app/db/offical/model/express_agent_money_flow.go index 2696db9..4fe477a 100644 --- a/app/db/offical/model/express_agent_money_flow.go +++ b/app/db/offical/model/express_agent_money_flow.go @@ -13,4 +13,5 @@ type ExpressAgentMoneyFlow struct { AfterAmount string `json:"after_amount" xorm:"default 0.00 DECIMAL(20,2)"` Oid string `json:"oid" xorm:"VARCHAR(255)"` Title string `json:"title" xorm:"VARCHAR(255)"` + Puid int `json:"puid" xorm:"default 0 INT(11)"` } diff --git a/consume/canal_mall_ord_for_you_mi_shang.go b/consume/canal_mall_ord_for_you_mi_shang.go index e8aab3d..25f82ec 100644 --- a/consume/canal_mall_ord_for_you_mi_shang.go +++ b/consume/canal_mall_ord_for_you_mi_shang.go @@ -89,6 +89,9 @@ func FindUser(eg *xorm.Engine, uid string, dbName string, levelList []*model2.Us if oneUser == nil { return } + if oneUser.IsNotUpLevel == 1 { + return + } levelWeight := 0 for _, v1 := range levelList { if v1.Id == oneUser.Level { diff --git a/consume/init.go b/consume/init.go index 1788ab6..b9c7ce5 100644 --- a/consume/init.go +++ b/consume/init.go @@ -79,7 +79,7 @@ func initConsumes() { //jobs[consumeMd.CanalUserVirtualCcoinFlowFunName] = CanalUserVirtualCoinFlowConsume //////////////////////////////////////// oneCircles ///////////////////////////////////////////////////// - // + //jobs[consumeMd.OneCirclesSignInGreenEnergyFunName] = OneCirclesSignInGreenEnergyConsume //jobs[consumeMd.OneCirclesStartLevelDividendFunName] = OneCirclesStartLevelDividendConsume //jobs[consumeMd.OneCirclesActivityCoinAutoExchangeGreenEnergyFunName] = OneCirclesActivityCoinAutoExchangeGreenEnergyConsume @@ -96,7 +96,7 @@ func initConsumes() { //jobs[consumeMd.ZhiosOneCirclesCoinConsumeFunName] = ZhiosOneCirclesCoinConsume //一个圈圈虚拟币变化 //////////////////////////////////////// autoRepaid ///////////////////////////////////////////////////// - //jobs[consumeMd.InstallmentPaymentAutoRepaidConsumeFunName] = InstallmentPaymentAutoRepaidConsume //分期付 - 自动扣款 + jobs[consumeMd.InstallmentPaymentAutoRepaidConsumeFunName] = InstallmentPaymentAutoRepaidConsume //分期付 - 自动扣款 ////////////////////////////////////// SuperCloudIssuance ///////////////////////////////////////////////////// jobs[consumeMd.SuperCloudIssuanceMsgCallBackFunName] = SuperCloudIssuanceMsgCallBackConsume diff --git a/consume/zhios_express_order_fail.go b/consume/zhios_express_order_fail.go index 466ec35..3c5822d 100644 --- a/consume/zhios_express_order_fail.go +++ b/consume/zhios_express_order_fail.go @@ -79,7 +79,8 @@ func handleZhiosExpressOrderFail(msg []byte) error { if ord.Status == "已退回" { return nil } - base := CommBase(mid) + ordExpressPlatform := utils.IntToStr(ord.ExpressPlatform) + base := CommBase(mid, ordExpressPlatform) if canalMsg.IsFail != "1" { //查下订单详情 param := map[string]interface{}{ "clientOrderNo": canalMsg.Oid, @@ -152,6 +153,7 @@ func agentDeduct(oid string, base map[string]string, price string) (error, int) return e.NewErr(400, "平台预存款扣除失败!"), 0 } var flow = &model.ExpressAgentMoneyFlow{ + Puid: utils.StrToInt(base["puid"]), Uid: user.Uid, Type: 0, Time: time.Now(), @@ -173,11 +175,24 @@ func AppUserListPuid(mid string) string { if appList != nil && appList.Puid > 0 { uid = utils.IntToStr(appList.Puid) } + + return uid +} +func AppUserListPuidNew(mid string, ordExpressPlatform string) string { + appList := offical.GetUserAppList(mid) + uid := "0" + if appList != nil && appList.Puid > 0 { + uid = utils.IntToStr(appList.Puid) + } + expressPlatform := offical.MasterListCfgGetOneData(uid, "express_platform_type") + if expressPlatform == "1" || ordExpressPlatform == "1" { //如果是1 走智莺官方 + uid = "0" + } return uid } -func CommBase(mid string) map[string]string { - puid := AppUserListPuid(mid) +func CommBase(mid, ordExpressPlatform string) map[string]string { + puid := AppUserListPuidNew(mid, ordExpressPlatform) key := puid + "_official_express_info" stringStr, err := cache.GetString(key) stringMap := make(map[string]string) diff --git a/consume/zhios_installment_payment_auto_repaid_consume.go b/consume/zhios_installment_payment_auto_repaid_consume.go index ab3fbd1..eb60389 100644 --- a/consume/zhios_installment_payment_auto_repaid_consume.go +++ b/consume/zhios_installment_payment_auto_repaid_consume.go @@ -1,6 +1,7 @@ package consume import ( + "applet/app/cfg" "applet/app/db" "applet/app/utils/logx" "applet/consume/md" @@ -59,7 +60,7 @@ func handleInstallmentPaymentAutoRepaidConsume(ch *rabbit.Channel, msgData []byt return err } engine := db.DBs[msg.MasterId] - + installment_payment.Init(cfg.RedisAddr) //2、调用 `DealInstallmentPaymentAutoRepaid` 制度方法进行扣款 err = installment_payment.DealInstallmentPaymentAutoRepaid(engine, ch, *msg, msg.MasterId) return nil diff --git a/go.mod b/go.mod index e3d091b..f4ae5e9 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( code.fnuoos.com/go_rely_warehouse/zyos_go_condition_statistics.git v1.1.2-0.20240607091816-3df1433a2f0d code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.0 code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 - code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git v1.9.10-0.20240621133142-77a2bc0a37a1 + code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git v1.9.10-0.20240626081400-7f66164d40c2 code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git v1.6.2-0.20231116085701-9ba6e19f877b code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git v1.1.21-0.20240611024753-7cd929a03014 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5