From c70f297a3cde4ae8cfcdf353c9db22849989d25f Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 4 Dec 2024 11:13:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db/model/ord_list.go | 3 +- app/md/order.go | 1 + app/svc/svc_order_track_save_create.go | 14 +- app/svc/svc_order_track_save_create_update.go | 14 +- ...svc_order_track_save_create_update_zero.go | 160 +++--------------- app/svc/svc_order_track_save_update.go | 8 +- ...order_track_create_for_pdd_zero_consume.go | 1 + go.mod | 4 +- 8 files changed, 50 insertions(+), 155 deletions(-) diff --git a/app/db/model/ord_list.go b/app/db/model/ord_list.go index 33c788a..261850d 100644 --- a/app/db/model/ord_list.go +++ b/app/db/model/ord_list.go @@ -66,5 +66,6 @@ type OrdList struct { IsTotal int `xorm:"not null default 0 INT(1)" json:"is_total"` FreezeTime int `xorm:"not null default 0 INT(1)" json:"freeze_time"` TaskType string `xorm:"not null default '' VARCHAR(100)" json:"task_type"` - NumItemId string `xorm:"not null default '' VARCHAR(100)" json:"num_item_id"` + NumItemId int64 `xorm:"not null default '' INT(11)" json:"num_item_id"` + ShopId string `xorm:"not null default '' VARCHAR(100)" json:"shop_id"` } diff --git a/app/md/order.go b/app/md/order.go index d7a0b75..cb34a51 100644 --- a/app/md/order.go +++ b/app/md/order.go @@ -150,6 +150,7 @@ type OrderInfo struct { Pvd string ItemId string SkuId string + ShopId string ItemNum int ItemPrice float64 ItemTitle string diff --git a/app/svc/svc_order_track_save_create.go b/app/svc/svc_order_track_save_create.go index 8577e02..5647794 100644 --- a/app/svc/svc_order_track_save_create.go +++ b/app/svc/svc_order_track_save_create.go @@ -603,7 +603,7 @@ func OrderSaveCreate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, opts ParentOrdId: v.ParentOrdId, Pvd: newPvd, ItemId: v.ItemId, - NumItemId: v.SkuId, + NumItemId: utils.StrToInt64(v.SkuId), ItemNum: v.ItemNum, ItemPrice: v.ItemPrice, PaidPrice: v.PaidPrice, @@ -757,7 +757,7 @@ func OrderSaveCreate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, opts } arg := md.ZhiosOrderFree{ ItemId: newOrd.ItemId, - SkuId: newOrd.NumItemId, + SkuId: utils.Int64ToStr(newOrd.NumItemId), OptPvd: newPvd, OrderType: utils.IntToStr(freeOrderType), Pid: v.Pid, @@ -865,7 +865,7 @@ func orderFourFreeCheck(eg *xorm.Engine, v *md.OrderInfo, oid int64, uid int, is logx.Warn(err) return nil } - if strings.Contains(v.Pid, "fourFree_") { + if strings.Contains(v.Pid, "fourf_") { mt, err := db.FourFreePriceTypeByID(eg, m.PriceType) if err != nil || mt == nil { @@ -874,7 +874,7 @@ func orderFourFreeCheck(eg *xorm.Engine, v *md.OrderInfo, oid int64, uid int, is } // 查找用户剩余的免单资格数 profile, err := db.UserThirdPartyFindByID(eg, uid) - if err != nil || profile == nil { + if err != nil { logx.Warn(err) return nil } @@ -882,8 +882,8 @@ func orderFourFreeCheck(eg *xorm.Engine, v *md.OrderInfo, oid int64, uid int, is if isNeedReduct == 1 { if mt.NeedUseQuan == 1 { // 更新剩余次数 - if mt.NeedQuan > profile.FourFreeRemainTime { - return m + if profile == nil || mt.NeedQuan > profile.FourFreeRemainTime { + return nil } profile.FourFreeRemainTime = profile.FourFreeRemainTime - mt.NeedQuan _, err = db.UserThirdPartyUpdate(eg, profile.Uid, profile, "four_free_remain_time") @@ -904,7 +904,7 @@ func orderFourFreeCheck(eg *xorm.Engine, v *md.OrderInfo, oid int64, uid int, is }) } var tmp model.FourNewcomersFreeStock - eg.Where("lid=? and uid=? and is_buy=0 and is_back=0", m.Id, profile.Uid).Get(&tmp) + eg.Where("lid=? and uid=? and is_buy=0 and is_back=0 and gid=?", m.Id, uid, v.ItemId).Get(&tmp) if tmp.Id == 0 { return nil } diff --git a/app/svc/svc_order_track_save_create_update.go b/app/svc/svc_order_track_save_create_update.go index 3e1fa10..08d8755 100644 --- a/app/svc/svc_order_track_save_create_update.go +++ b/app/svc/svc_order_track_save_create_update.go @@ -236,7 +236,7 @@ func OrderSaveCreateUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, NotSettleDeduct(eg, &v, dbName) } if v.State != 4 && v.PriceType > 0 { - m, _ := db.FreeProductByID(eg, v.ItemId, v.NumItemId, v.Pvd) + m, _ := db.FreeProductByID(eg, v.ItemId, utils.Int64ToStr(v.NumItemId), v.Pvd) //直接退回账号了 定制 storeOrder := db.GuideStoreOrder(eg, v.OrdId) if m != nil { @@ -265,7 +265,7 @@ func OrderSaveCreateUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, } } if v.State != 4 && v.SecondPriceType > 0 { - m, _ := db.SecondFreeProductByID(eg, v.ItemId, v.NumItemId, v.Pvd) + m, _ := db.SecondFreeProductByID(eg, v.ItemId, utils.Int64ToStr(v.NumItemId), v.Pvd) if m != nil { m.Stock++ m.Sale-- @@ -276,7 +276,7 @@ func OrderSaveCreateUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, } } if v.State != 4 && v.FourPriceType > 0 { - m, _ := db.FourFreeProductByID(eg, v.ItemId, v.NumItemId, v.Pvd) + m, _ := db.FourFreeProductByID(eg, v.ItemId, utils.Int64ToStr(v.NumItemId), v.Pvd) if m != nil { m.Stock++ m.Sale-- @@ -287,7 +287,7 @@ func OrderSaveCreateUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, } } if v.State == 4 && v.PriceType > 0 { - m, _ := db.FreeProductByID(eg, v.ItemId, v.NumItemId, v.Pvd) + m, _ := db.FreeProductByID(eg, v.ItemId, utils.Int64ToStr(v.NumItemId), v.Pvd) //直接退回账号了 定制 storeOrder := db.GuideStoreOrder(eg, v.OrdId) if m != nil { @@ -310,7 +310,7 @@ func OrderSaveCreateUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, } if v.State == 4 && v.ThirdPriceType > 0 { - m, _ := db.MoreFreeProductByID(eg, v.ItemId, v.NumItemId, v.Pvd) + m, _ := db.MoreFreeProductByID(eg, v.ItemId, utils.Int64ToStr(v.NumItemId), v.Pvd) //直接退回账号了 定制 storeOrder := db.GuideStoreOrder(eg, v.OrdId) if m != nil { @@ -943,7 +943,7 @@ func OrderSaveCreateUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, newOrd := &model.OrdList{ ServiceUid: utils.StrToInt(ServiceUid), WaitSettleAt: int(v.WaitSettleAt), - NumItemId: v.SkuId, + NumItemId: utils.StrToInt64(v.SkuId), TaskType: v.TaskType, OrderFormType: orderFormType, OrdId: oid, @@ -1106,7 +1106,7 @@ func OrderSaveCreateUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, } arg := md.ZhiosOrderFree{ ItemId: newOrd.ItemId, - SkuId: newOrd.NumItemId, + SkuId: utils.Int64ToStr(newOrd.NumItemId), OptPvd: newPvd, OrderType: utils.IntToStr(freeOrderType), Pid: v.Pid, diff --git a/app/svc/svc_order_track_save_create_update_zero.go b/app/svc/svc_order_track_save_create_update_zero.go index a0b06bd..7003b38 100644 --- a/app/svc/svc_order_track_save_create_update_zero.go +++ b/app/svc/svc_order_track_save_create_update_zero.go @@ -1,12 +1,8 @@ package svc import ( - "applet/app/cfg" "applet/app/utils/cache" - md3 "code.fnuoos.com/go_rely_warehouse/zyos_go_day_luck_draw.git/md" - "code.fnuoos.com/go_rely_warehouse/zyos_go_day_luck_draw.git/svc" "code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit" - "code.fnuoos.com/go_rely_warehouse/zyos_go_o2o_business.git/o2o" "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/lib/comm_plan" "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/implement" "fmt" @@ -103,6 +99,9 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI if pvd == md.PVD_WPHUNIONOWN { //判断下 pvd = md.PVD_VIP } + if pvd == "pdd_union_own_zero" { //判断下 + pvd = md.PVD_PDD + } pidToUser := map[string]*md.UserPid{} for _, vv := range userInfo { if pvd == md.PVD_TB { @@ -225,10 +224,10 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI NotSettleDeduct(eg, &v, dbName) } if v.State != 4 && v.FourPriceType > 0 { - m, _ := db.FourFreeProductByID(eg, v.ItemId, v.NumItemId, v.Pvd) + m, _ := db.FourFreeProductByID(eg, v.ItemId, utils.Int64ToStr(v.NumItemId), v.Pvd) if m != nil { var tmp model.FourNewcomersFreeStock - eg.Where("lid=? and uid=? and is_buy=1 and is_back=0", m.Id, v.Uid).Get(&tmp) + eg.Where("lid=? and uid=? and is_buy=1 and is_back=0 and gid=?", m.Id, v.Uid, v.ItemId).Get(&tmp) if tmp.Id > 0 { tmp.IsBuy = 0 eg.Where("id=?", tmp.Id).Cols("is_buy").Update(&tmp) @@ -242,7 +241,8 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI } } } - + v.State = ords[v.PvdOid].State + _ = db.DbsOrderUpdate(eg, v.OrdId, &v) } if ords[v.PvdOid].State == 3 && utils.InArr(utils.IntToStr(v.State), []string{"3", "4", "5"}) == false && v.PvdSettleAt > 0 { v.State = 3 @@ -410,7 +410,7 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI if pvd == "hw_movie" { newPvd = "cinema" } - if pvd == md.PVD_PDDBYCREATETIME || pvd == md.PVD_PDDBYAGOTIME || pvd == md.PVD_PDDBYSTATUS || pvd == md.PVD_PDDBYSTATUSSUCCESS || pvd == md.PVD_PDDBYSTATUSFAIL { //判断下拼多多 + if pvd == "pdd_union_own_zero" || pvd == md.PVD_PDDBYCREATETIME || pvd == md.PVD_PDDBYAGOTIME || pvd == md.PVD_PDDBYSTATUS || pvd == md.PVD_PDDBYSTATUSSUCCESS || pvd == md.PVD_PDDBYSTATUSFAIL { //判断下拼多多 newPvd = md.PVD_PDD } if pvd == md.PVD_JDUNIONOWN || pvd == md.PVD_JDUNIONOWNUPDATE || pvd == md.PVD_JDBYCREATETIME || pvd == md.PVD_JDBYSUCCESS || pvd == md.PVD_JDFAILBYCREATETIME || pvd == md.PVD_JDBYSTATUS { //判断下京东 @@ -453,7 +453,7 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI optPvd = md.PVD_KUAISHOULIVE } } - if !strings.Contains(v.Pid, "fourFree") && !strings.Contains(v.Pid, "moreFree") && !strings.Contains(v.Pid, "shareSeFree") && !strings.Contains(v.Pid, "seFree") && !strings.Contains(v.Pid, "cloud") && !strings.Contains(v.Pid, "share") && !strings.Contains(v.Pid, "self") && !strings.Contains(v.Pid, "free") && !strings.Contains(v.Pid, "actself") && !strings.Contains(v.Pid, "wechatactself") && !strings.Contains(v.Pid, "wechatactselfnew") && !strings.Contains(v.Pid, "wechatactshare") { + if !strings.Contains(v.Pid, "fourf") && !strings.Contains(v.Pid, "moreFree") && !strings.Contains(v.Pid, "shareSeFree") && !strings.Contains(v.Pid, "seFree") && !strings.Contains(v.Pid, "cloud") && !strings.Contains(v.Pid, "share") && !strings.Contains(v.Pid, "self") && !strings.Contains(v.Pid, "free") && !strings.Contains(v.Pid, "actself") && !strings.Contains(v.Pid, "wechatactself") && !strings.Contains(v.Pid, "wechatactselfnew") && !strings.Contains(v.Pid, "wechatactshare") { continue } var oid int64 @@ -585,7 +585,7 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI if pvd == "hw_movie" { newPvd = "cinema" } - if pvd == md.PVD_PDDBYCREATETIME || pvd == md.PVD_PDDBYAGOTIME || pvd == md.PVD_PDDBYSTATUS || pvd == md.PVD_PDDBYSTATUSSUCCESS || pvd == md.PVD_PDDBYSTATUSFAIL { //判断下拼多多 + if pvd == "pdd_union_own_zero" || pvd == md.PVD_PDDBYCREATETIME || pvd == md.PVD_PDDBYAGOTIME || pvd == md.PVD_PDDBYSTATUS || pvd == md.PVD_PDDBYSTATUSSUCCESS || pvd == md.PVD_PDDBYSTATUSFAIL { //判断下拼多多 newPvd = md.PVD_PDD } if utils.InArr(pvd, []string{"csjp_create", "own_csjp", "own_csjp_activity"}) { @@ -618,20 +618,12 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI } optPvd := newPvd opt := opts[newPvd] + if opt == nil { + continue + } if v.Pvd == md.PVD_JDOwn && (opt == nil || (opt != nil && opt.PlanCommissionId == 0)) { opt = opts[md.PVD_JD] } - //判断是否加油 - if newPvd == "oil" { - var ok = true - optPvd = "oilstation" - opt, ok = opts["oilstation"] - if ok == false { - continue - } - } else if opt == nil { - continue - } if (pvd == "tikTok" || pvd == "csjp") && v.IsTikTokTeamOrder == 1 && opts["tikTokTeam"] != nil && opts["tikTokTeam"].PlanCommissionId > 0 { opt = opts["tikTokTeam"] } @@ -641,7 +633,7 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI priceType := 0 secondPriceType := 0 fourPriceType := 0 - if !strings.Contains(v.Pid, "fourFree") && !strings.Contains(v.Pid, "moreFree") && !strings.Contains(v.Pid, "shareSeFree") && !strings.Contains(v.Pid, "seFree") && !strings.Contains(v.Pid, "cloud") && !strings.Contains(v.Pid, "share") && !strings.Contains(v.Pid, "self") && !strings.Contains(v.Pid, "free") && !strings.Contains(v.Pid, "actself") && !strings.Contains(v.Pid, "wechatactself") && !strings.Contains(v.Pid, "wechatactselfnew") && !strings.Contains(v.Pid, "wechatactshare") { + if !strings.Contains(v.Pid, "fourf") && !strings.Contains(v.Pid, "moreFree") && !strings.Contains(v.Pid, "shareSeFree") && !strings.Contains(v.Pid, "seFree") && !strings.Contains(v.Pid, "cloud") && !strings.Contains(v.Pid, "share") && !strings.Contains(v.Pid, "self") && !strings.Contains(v.Pid, "free") && !strings.Contains(v.Pid, "actself") && !strings.Contains(v.Pid, "wechatactself") && !strings.Contains(v.Pid, "wechatactselfnew") && !strings.Contains(v.Pid, "wechatactshare") { continue } var oid = v.Oid @@ -653,10 +645,14 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI if v.OrderType == 15 { v.OrderType = md.OrderTypeFree } - freeOrderType := v.OrderType + returnMoney := "0" freezeTime := "96" - if v.OrderType == 20 { + PlanCommissionId := 0 + if v.State == 4 { + state = 4 + } + if v.OrderType == 20 && v.State != 4 { if user == nil || user.Uid == 0 { //判断免单的如果没有用户不跟这个订单 continue } @@ -670,6 +666,9 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI if freeOrder.IsShow == 0 || utils.StrToFloat64(freeOrder.CheckPrice) != v.PaidPrice { v.State = 4 } + if opt != nil { + PlanCommissionId = opt.PlanCommissionId + } returnMoney = freeOrder.ReturnMoney if gjson.Get(freeOrder.NewData, "freeze_time").String() != "" { freezeTime = gjson.Get(freeOrder.NewData, "freeze_time").String() @@ -693,7 +692,6 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI if user != nil { user.OwnbuyReturnType = ownbuyReturnType //是否有自购奖励 uid = user.Uid - userLv := user.Lv fmt.Println(optPvd) if returnMoneyType == "0" { @@ -719,26 +717,6 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI } fmt.Println(returnProfit) - //判断下这个等级有么有设置 - if opt.UserRate != nil { - for k, item := range opt.UserRate { - if k == 0 { - selfRate = item.SelfRate - subsidyRate = item.SubsidyShareRate - if v.OrderType == 0 { - subsidyRate = item.SubsidySelfRate - } - } - if k == userLv { - selfRate = item.SelfRate - selfRate = item.SelfRate - subsidyRate = item.SubsidyShareRate - if v.OrderType == 0 { - subsidyRate = item.SubsidySelfRate - } - } - } - } } if v.OrderType == 20 || v.OrderType == 15 || v.OrderType == 11 || v.OrderType == md.OrderTypeFree || v.OrderType == md.OrderTypeWechatActSelf || v.OrderType == md.OrderTypeWechatActSelfNew || v.OrderType == md.OrderTypeActSelf { @@ -773,7 +751,8 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI OldState: state, ServiceUid: utils.StrToInt(ServiceUid), WaitSettleAt: int(v.WaitSettleAt), - NumItemId: v.SkuId, + NumItemId: utils.StrToInt64(v.SkuId), + ShopId: v.ShopId, TaskType: v.TaskType, OrderFormType: orderFormType, OrdId: oid, @@ -795,10 +774,8 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI UserReturnMoney: returnProfit, UserCommissionRate: selfRate, PvdCommission: pvdFee, - PvdCommissionRate: opt.PvdRate, SysCommission: sysFee, - SysCommissionRate: opt.SysRate, - PlanCommissionId: opt.PlanCommissionId, + PlanCommissionId: PlanCommissionId, Reason: v.Reason, State: v.State, CreateAt: int(v.StartTime), @@ -868,91 +845,6 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI } } AcquisitionHookFirstOrder(eg, dbName, newOrd) - if uid > 0 { - //商家分佣 - args := map[string]string{ - "commission": utils.Float64ToStr(utils.FloatFormat(allCommission, 6)), // 总佣金 - "bili": utils.Float64ToStrByPrec(opt.MerchantRate, 4), // 抽成 除以100之后的 - "uid": utils.IntToStr(uid), // 用户id - "oid": utils.Int64ToStr(oid), // 订单号 - "pvd": newPvd, // 渠道 - } - o2o.AddStoreCommission(eg, args) - //写入区域代理订单 - var req = &md.InsertRegionalAgentOrdBelongData{ - Uid: uid, - Pvd: md.PVD_GUIDE, - CommPvd: md.PVD_COMMON, - Commission: utils.Float64ToStr(utils.FloatFormat(allCommission, 6)), - OrderId: oid, - RegionRate: opt.RegionRate, - GlobalRate: opt.GlobalRate, - RegionSubRate: opt.RegionSubRate, - - Status: "0", - } - //if opt.Mode == "lv_ds_check" && lvUser != nil { - // req.Commission = utils.Float64ToStrByPrec(lvUser.MinProfit, 8) - //} - go SaveOrderByCommApi(eg, dbName, req) - commCheckCoupon(eg, uid, v.ItemId, 0, 1, newOrd.Pvd, utils.Int64ToStr(v.Oid)) //导购的判断 - - if v.State != 4 { - //加油扣除优惠券额度 查询优惠券使用记录 - if v.Pvd == md.PVD_OILSTATION { - profits := v.CostPrice - v.PaidPrice - profits = utils.FloatFormat(profits, 2) - if profits > 0 { - bools := ReduceCoupon(eg, dbName, utils.Float64ToStr(profits), uid, v.ItemId, md.PVD_OILSTATION, "OIL", newOrd.CreateAt, v.ItemTitle, utils.Int64ToStr(v.Oid)) - //加入公告栏明细 - if bools == 1 { - AddPlacardRecord(eg, uid, "", "", md.PVD_OILSTATION, utils.Float64ToStr(profits), "") - } - } - } else { - commCheckCoupon(eg, uid, v.ItemId, 0, 1, newOrd.Pvd, utils.Int64ToStr(v.Oid)) //导购的判断 - } - //定制 抽奖加入付款订单 - req := md3.DayLuckDrawOrderJackpotReq{ - Uid: utils.IntToStr(uid), - Oid: utils.Int64ToStr(newOrd.OrdId), - Pvd: newOrd.Pvd, - Amount: utils.Float64ToStrByPrec(newOrd.PaidPrice, 7), - Commission: utils.Float64ToStrByPrec(newOrd.BenefitAll, 7), - } - svc.AddOrderJackpot(eg, req) - if cfg.Prd { - CheckValid(eg, dbName, uid, 1, ch) - } - } - - } - if freeOrderType == 13 || freeOrderType == md.OrderTypeFree || freeOrderType == md.OrderTypeTljFree || freeOrderType == md.OrderTypeTljRelationFree { - mutexKey := fmt.Sprintf("%s:all_order_to_store:%s:pvd:%s", dbName, v.PvdOid, v.Pvd) - available, err := cache.Do("SET", mutexKey, 1, "EX", 5, "NX") - if err != nil { - continue - } - if available != "OK" { - continue - } - arg := md.ZhiosOrderFree{ - ItemId: newOrd.ItemId, - SkuId: newOrd.NumItemId, - OptPvd: newPvd, - OrderType: utils.IntToStr(freeOrderType), - Pid: v.Pid, - Uid: utils.IntToStr(newOrd.Uid), - Mid: dbName, - Oid: utils.Int64ToStr(newOrd.OrdId), - } - if cfg.Prd { - ch.Publish(md.OrderFree, utils.SerializeStr(arg), md.OrderFreeRoutKeyForOrder) - - } else { - ch.Publish(md.OrderFree, utils.SerializeStr(arg), md.OrderFreeRoutKeyForOrderdev) - } - } } return nil } diff --git a/app/svc/svc_order_track_save_update.go b/app/svc/svc_order_track_save_update.go index a0f791b..767b067 100644 --- a/app/svc/svc_order_track_save_update.go +++ b/app/svc/svc_order_track_save_update.go @@ -221,7 +221,7 @@ func OrderSaveUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, opts NotSettleDeduct(eg, &v, dbName) } if v.State != 4 && v.PriceType > 0 { - m, _ := db.FreeProductByID(eg, v.ItemId, v.NumItemId, v.Pvd) + m, _ := db.FreeProductByID(eg, v.ItemId, utils.Int64ToStr(v.NumItemId), v.Pvd) //直接退回账号了 定制 storeOrder := db.GuideStoreOrder(eg, v.OrdId) if m != nil { @@ -250,7 +250,7 @@ func OrderSaveUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, opts } } if v.State != 4 && v.SecondPriceType > 0 { - m, _ := db.SecondFreeProductByID(eg, v.ItemId, v.NumItemId, v.Pvd) + m, _ := db.SecondFreeProductByID(eg, v.ItemId, utils.Int64ToStr(v.NumItemId), v.Pvd) if m != nil { m.Stock++ m.Sale-- @@ -261,7 +261,7 @@ func OrderSaveUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, opts } } if v.State == 4 && v.PriceType > 0 { - m, _ := db.FreeProductByID(eg, v.ItemId, v.NumItemId, v.Pvd) + m, _ := db.FreeProductByID(eg, v.ItemId, utils.Int64ToStr(v.NumItemId), v.Pvd) //直接退回账号了 定制 storeOrder := db.GuideStoreOrder(eg, v.OrdId) if m != nil { @@ -284,7 +284,7 @@ func OrderSaveUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, opts } if v.State == 4 && v.ThirdPriceType > 0 { - m, _ := db.MoreFreeProductByID(eg, v.ItemId, v.NumItemId, v.Pvd) + m, _ := db.MoreFreeProductByID(eg, v.ItemId, utils.Int64ToStr(v.NumItemId), v.Pvd) //直接退回账号了 定制 storeOrder := db.GuideStoreOrder(eg, v.OrdId) if m != nil { diff --git a/consume/zhios_order_track_create_for_pdd_zero_consume.go b/consume/zhios_order_track_create_for_pdd_zero_consume.go index 4b7769e..051554a 100644 --- a/consume/zhios_order_track_create_for_pdd_zero_consume.go +++ b/consume/zhios_order_track_create_for_pdd_zero_consume.go @@ -69,6 +69,7 @@ func ZhiosOrderTrackCreateForPddZeroConsume(queue md.MqQueue) { func handleZhiosOrderTrackCreateForPddZeroConsume(msgData []byte) error { //1、解析mq中queue的数据结构体 + fmt.Println(string(msgData)) var msg md2.ZhiosOrderTrackCreateRoutKeyForTb err := json.Unmarshal(msgData, &msg) if err != nil { diff --git a/go.mod b/go.mod index 890c287..c30a03d 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,9 @@ require ( code.fnuoos.com/go_rely_warehouse/zyos_go_jg_push.git v1.0.5 code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 code.fnuoos.com/go_rely_warehouse/zyos_go_o2o_business.git v1.0.9 - code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git v1.9.10-0.20241022105427-5652e016f74f + code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git v1.9.10-0.20241204021050-9f86c73636ac code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git v1.1.21-0.20240706080117-2babe132fe43 - code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20241025091058-686549ebf89d + code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20241114111248-8be78e625f9c github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/boombuler/barcode v1.0.1