1
This commit is contained in:
@@ -133,14 +133,17 @@ func CopyEBaiToEBai(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail,
|
|||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
i := 1
|
i := 1
|
||||||
|
skuIdOffset := 0
|
||||||
for {
|
for {
|
||||||
// 同步商品
|
// 同步商品
|
||||||
fromFoodList, err1 := api.SkuList(utils.Int2Str(fromStore.ID), &ebaiapi.SkuListParams{
|
fromFoodList, err1 := api.SkuList(utils.Int2Str(fromStore.ID), &ebaiapi.SkuListParams{
|
||||||
Page: i,
|
Page: i,
|
||||||
|
SkuIdOffset: skuIdOffset,
|
||||||
})
|
})
|
||||||
if len(fromFoodList.List) == 0 || fromFoodList == nil {
|
if len(fromFoodList.List) == 0 || fromFoodList == nil || len(fromFoodList.List) < 100 {
|
||||||
return nil, fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i)
|
return nil, fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i)
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("---------len:=%d", len(fromFoodList.List))
|
||||||
errList := BatchInitSkuEBai2EBai(ctx, fromFoodList.List, api, utils.Int2Str(toStore.ID), VendorCategoryIDMap)
|
errList := BatchInitSkuEBai2EBai(ctx, fromFoodList.List, api, utils.Int2Str(toStore.ID), VendorCategoryIDMap)
|
||||||
if errList != nil {
|
if errList != nil {
|
||||||
for _, verr := range errList {
|
for _, verr := range errList {
|
||||||
@@ -149,6 +152,7 @@ func CopyEBaiToEBai(ctx *jxcontext.Context, fromStore, toStore *dao.StoreDetail,
|
|||||||
globals.SugarLogger.Debugf("BatchInitData : %s", utils.Format4Output(errList, false))
|
globals.SugarLogger.Debugf("BatchInitData : %s", utils.Format4Output(errList, false))
|
||||||
}
|
}
|
||||||
i = i + 1
|
i = i + 1
|
||||||
|
skuIdOffset = fromFoodList.SkuIdOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -194,7 +198,6 @@ func BatchInitSkuEBai2EBai(ctx *jxcontext.Context, fromSku []*ebaiapi.SkuInfo, t
|
|||||||
if customSkuID == "" {
|
if customSkuID == "" {
|
||||||
customSkuID = utils.Int64ToStr(storeSku.SkuId)
|
customSkuID = utils.Int64ToStr(storeSku.SkuId)
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("------canshu:%s,%s,%s", storeID, storeSku.CustomSkuId, utils.Format4Output(params, false))
|
|
||||||
_, err := toApi.SkuCreate(ctx.GetTrackInfo(), storeID, storeSku.CustomSkuID, params)
|
_, err := toApi.SkuCreate(ctx.GetTrackInfo(), storeID, storeSku.CustomSkuID, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
globals.SugarLogger.Debugf("---------name := %s-err := %s", storeSku.Name, err.Error())
|
globals.SugarLogger.Debugf("---------name := %s-err := %s", storeSku.Name, err.Error())
|
||||||
|
|||||||
Reference in New Issue
Block a user