Merge branch 'mark' of git.coding.net:XJH-Rosy/jx-callback into mark

This commit is contained in:
gazebo
2019-08-09 09:33:18 +08:00
2 changed files with 4 additions and 6 deletions

View File

@@ -95,9 +95,8 @@ func GetMultiStoreAllSkuInfoList(vendorID int) []*partner.StoreSkuInfo {
return multiStoreAllSkuInfoList[vendorID] return multiStoreAllSkuInfoList[vendorID]
} }
func GetMultiStoreAllSkuInfo() { func GetMultiStoreAllSkuInfo(ctx *jxcontext.Context) {
InitMultiStoreData() InitMultiStoreData()
ctx := jxcontext.AdminCtx
for vendorID, _ := range vendorNameList { for vendorID, _ := range vendorNameList {
if IsMultiStore(vendorID) { if IsMultiStore(vendorID) {
multiHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IMultipleStoresHandler) 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() startProcessTime := time.Now().Unix()
baseapi.SugarLogger.Debugf("CheckSkuDiffBetweenJxAndVendor start time: %v", time.Now()) baseapi.SugarLogger.Debugf("CheckSkuDiffBetweenJxAndVendor start time: %v", time.Now())
vendorMap := make(map[int]bool) vendorMap := make(map[int]bool)
@@ -206,7 +205,6 @@ func CheckSkuDiffBetweenJxAndVendor(vendorIDList []int, storeIDList []int) {
for _, storeID := range storeIDList { for _, storeID := range storeIDList {
storeIDMap[storeID] = true storeIDMap[storeID] = true
} }
ctx := jxcontext.AdminCtx
taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) { taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) {
switch step { switch step {
case 0: case 0:
@@ -214,7 +212,7 @@ func CheckSkuDiffBetweenJxAndVendor(vendorIDList []int, storeIDList []int) {
if err != nil { if err != nil {
baseapi.SugarLogger.Errorf("CheckSkuDiffBetweenJxAndVendor GetStores error:%v", err) baseapi.SugarLogger.Errorf("CheckSkuDiffBetweenJxAndVendor GetStores error:%v", err)
} else { } else {
GetMultiStoreAllSkuInfo() GetMultiStoreAllSkuInfo(ctx)
diffData.InitData() diffData.InitData()
taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
jxStoreInfoListValue := batchItemList[0].(*StoreExt) jxStoreInfoListValue := batchItemList[0].(*StoreExt)

View File

@@ -311,7 +311,7 @@ func (c *TempOpController) CheckSkuDiffBetweenJxAndVendor() {
var vendorIDList []int var vendorIDList []int
var storeIDList []int var storeIDList []int
if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDList, params.StoreIDs, &storeIDList); err == nil { 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 return retVal, "", err