//这个解决问题
Comparator<Anjianxinxi> getLianriqi = Comparator.comparing(Anjianxinxi::getLianriqi).reversed(); Comparator<Anjianxinxi> getCaiChanLastTime = Comparator.comparing(Anjianxinxi::getCaiChanLastTime).reversed(); records.sort(getLianriqi.thenComparing(getCaiChanLastTime)); //这个单个好使,组合不好使,不明白咋回事 // records.stream() // .sorted(Comparator.comparing(Anjianxinxi::getLianriqi).reversed().thenComparing(Anjianxinxi::getCaiChanLastTime).reversed()) // .collect(Collectors.toList()); // records.sort(Comparator.comparing(Anjianxinxi::getLianriqi).reversed().thenComparing(Anjianxinxi::getCaiChanLastTime).reversed());