From ae1ab21089e48e97d8e67db43b24a595045adfb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 14 Sep 2020 17:45:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=8512=E5=B0=8F=E6=97=B6=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=94=AE=E5=90=8E=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/misc/misc.go | 6 +-- business/partner/purchase/jdshop/callback.go | 39 +++++++++++--------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index f8a69a1e0..ce8925a4a 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -287,9 +287,9 @@ func Init() { "04:05:06", }) //京东的订单信息解密密钥获取 - // ScheduleTimerFuncByInterval(func() { - // jdshop.InitKey() - // }, 10*time.Second, 8*time.Hour) + ScheduleTimerFuncByInterval(func() { + jdshop.InitKey() + }, 10*time.Second, 8*time.Hour) ScheduleTimerFunc("ChangeJxPriceByDiscountAct", func() { act.ChangeJxPriceByDiscountAct(jxcontext.AdminCtx) }, discountActJxList) diff --git a/business/partner/purchase/jdshop/callback.go b/business/partner/purchase/jdshop/callback.go index cb48c2789..9d225d05e 100644 --- a/business/partner/purchase/jdshop/callback.go +++ b/business/partner/purchase/jdshop/callback.go @@ -137,24 +137,29 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err return order, err } if len(storeList) > 0 { - order.StoreID = storeList[0].ID - order.JxStoreID = storeList[0].ID - order.StoreName = storeList[0].Name - globals.SugarLogger.Debugf("jds GetStoreListByLocation, orderID: %v storeID :%v", order.VendorOrderID, order.StoreID) - //结算类型 - storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), order.StoreID, model.VendorIDJDShop) - if storeDetail != nil { - if storeDetail.PayPercentage < 50 { - order.EarningType = model.EarningTypePoints - } else { - order.EarningType = model.EarningTypeQuote + for _, store := range storeList { + order.StoreID = store.ID + order.JxStoreID = store.ID + order.StoreName = store.Name + globals.SugarLogger.Debugf("jds GetStoreListByLocation, orderID: %v storeID :%v", order.VendorOrderID, order.StoreID) + //结算类型 + storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), order.StoreID, model.VendorIDJDShop) + if storeDetail != nil { + if storeDetail.PayPercentage < 50 { + order.EarningType = model.EarningTypePoints + } else { + order.EarningType = model.EarningTypeQuote + } } - } - if order.EarningType == model.EarningTypeQuote { - var shopPriceSum int - storeSkuList, _ := dao.GetStoresSkusInfo(dao.GetDB(), []int{order.StoreID}, skuIDs) - for _, storeSku := range storeSkuList { - shopPriceSum += storeSku.Price + if order.EarningType == model.EarningTypeQuote { + var shopPriceSum int + storeSkuList, _ := dao.GetStoresSkusInfo(dao.GetDB(), []int{order.StoreID}, skuIDs) + for _, storeSku := range storeSkuList { + shopPriceSum += storeSku.Price + } + if shopPriceSum+700 > order.TotalShopMoney { + + } } } } else {