StoreExt的StoreMaps与CourierMaps从map数组改为struct数组

This commit is contained in:
gazebo
2019-12-11 16:04:44 +08:00
parent 95a669476e
commit ef5ec63951
4 changed files with 33 additions and 32 deletions

View File

@@ -277,10 +277,10 @@ func GetFilterStoreList(storeList []*StoreExt, vendorMap, storeIDMap map[int]boo
}
}
if storeInfo.StoreMaps != nil {
var tempStoreMaps []map[string]interface{}
var tempStoreMaps []*model.StoreMap
for _, vendorStoreInfo := range storeInfo.StoreMaps {
vendorID := int(utils.MustInterface2Int64(vendorStoreInfo["vendorID"]))
isSyncStoreSku := int(utils.MustInterface2Int64(vendorStoreInfo["isSync"]))
vendorID := vendorStoreInfo.VendorID
isSyncStoreSku := int(vendorStoreInfo.IsSync)
if isSyncStoreSku == 0 {
continue
}
@@ -549,7 +549,7 @@ func CheckSkuDiffBetweenJxAndVendor(ctx *jxcontext.Context, vendorIDList []int,
var filterJxSkuInfoMapSingle map[int]*dao.StoreSkuNameExt
var filterJxSkuInfoMapMulti map[int]*dao.StoreSkuNameExt
for _, vendorListValue := range jxStoreInfoListValue.StoreMaps {
vendorID := int(utils.MustInterface2Int64(vendorListValue["vendorID"]))
vendorID := vendorListValue.VendorID
var flag = false
if partner.IsMultiStore(vendorID) {
if flag == false {
@@ -565,14 +565,13 @@ func CheckSkuDiffBetweenJxAndVendor(ctx *jxcontext.Context, vendorIDList []int,
}
}
vendorStoreID := utils.Interface2String(vendorListValue["vendorStoreID"])
vendorStoreID := vendorListValue.VendorStoreID
baseapi.SugarLogger.Debugf("CheckSkuDiffBetweenJxAndVendor storeID:%d vendorID:%d vendorStoreID:%s vendorListValue:%v", storeID, vendorID, vendorStoreID, vendorListValue)
if partner.IsMultiStore(vendorID) {
singleStoreHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IPurchasePlatformStoreSkuHandler)
allSkuInfoList := GetMultiStoreAllSkuInfoList(vendorID)
// TODO vendorOrgCode
skuBareInfoList, err := singleStoreHandler.GetStoreSkusBareInfo(ctx, "", task, storeID, vendorStoreID, allSkuInfoList)
skuBareInfoList, err := singleStoreHandler.GetStoreSkusBareInfo(ctx, vendorListValue.VendorOrgCode, task, storeID, vendorStoreID, allSkuInfoList)
if err != nil {
baseapi.SugarLogger.Infof("CheckSkuDiffBetweenJxAndVendor GetStoreSkusBareInfo error:%v", err)
} else if len(skuBareInfoList) > 0 {