java8 stream groupingby多個條件的問題
Posted on 2016-03-22 16:14 skycity 閱讀(11376) 評論(0) 編輯 收藏 所屬分類: J2EE技術@import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
@import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
@import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
@import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
@import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
Lyyb2001
Map<Integer,Map<String,List<DocLotDetail>>> amp = docLotDetailLists.parallelStream().collect(Collectors.groupingBy(DocLotDetail::getGroupOrder,Collectors.groupingBy(DocLotDetail::getBaseValueName)));
amp.forEach((key,value)->{
System.out.println(key);
value.forEach((key2,value2)->{
System.out.println(key2);
});
});
最終返回的結果
2
隨機光盤
3
資料袋附件
4
資料盒附件
5
包裝輔料
8
前工序物料
Lyyb2001