Map<Long, String>map = GetShopCategories.map(); for(Long key : map.keySet()) { List<StockItem> stockItems_all = queryStock.qureyStockByShop(map.get(key)); System.out.println("获取全量库存为:" + stockItems_all.size()); indexList.addAll(stockItems_all); }
2 回答
Frank作家
TA贡献37条经验 获得超9个赞
Iterator<Map.Entry<Integer, String>> it = map.entrySet().iterator(); while (it.hasNext()) { Map.Entry<Integer, String> entry = it.next(); //System.out.println("key= " + entry.getKey() + " and value= " + entry.getValue()); List<StockItem> stockItems_all = queryStock.qureyStockByShop(entry.getKey()); System.out.println("获取全量库存为:" + stockItems_all.size()); indexList.addAll(stockItems_all); }
Frank作家
TA贡献37条经验 获得超9个赞
具体不知道你的List<StockItem> stockItems_all = queryStock.qureyStockByShop(map.get(key));
这一步的方法对不对
添加回答
举报
0/150
提交
取消