List<String> memberIdList = list.stream().map(AssignDto::getMemberId)
.collect(Collectors.toList());
Map<String, OrderVo> unMemberMap = orderVo.stream()
.collect(Collectors.toMap(OrderVo::getMemberId,o -> o));
Map<String, AssignDto> complatesMap = complateBalances.stream()
.collect(Collectors.toMap(BusinessApplyBalance::getApplyPartyCode,
balance -> new AssignDto(balance.getApplyPartyCode(), balance.getApplyChargeCode(),
balance.getAmount(), CommonConstant.NO_AMOUNT)));
List<FundVoucherBalanceVo> sortList = r.stream().sorted(Comparator.comparing(FundVoucherBalanceVo::getStatus).
thenComparing(FundVoucherBalanceVo::getValidTime,Comparator.nullsLast(Date::compareTo)).reversed()).collect(Collectors.toList());
Map<String, List<TbAlgorithmVo>> algorithmVoMap
、List<Map.Entry<String, List<TbAlgorithmVo>>> algorithmVoMapList = algorithmVoMap.entrySet().stream()
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue(Comparator.comparingInt(List::size))))
.collect(Collectors.toList());
List<SysMenu> listNew2 = listNew.stream()
.sorted(Comparator.comparing(SysMenu::getOrderNum,(x,y)->{
if(x == null && y != null){
return 1;
}else if(x !=null && y == null){
return -1;
}else if(x == null && y == null){
return -1;
}else{
//按照读取的list顺序排序
for(SysMenu menu : listNew){
if(menu.getOrderNum().equals(x) || menu.getOrderNum().equals(y)){
if(x.equals(y)){
return 0;
}else if(menu.getOrderNum().equals(x)){
return -1;
}else{
return 1;
}
}
}
return 0;
}
})).collect(Collectors.toList());
List<BusinessApplyBalance> processBalances = results.stream()
.filter(balance -> !balance.getStatus().equals(BusinessApplyStatus.COMPLETED.getCateCode()))
.collect(Collectors.toList());
List<AssignDto> soldProxyAmountList = r.getData().stream().map(balance -> new AssignDto(balance.getMemberId(),
balance.getGuid(), balance.getSaleAmountMonth().subtract(balance.getSaledAmountMonth()),
CommonConstant.NO_AMOUNT))
.collect(Collectors.toList());
Map<String, Long> groupByMemberIdAmount = leftCouponAmounts.stream().collect(Collectors.groupingBy(
o -> o.getMemberId(), Collectors.summingLong(o -> o.getBalanceAmount().longValue())));
Map<String, List<UserAttendanceClockPeriodVo>> userRegistRecordMap = clockVoList.stream().collect(Collectors.toMap(UserAttendanceClockPeriodVo::getUserId, part ->
Lists.newArrayList(part),(List<UserAttendanceClockPeriodVo> newValueList,List<UserAttendanceClockPeriodVo> oldValueList)-> {
oldValueList.addAll(newValueList);
return oldValueList;
}));
第二种
Map<String, List<TbAlgorithmVo>> algorithmVoMap = algoVoList.stream()
.collect(Collectors.groupingBy(TbAlgorithmVo::getIndustrySceneNames));
List<TbCusAlarmRecordBO> alarmRecordList = BeanCopyUtils.copyListProperties(alarmRecordLists, TbCusAlarmRecordBO::new,
(s, t) -> {
t.setAlarmType(s.getAlarmType());
t.setAlarmTime(s.getAlarmTime());
TbCusAreaBO tbCusAreaBO = areaBOMap.get(s.getCameraGbtId());
t.setAreaCode(tbCusAreaBO.getAreaCode());
t.setAddress(tbCusAreaBO.getAddress());
});
因篇幅问题不能全部显示,请点此查看更多更全内容