From 5461f4f283f87490014e9a9951114c9bd0c0f626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 23 Jun 2020 11:38:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=99=AF=E7=94=B0=E5=BA=97?= =?UTF-8?q?=E4=B8=8A=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sync.go | 42 +++++++++++++++++------------------ business/jxstore/misc/misc.go | 6 ++--- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index 667f1d49d..b30741720 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -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 } diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index dd402e730..5890b2b1f 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -46,10 +46,10 @@ var ( "22:00:00", } dailyWorkTimeList2 = []string{ - "23:00:00", + "04:00:00", } priceReferTimeList = []string{ - "01:00:00", + "03:00:00", } checkCookieList = []string{ "08:00:00", @@ -57,7 +57,7 @@ var ( "18:00:00", } createStorePriceTimeList = []string{ - "02:00:00", + "04:00:00", } refreshPageActTimeList = []string{ "7:00:00",