京东商城同步测试

This commit is contained in:
苏尹岚
2020-06-08 17:37:40 +08:00
parent f70dc4fceb
commit 0b5341314b
2 changed files with 21 additions and 20 deletions

View File

@@ -1105,12 +1105,12 @@ func (v *VendorSync) SyncJdsStoresSkus(ctx *jxcontext.Context, storeIDs []int, i
func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, storeMap *model.StoreMap, isAsync, isContinueWhenError bool) (err error) { func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, storeMap *model.StoreMap, isAsync, isContinueWhenError bool) (err error) {
var ( var (
mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo) mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo)
skusMap = make(map[int][]*dao.StoreSkuSyncInfo) skusMap = make(map[int][]*dao.StoreSkuSyncInfo)
updateList []*dao.StoreSkuSyncInfo updateList []*dao.StoreSkuSyncInfo
addList []*dao.StoreSkuSyncInfo addList []*dao.StoreSkuSyncInfo
// skuBindInfos1 []*StoreSkuBindInfo skuBindInfos1 []*StoreSkuBindInfo
// skuBindInfos2 []*StoreSkuBindInfo skuBindInfos2 []*StoreSkuBindInfo
) )
storeSkusMain, err := dao.GetStoreSkusByNameIDs(db, []int{model.JdShopMainStoreID}, 0) storeSkusMain, err := dao.GetStoreSkusByNameIDs(db, []int{model.JdShopMainStoreID}, 0)
for _, v := range storeSkusMain { for _, v := range storeSkusMain {
@@ -1149,21 +1149,21 @@ func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch
} }
} }
} }
fmt.Println("updateList", utils.Format4Output(updateList, false)) // fmt.Println("updateList", utils.Format4Output(updateList, false))
fmt.Println("addList", utils.Format4Output(addList, false)) // fmt.Println("addList", utils.Format4Output(addList, false))
// if len(updateList) > 0 { if len(updateList) > 0 {
// for _, v := range updateList { for _, v := range updateList {
// skuBindInfos1 = append(skuBindInfos1, buildStoreSkuBindInfo(db, storeMap.StoreID, v, false)) skuBindInfos1 = append(skuBindInfos1, buildStoreSkuBindInfo(db, storeMap.StoreID, v, false))
// } }
// _, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false) _, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false)
// } }
// if len(addList) > 0 { if len(addList) > 0 {
// for _, v := range addList { for _, v := range addList {
// skuBindInfos2 = append(skuBindInfos2, buildStoreSkuBindInfo(db, storeMap.StoreID, v, true)) skuBindInfos2 = append(skuBindInfos2, buildStoreSkuBindInfo(db, storeMap.StoreID, v, true))
// } }
// _, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false) _, err = UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false)
// } }
return err return err
} }

View File

@@ -134,6 +134,7 @@ func (p *PurchaseHandler) GetOrder4PartRefund(vendorOrderID string) (order *mode
order.DiscountMoney = discountMoney order.DiscountMoney = discountMoney
order.Skus = append(order.Skus, giftSkus...) order.Skus = append(order.Skus, giftSkus...)
order.ActualPayPrice = utils.MustInterface2Int64(result2["user_fee"]) order.ActualPayPrice = utils.MustInterface2Int64(result2["user_fee"])
order.TotalShopMoney = utils.MustInterface2Int64(result2["shop_fee"])
jxutils.RefreshOrderSkuRelated(order) jxutils.RefreshOrderSkuRelated(order)
} else if err2Ext, ok := err2.(*utils.ErrorWithCode); !ok || err2Ext.IntCode() != ebaiapi.ErrOrderIsNotPartRefund { } else if err2Ext, ok := err2.(*utils.ErrorWithCode); !ok || err2Ext.IntCode() != ebaiapi.ErrOrderIsNotPartRefund {
err = err2 err = err2