测试景田店上架

This commit is contained in:
苏尹岚
2020-06-23 11:38:50 +08:00
parent aa6ebe5e4d
commit 5461f4f283
2 changed files with 24 additions and 24 deletions

View File

@@ -1090,7 +1090,7 @@ func (v *VendorSync) SyncJdsStoresSkus(ctx *jxcontext.Context, storeIDs []int, i
var ( var (
db = dao.GetDB() 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, _, 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) { func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo) 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 { if storeMap.Status > model.StoreStatusDisabled && storeMap.StoreID != model.JdShopMainStoreID && storeMap.SyncRule != 0 {
err = syncJdsStoresSkus(ctx, db, nil, storeMap, isAsync, isContinueWhenError) 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) 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) { func syncJdsStoresSkus(ctx *jxcontext.Context, db *dao.DaoDB, parentTask tasksch.ITask, storeMap *model.StoreMap, isAsync, isContinueWhenError bool) (err error) {
var ( var (
mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo) mainSkusMap = make(map[int][]*dao.StoreSkuSyncInfo)
skusMap = make(map[int][]*dao.StoreSkuSyncInfo) skusMap = make(map[int][]*dao.StoreSkuSyncInfo)
updateList []*dao.StoreSkuSyncInfo updateList []*dao.StoreSkuSyncInfo
addList []*dao.StoreSkuSyncInfo addList []*dao.StoreSkuSyncInfo
skuBindInfos1 []*StoreSkuBindInfo // skuBindInfos1 []*StoreSkuBindInfo
skuBindInfos2 []*StoreSkuBindInfo // skuBindInfos2 []*StoreSkuBindInfo
) )
storeSkusMain, err := dao.GetStoreSkusByNameIDs(db, []int{model.JdShopMainStoreID}, 0) storeSkusMain, err := dao.GetStoreSkusByNameIDs(db, []int{model.JdShopMainStoreID}, 0)
for _, v := range storeSkusMain { 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)) // fmt.Println("addList", utils.Format4Output(addList, false))
if len(updateList) > 0 { // if len(updateList) > 0 {
for _, v := range updateList { // for _, v := range updateList {
skuBindInfos1 = append(skuBindInfos1, buildStoreSkuBindInfo(db, storeMap.StoreID, v, false)) // skuBindInfos1 = append(skuBindInfos1, buildStoreSkuBindInfo(db, storeMap.StoreID, v, false))
} // }
UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false) // UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos1, isAsync, isContinueWhenError, false)
} // }
if len(addList) > 0 { // if len(addList) > 0 {
for _, v := range addList { // for _, v := range addList {
skuBindInfos2 = append(skuBindInfos2, buildStoreSkuBindInfo(db, storeMap.StoreID, v, true)) // skuBindInfos2 = append(skuBindInfos2, buildStoreSkuBindInfo(db, storeMap.StoreID, v, true))
} // }
UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false) // UpdateStoresSkusByBind(ctx, parentTask, skuBindInfos2, isAsync, isContinueWhenError, false)
} // }
return err return err
} }

View File

@@ -46,10 +46,10 @@ var (
"22:00:00", "22:00:00",
} }
dailyWorkTimeList2 = []string{ dailyWorkTimeList2 = []string{
"23:00:00", "04:00:00",
} }
priceReferTimeList = []string{ priceReferTimeList = []string{
"01:00:00", "03:00:00",
} }
checkCookieList = []string{ checkCookieList = []string{
"08:00:00", "08:00:00",
@@ -57,7 +57,7 @@ var (
"18:00:00", "18:00:00",
} }
createStorePriceTimeList = []string{ createStorePriceTimeList = []string{
"02:00:00", "04:00:00",
} }
refreshPageActTimeList = []string{ refreshPageActTimeList = []string{
"7:00:00", "7:00:00",