java中对list集合进行分组
Map<String, List<HealthImport>> excelIdCardNull = importList.stream() .filter(temp -> temp.getIdcard() == null) .collect(Collectors.groupingBy( p -> p.getIdcard()+'_'+p.getName()));
分组之后进行取出第一条数据
List<HealthImport> userHealthImport = excelMap.values().stream().map(p -> p.get(0)).collect(Collectors.toList());
获取数据中前 60 天的数据
List<RetAnswerDTO> appointMessages = getSchoolCheckAnswerDetails(QueryChildBodyCheckDTO.builder() .beginDate(LocalDateUtil.localDate2Date(LocalDate.now().minusDays(60))).build(),userHealthImport);
原创文章,作者:,如若转载,请注明出处:https://blog.ytso.com/275594.html