private Map<String, List<CreditContractSignSerial>> listGroup2MapTwo(List<CreditContractSignSerial> list) {
Map<String, List<CreditContractSignSerial>> userSignSerialMap = Maps.newConcurrentMap();
if (CollectionUtils.isNotEmpty(list)) {
// 分组
for (CreditContractSignSerial vo : list) {
String transDate = new SimpleDateFormat("yyyyMMdd").format(vo.getCreateTime());
List<CreditContractSignSerial> tempList = userSignSerialMap.get(transDate);
/*如果取不到数据,那么直接new一个空的ArrayList**/
if (tempList == null) {
tempList = Lists.newArrayList();
tempList.add(vo);
userSignSerialMap.put(transDate, tempList);
}
else {
/*某个vo之前已经存放过了,则直接追加数据到原来的List里**/
tempList.add(vo);
}
}
}
return userSignSerialMap;
}
转载于:https://www.cnblogs.com/move22/p/10429060.html