List<Long> letterBatchIdList = new ArrayList<Long>();
Map<String, List<Long>> productLineCodeGroups = new HashMap<String, List<Long>>();
for (Iterator<TIcmClmLetterBatch> iter = tIcmClmLetterBatchList
.iterator(); iter.hasNext();) {
TIcmClmLetterBatch tIcmClmLetterBatch = iter.next();
if (productLineCodeGroups.containsKey(tIcmClmLetterBatch
.getProductLineCode())) {
List<Long> letterIdList = productLineCodeGroups
.get(tIcmClmLetterBatch.getProductLineCode());
letterIdList.add(tIcmClmLetterBatch.getLetterId());
} else {
List<Long> letterIdList = new ArrayList<Long>();
letterIdList.add(tIcmClmLetterBatch.getLetterId());
productLineCodeGroups.put(tIcmClmLetterBatch.getProductLineCode(),
letterIdList);
}
letterBatchIdList.add(tIcmClmLetterBatch.getId());
}
List 中Map集合key value应用
最新推荐文章于 2021-02-24 17:02:09 发布