Map<Integer, List<Integer>> orderId_CommodityIdMap;
key => 订单id value => 该订单id 对应商品id 的list
_
Map<Integer, SimpleCommodity> commodityId_SimpleCommodityMap;
key => 商品id value => 商品信息
_
Map<Integer, List<SimpleCommodity>> orderId_SimpleCommodityMap;
key => 订单id value => 该订单id 对应商品信息 的list
_
要通过 前2个 推出第3 个
Map<Integer, List<SimpleCommodity>> orderId_SimpleCommodityMap = new HashMap<>();
for (Map.Entry<Integer, List<Integer>> entry : orderId_CommodityIdMap.entrySet()){
List<Integer> cIdList = entry.getValue();
List<SimpleCommodity> simpleCommodityList = new ArrayList<>();
for (Integer cId : cIdList)
simpleCommodityList.add(commodityId_SimpleCommodityMap.get(cId));
orderId_SimpleCommodityMap.put(entry.getKey(),simpleCommodityList);
}
这段逻辑可以用 stream实现吗