银豹创建商品测试

This commit is contained in:
苏尹岚
2020-03-20 16:52:02 +08:00
parent e70cbc30a9
commit 5216f21a12

View File

@@ -434,6 +434,7 @@ func (v *VendorSync) SyncStoresSkus2(ctx *jxcontext.Context, parentTask tasksch.
task, hint, err := v.LoopStoresMap2(ctx, parentTask, db, fmt.Sprintf("同步门店商品信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs, false, task, hint, err := v.LoopStoresMap2(ctx, parentTask, db, fmt.Sprintf("同步门店商品信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs, false,
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) { func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo) loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
globals.SugarLogger.Debugf("ssss,[%v]", utils.Format4Output(loopMapInfo, false))
if handler := v.GetStoreHandler(loopMapInfo.VendorID); handler != nil { if handler := v.GetStoreHandler(loopMapInfo.VendorID); handler != nil {
parallelCount := 5 parallelCount := 5
if model.MultiStoresVendorMap[loopMapInfo.VendorID] == 1 { if model.MultiStoresVendorMap[loopMapInfo.VendorID] == 1 {
@@ -443,7 +444,6 @@ func (v *VendorSync) SyncStoresSkus2(ctx *jxcontext.Context, parentTask tasksch.
tasksch.NewParallelConfig().SetParallelCount(parallelCount).SetIsContinueWhenError(isContinueWhenError), ctx, tasksch.NewParallelConfig().SetParallelCount(parallelCount).SetIsContinueWhenError(isContinueWhenError), ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
storeMap := batchItemList[0].(*model.StoreMap) storeMap := batchItemList[0].(*model.StoreMap)
globals.SugarLogger.Debugf("ssss,[%v]", utils.Format4Output(storeMap, false))
if syncDisabled || storeMap.Status > model.StoreStatusDisabled { if syncDisabled || storeMap.Status > model.StoreStatusDisabled {
if setSyncStatus != 0 { if setSyncStatus != 0 {
dao.SetStoreSkuSyncStatus(db, storeMap.VendorID, []int{storeMap.StoreID}, skuIDs, setSyncStatus) dao.SetStoreSkuSyncStatus(db, storeMap.VendorID, []int{storeMap.StoreID}, skuIDs, setSyncStatus)
@@ -456,6 +456,8 @@ func (v *VendorSync) SyncStoresSkus2(ctx *jxcontext.Context, parentTask tasksch.
}, loopMapInfo.StoreMapList) }, loopMapInfo.StoreMapList)
t.AddChild(loopStoreTask).Run() t.AddChild(loopStoreTask).Run()
_, err = loopStoreTask.GetResult(0) _, err = loopStoreTask.GetResult(0)
} else {
globals.SugarLogger.Debugf("yaer")
} }
return nil, partner.AddVendorInfo2Err(err, loopMapInfo.VendorID) return nil, partner.AddVendorInfo2Err(err, loopMapInfo.VendorID)
}, isContinueWhenError) }, isContinueWhenError)
@@ -605,7 +607,6 @@ func (v *VendorSync) LoopStoresMap2(ctx *jxcontext.Context, parentTask tasksch.I
if len(storeMapList) == 0 { if len(storeMapList) == 0 {
return nil, "", nil return nil, "", nil
} }
fmt.Println("test", utils.Format4Output(storeMapList, false))
vendorStoreMap := make(map[int][]*model.StoreMap) vendorStoreMap := make(map[int][]*model.StoreMap)
for _, v := range storeMapList { for _, v := range storeMapList {
vendorStoreMap[v.VendorID] = append(vendorStoreMap[v.VendorID], v) vendorStoreMap[v.VendorID] = append(vendorStoreMap[v.VendorID], v)