银豹同步京西,add测试
This commit is contained in:
@@ -950,30 +950,29 @@ func syncStoreSkusFromYb(ctx *jxcontext.Context, storeID, vendorID int, vendorSt
|
|||||||
deleteList = append(deleteList, v)
|
deleteList = append(deleteList, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Println("test111111111111111", storeID, vendorStoreID)
|
|
||||||
fmt.Println("addList", utils.Format4Output(addList, false))
|
fmt.Println("addList", utils.Format4Output(addList, false))
|
||||||
fmt.Println("updateList", utils.Format4Output(updateList, false))
|
fmt.Println("updateList", utils.Format4Output(updateList, false))
|
||||||
fmt.Println("deleteList", utils.Format4Output(deleteList, false))
|
fmt.Println("deleteList", utils.Format4Output(deleteList, false))
|
||||||
// taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {\
|
taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
|
||||||
// store, _ := dao.GetStoreDetail(db, storeID, vendorID)
|
store, _ := dao.GetStoreDetail(db, storeID, vendorID)
|
||||||
// switch step {
|
switch step {
|
||||||
// case 0:
|
case 0:
|
||||||
// if len(addList) > 0 {
|
if len(addList) > 0 {
|
||||||
// taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
// var (
|
var (
|
||||||
// v = batchItemList[0].(*partner.SkuNameInfo)
|
v = batchItemList[0].(*partner.SkuNameInfo)
|
||||||
// upc = v.YbBarCode
|
upc = v.YbBarCode
|
||||||
// )
|
)
|
||||||
// err = AddSkuNameByUpc(ctx, upc, store, v)
|
err = AddSkuNameByUpc(ctx, upc, store, v)
|
||||||
// if err != nil {
|
if err != nil {
|
||||||
// task.AddFailedList(putils.GetErrMsg2FailedSingleList(nil, err, storeID, model.VendorChineseNames[vendorID], "根据upc创建京西商品"))
|
task.AddFailedList(putils.GetErrMsg2FailedSingleList(nil, err, storeID, model.VendorChineseNames[vendorID], "根据upc创建京西商品"))
|
||||||
// }
|
}
|
||||||
// return retVal, err
|
return retVal, err
|
||||||
// }
|
}
|
||||||
// taskParallel := tasksch.NewParallelTask("创建商品", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, taskFunc, addList)
|
taskParallel := tasksch.NewParallelTask("创建商品", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, taskFunc, addList)
|
||||||
// tasksch.HandleTask(taskParallel, task, true).Run()
|
tasksch.HandleTask(taskParallel, task, true).Run()
|
||||||
// _, err = taskParallel.GetResult(0)
|
_, err = taskParallel.GetResult(0)
|
||||||
// }
|
}
|
||||||
// case 1:
|
// case 1:
|
||||||
// if len(deleteList) > 0 {
|
// if len(deleteList) > 0 {
|
||||||
// taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
// taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
@@ -1036,11 +1035,11 @@ func syncStoreSkusFromYb(ctx *jxcontext.Context, storeID, vendorID int, vendorSt
|
|||||||
// }
|
// }
|
||||||
// _, err = updateStoresSkusWithoutSync(ctx, db, []int{storeID}, skuBindInfosUpt, false)
|
// _, err = updateStoresSkusWithoutSync(ctx, db, []int{storeID}, skuBindInfosUpt, false)
|
||||||
// }
|
// }
|
||||||
// }
|
}
|
||||||
// return result, err
|
return result, err
|
||||||
// }
|
}
|
||||||
// taskSeq := tasksch.NewSeqTask2("同步银豹商品到京西", ctx, true, taskSeqFunc, 3)
|
taskSeq := tasksch.NewSeqTask2("同步银豹商品到京西", ctx, true, taskSeqFunc, 3)
|
||||||
// tasksch.HandleTask(taskSeq, nil, true).Run()
|
tasksch.HandleTask(taskSeq, nil, true).Run()
|
||||||
// hint = taskSeq.GetID()
|
hint = taskSeq.GetID()
|
||||||
return hint, err
|
return hint, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user