测试完成景田店上架不是京狗
This commit is contained in:
@@ -1090,7 +1090,7 @@ func (v *VendorSync) SyncJdsStoresSkus(ctx *jxcontext.Context, storeIDs []int, i
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
)
|
||||
// storeSkus, _ := dao.GetStoresSkusInfo(db, []int{model.JdShopMainStoreID}, nil)
|
||||
storeSkus, _ := dao.GetStoresSkusInfo(db, []int{model.JdShopMainStoreID}, nil)
|
||||
_, hint, err = v.LoopStoresMap2(ctx, nil, db, fmt.Sprintf("同步京东商城库存商品信息:%v", storeIDs), isAsync, true, []int{model.VendorIDJDShop}, storeIDs, false,
|
||||
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
|
||||
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
|
||||
@@ -1099,7 +1099,7 @@ func (v *VendorSync) SyncJdsStoresSkus(ctx *jxcontext.Context, storeIDs []int, i
|
||||
if storeMap.Status > model.StoreStatusDisabled && storeMap.StoreID != model.JdShopMainStoreID && storeMap.SyncRule != 0 {
|
||||
err = syncJdsStoresSkus(ctx, db, nil, storeMap, isAsync, isContinueWhenError)
|
||||
}
|
||||
// err = syncJdsStoreStock(ctx, db, storeSkus, storeMap)
|
||||
err = syncJdsStoreStock(ctx, db, storeSkus, storeMap)
|
||||
}
|
||||
}
|
||||
return nil, partner.AddVendorInfo2Err(err, loopMapInfo.VendorID)
|
||||
@@ -1133,12 +1133,12 @@ func syncJdsStoreStock(ctx *jxcontext.Context, db *dao.DaoDB, storeSkus []*model
|
||||
|
||||
func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, storeMap *model.StoreMap, isAsync, isContinueWhenError bool) (err error) {
|
||||
var (
|
||||
mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
||||
skusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
||||
updateList []*dao.StoreSkuSyncInfo
|
||||
addList []*dao.StoreSkuSyncInfo
|
||||
// skuBindInfos1 []*StoreSkuBindInfo
|
||||
// skuBindInfos2 []*StoreSkuBindInfo
|
||||
mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
||||
skusMap = make(map[int][]*dao.StoreSkuSyncInfo)
|
||||
updateList []*dao.StoreSkuSyncInfo
|
||||
addList []*dao.StoreSkuSyncInfo
|
||||
skuBindInfos1 []*StoreSkuBindInfo
|
||||
skuBindInfos2 []*StoreSkuBindInfo
|
||||
)
|
||||
storeSkusMain, err := dao.GetStoreSkusByNameIDs(db, []int{model.JdShopMainStoreID}, 0)
|
||||
for _, v := range storeSkusMain {
|
||||
@@ -1178,21 +1178,21 @@ func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt.Println("updateList", utils.Format4Output(updateList, false))
|
||||
// fmt.Println("updateList", utils.Format4Output(updateList, false))
|
||||
// fmt.Println("addList", utils.Format4Output(addList, false))
|
||||
// if len(updateList) > 0 {
|
||||
// for _, v := range updateList {
|
||||
// skuBindInfos1 = append(skuBindInfos1, buildStoreSkuBindInfo(db, storeMap.StoreID, v, false))
|
||||
// }
|
||||
// UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false)
|
||||
// }
|
||||
if len(updateList) > 0 {
|
||||
for _, v := range updateList {
|
||||
skuBindInfos1 = append(skuBindInfos1, buildStoreSkuBindInfo(db, storeMap.StoreID, v, false))
|
||||
}
|
||||
UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false)
|
||||
}
|
||||
|
||||
// if len(addList) > 0 {
|
||||
// for _, v := range addList {
|
||||
// skuBindInfos2 = append(skuBindInfos2, buildStoreSkuBindInfo(db, storeMap.StoreID, v, true))
|
||||
// }
|
||||
// UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false)
|
||||
// }
|
||||
if len(addList) > 0 {
|
||||
for _, v := range addList {
|
||||
skuBindInfos2 = append(skuBindInfos2, buildStoreSkuBindInfo(db, storeMap.StoreID, v, true))
|
||||
}
|
||||
UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user