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 {