@
anonydmer 补充完整了点:public Optional<MyLog> lastLog(final Collection<Long> shopIds) {
return Optional.ofNullable(CollectionUtil.isEmpty(shopIds) ? null : shopIds)
.map(shopIdList -> Pair.of(shopIdList, appDao.findAllId()))
.map(pair -> pair.getFirst()
.stream()
.flatMap(shopId -> {
final LocalDate end = LocalDate.now().plusDays(1);
return pair.getSecond().stream().flatMap(appId -> logDao.findLast(appId, shopId, end).stream());
})
.max(Comparator.comparing(MyLog::getTime)))
.orElse(Optional.empty());
}