From 748a5301080591ae07eb71e338d8b45659b94643 Mon Sep 17 00:00:00 2001 From: Rosy-zhudan Date: Fri, 9 Aug 2019 08:55:54 +0800 Subject: [PATCH] =?UTF-8?q?ctx=E5=A4=96=E9=83=A8=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku_check.go | 8 +++----- controllers/temp_op.go | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/store_sku_check.go b/business/jxstore/cms/store_sku_check.go index d492ca549..ef4169535 100644 --- a/business/jxstore/cms/store_sku_check.go +++ b/business/jxstore/cms/store_sku_check.go @@ -95,9 +95,8 @@ func GetMultiStoreAllSkuInfoList(vendorID int) []*partner.StoreSkuInfo { return multiStoreAllSkuInfoList[vendorID] } -func GetMultiStoreAllSkuInfo() { +func GetMultiStoreAllSkuInfo(ctx *jxcontext.Context) { InitMultiStoreData() - ctx := jxcontext.AdminCtx for vendorID, _ := range vendorNameList { if IsMultiStore(vendorID) { multiHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IMultipleStoresHandler) @@ -195,7 +194,7 @@ func CompareJxAndVendor(vendorID int, storeIDStr, vendorStoreID, storeName strin } } -func CheckSkuDiffBetweenJxAndVendor(vendorIDList []int, storeIDList []int) { +func CheckSkuDiffBetweenJxAndVendor(ctx *jxcontext.Context, vendorIDList []int, storeIDList []int) { startProcessTime := time.Now().Unix() baseapi.SugarLogger.Debugf("CheckSkuDiffBetweenJxAndVendor start time: %v", time.Now()) vendorMap := make(map[int]bool) @@ -206,7 +205,6 @@ func CheckSkuDiffBetweenJxAndVendor(vendorIDList []int, storeIDList []int) { for _, storeID := range storeIDList { storeIDMap[storeID] = true } - ctx := jxcontext.AdminCtx taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) { switch step { case 0: @@ -214,7 +212,7 @@ func CheckSkuDiffBetweenJxAndVendor(vendorIDList []int, storeIDList []int) { if err != nil { baseapi.SugarLogger.Errorf("CheckSkuDiffBetweenJxAndVendor GetStores error:%v", err) } else { - GetMultiStoreAllSkuInfo() + GetMultiStoreAllSkuInfo(ctx) diffData.InitData() taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { jxStoreInfoListValue := batchItemList[0].(*StoreExt) diff --git a/controllers/temp_op.go b/controllers/temp_op.go index 95d5001a6..d42824a4c 100644 --- a/controllers/temp_op.go +++ b/controllers/temp_op.go @@ -311,7 +311,7 @@ func (c *TempOpController) CheckSkuDiffBetweenJxAndVendor() { var vendorIDList []int var storeIDList []int if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDList, params.StoreIDs, &storeIDList); err == nil { - cms.CheckSkuDiffBetweenJxAndVendor(vendorIDList, storeIDList) + cms.CheckSkuDiffBetweenJxAndVendor(params.Ctx, vendorIDList, storeIDList) } return retVal, "", err