https://blog.csdn.net/winter_chen001/article/details/72648512
以下个人使用,感觉原作者的第五行Object o = map.get("obj");
有错误
// region 同物料合并
Map<String, BOMVersionDetail> resultMap = new HashMap<>();
for (BOMVersionDetail bomVersionDetail : orderBomList){
if (resultMap.containsKey(bomVersionDetail.material)){
String material = bomVersionDetail.material;
BOMVersionDetail b = resultMap.get(material);
b.unitQty += bomVersionDetail.unitQty;
resultMap.put(bomVersionDetail.material, b);
} else {
resultMap.put(bomVersionDetail.material, bomVersionDetail);
}
}
//endregion