- GetVendorStoreSkusInfo处理skuID与平台绑定不正常的情况

This commit is contained in:
gazebo
2019-05-30 18:24:22 +08:00
parent cfadf9b787
commit fb47383f42
6 changed files with 66 additions and 49 deletions

View File

@@ -1508,7 +1508,7 @@ func GetVendorStoreSkusInfo(ctx *jxcontext.Context, storeID int, vendorIDs, skuI
db := dao.GetDB()
var locker sync.RWMutex
skuVendorMap = make(map[int][]*partner.BareStoreSkuInfo)
_, err = CurVendorSync.LoopStoresMap(ctx, db, fmt.Sprintf("GetVendorStoreSkusInfo:%d", storeID), false, false, vendorIDs, []int{storeID},
_, err = CurVendorSync.LoopStoresMap(ctx, db, fmt.Sprintf("GetVendorStoreSkusInfo storeID:%d", storeID), false, false, vendorIDs, []int{storeID},
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
if handler := CurVendorSync.GetStoreHandler(loopMapInfo.VendorID); handler != nil {
@@ -1521,10 +1521,11 @@ func GetVendorStoreSkusInfo(ctx *jxcontext.Context, storeID int, vendorIDs, skuI
VendorSkuID: v.VendorSkuID,
}
}
if _, err = handler.GetStoreSkusInfo(ctx, t, loopMapInfo.StoreMapList[0].StoreID, loopMapInfo.StoreMapList[0].VendorStoreID, bareStoreSkuInfoList); err == nil {
outBareStoreSkuInfoList, err2 := handler.GetStoreSkusInfo(ctx, t, loopMapInfo.StoreMapList[0].StoreID, loopMapInfo.StoreMapList[0].VendorStoreID, bareStoreSkuInfoList)
if err = err2; err == nil && outBareStoreSkuInfoList != nil {
locker.Lock()
defer locker.Unlock()
skuVendorMap[loopMapInfo.VendorID] = bareStoreSkuInfoList
skuVendorMap[loopMapInfo.VendorID] = outBareStoreSkuInfoList
}
}
}