打桩
This commit is contained in:
@@ -42,6 +42,13 @@ func getMultiStoreVendorInfoList() (list []*MultiStoreVendorInfo) {
|
||||
|
||||
func syncCategories(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, catList []*dao.SkuStoreCatInfo, isAsync bool) (hint string, err error) {
|
||||
if len(catList) > 0 {
|
||||
for _, v := range catList {
|
||||
globals.SugarLogger.Debugf("可能同步数据==========%v", v.ID)
|
||||
globals.SugarLogger.Debugf("可能同步数据==========%v", v.ParentCatName)
|
||||
globals.SugarLogger.Debugf("可能同步数据==========%v", v.ParentVendorCatID)
|
||||
globals.SugarLogger.Debugf("可能同步数据==========%v", v.StoreCatName)
|
||||
globals.SugarLogger.Debugf("可能同步数据==========%v", v.StoreParentCatName)
|
||||
}
|
||||
// todo 按vendorID orgCode合并操作
|
||||
task := tasksch.NewParallelTask(fmt.Sprintf("同步分类2:%d", len(catList)), tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
@@ -88,6 +95,8 @@ func syncCategories(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.IT
|
||||
}
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("可能同步数据==========%s", "未查询到同步数据")
|
||||
|
||||
return hint, err
|
||||
}
|
||||
|
||||
@@ -680,10 +689,13 @@ func FullSyncVendorStuff(ctx *jxcontext.Context, parentTask tasksch.ITask, store
|
||||
step := batchItemList[0].(int)
|
||||
switch step {
|
||||
case 0:
|
||||
// 有点儿像创建本地商品分类(需要第三方同步商店)
|
||||
_, err = amendAndPruneVendorStuff(ctx, task, storeID, vendorID, vendorOrgCode, false, isContinueWhenError, AmendPruneAll, false)
|
||||
case 1:
|
||||
// 同步类别
|
||||
_, err = SyncCategories(ctx, task, []int{vendorID}, []string{vendorOrgCode}, nil, false)
|
||||
case 2:
|
||||
// 同步商品
|
||||
_, err = SyncSkus(ctx, task, []int{vendorID}, []string{vendorOrgCode}, nil, nil, false)
|
||||
}
|
||||
return retVal, err
|
||||
|
||||
Reference in New Issue
Block a user