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

@@ -181,7 +181,7 @@ func GetFilterStoreList(storeList []*cms.StoreExt, vendorMap, storeIDMap map[int
}
}
for _, vendorStoreInfo := range storeInfo.StoreMaps {
vendorID := int(utils.MustInterface2Int64(vendorStoreInfo["vendorID"]))
vendorID := vendorStoreInfo.VendorID
//filter for vendorID
if len(vendorMap) > 0 {
if _, ok := vendorMap[vendorID]; !ok {
@@ -193,7 +193,7 @@ func GetFilterStoreList(storeList []*cms.StoreExt, vendorMap, storeIDMap map[int
}
temp := *storeInfo
newStoreInfo := &temp
newStoreInfo.StoreMaps = []map[string]interface{}{vendorStoreInfo}
newStoreInfo.StoreMaps = []*model.StoreMap{vendorStoreInfo}
outStoreList = append(outStoreList, newStoreInfo)
}
}
@@ -224,9 +224,9 @@ func StartOrEndOpStoreEx(ctx *jxcontext.Context, isStart bool, startTime, endTim
storeListValue := batchItemList[0].(*cms.StoreExt)
storeID := storeListValue.ID
for _, vendorListValue := range storeListValue.StoreMaps {
vendorID := int(utils.MustInterface2Int64(vendorListValue["vendorID"]))
startOpStoreTime := int16(utils.MustInterface2Int64(vendorListValue["fakeOpenStart"]))
endOpStoreTime := int16(utils.MustInterface2Int64(vendorListValue["fakeOpenStop"]))
vendorID := vendorListValue.VendorID
startOpStoreTime := vendorListValue.FakeOpenStart
endOpStoreTime := vendorListValue.FakeOpenStop
//startOpStoreTime, endOpStoreTime := GetOpStoreTime(vendorID)
if startTime != 0 && endTime != 0 {
startOpStoreTime = startTime
@@ -236,7 +236,7 @@ func StartOrEndOpStoreEx(ctx *jxcontext.Context, isStart bool, startTime, endTim
if isStart && (startOpStoreTime == 0 || endOpStoreTime == 0) {
continue
}
vendorStoreID := utils.Interface2String(vendorListValue["vendorStoreID"])
vendorStoreID := vendorListValue.VendorStoreID
baseapi.SugarLogger.Debugf("StartOrEndOpStore storeID:%d vendorID:%d vendorStoreID:%s", storeID, vendorID, vendorStoreID)
singleStoreHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
storeSkuNameList, err := singleStoreHandler.GetStoreSkusFullInfo(ctx, task, storeID, vendorStoreID, nil)
@@ -341,8 +341,8 @@ func InitEx() {
if err == nil {
for _, storeInfo := range storeList {
for _, vendorStoreInfo := range storeInfo.StoreMaps {
startOpStoreTime := int16(utils.MustInterface2Int64(vendorStoreInfo["fakeOpenStart"]))
endOpStoreTime := int16(utils.MustInterface2Int64(vendorStoreInfo["fakeOpenStop"]))
startOpStoreTime := vendorStoreInfo.FakeOpenStart
endOpStoreTime := vendorStoreInfo.FakeOpenStop
if startOpStoreTime == 0 || endOpStoreTime == 0 {
continue
}