1
This commit is contained in:
@@ -6583,6 +6583,7 @@ func CopyMtToJd(ctx *jxcontext.Context, mtStoreID, mtOrgCode, jdStoreID, jdOrgCo
|
||||
step := batchItemList[0].(int)
|
||||
switch step {
|
||||
case 0:
|
||||
globals.SugarLogger.Debugf("-----------------11111")
|
||||
//建分类 ,账号存在分类,不在创建分类
|
||||
//jdCatList, _ := jd.QueryCategoriesByOrgCode()
|
||||
//if len(jdCatList) == 0 {
|
||||
@@ -6603,16 +6604,18 @@ func CopyMtToJd(ctx *jxcontext.Context, mtStoreID, mtOrgCode, jdStoreID, jdOrgCo
|
||||
// }
|
||||
//}
|
||||
case 1:
|
||||
globals.SugarLogger.Debugf("-----------lens := %d", 1)
|
||||
//建商品
|
||||
skuList := make([]*mtwmapi.AppFood, 0, 0)
|
||||
for {
|
||||
skuList2, _ := mtapi.RetailListAll(mtStoreID, 0)
|
||||
globals.SugarLogger.Debugf("-----------lens2 := %d", len(skuList2))
|
||||
skuList = append(skuList, skuList2...)
|
||||
if len(skuList2) < 100 {
|
||||
break
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("-----------lens := %d", len(skuList))
|
||||
globals.SugarLogger.Debugf("-----------lens3 := %d", len(skuList))
|
||||
//skuList, _ := mtapi.RetailList(mtStoreID, 0, 2)
|
||||
task2 := tasksch.NewParallelTask("美团到京东, 建商品", tasksch.NewParallelConfig().SetIsContinueWhenError(true).SetParallelCount(1), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
@@ -6648,6 +6651,7 @@ func CopyMtToJd(ctx *jxcontext.Context, mtStoreID, mtOrgCode, jdStoreID, jdOrgCo
|
||||
param.ShopCategories = append(param.ShopCategories, utils.Str2Int64(catMap[mtSku.CategoryCode]))
|
||||
}
|
||||
param.ProductDesc = fmt.Sprintf(`<img src="%s" alt="一张图片" />`, mtSku.PictureContents)
|
||||
globals.SugarLogger.Debugf("-------------skuname := %s", param.SkuName)
|
||||
skuID, err := jd.AddSku2(param)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("---------AddSku2 := %s,%v", skuID, err)
|
||||
|
||||
Reference in New Issue
Block a user