return proofList
.stream()
.sorted(Comparator.comparing(ProofCheckDTO::getAvailable).reversed()
.thenComparing(Comparator.comparing(ProofCheckDTO::getPromotionAmount).reversed())
.thenComparing(ProofCheckDTO::getEndTime, Comparator.nullsLast(Comparator.naturalOrder()))
.thenComparing(ProofCheckDTO::getProofId, Comparator.nullsLast(Comparator.naturalOrder()))
).map(proofCheckMeta -> {
if (!proofCheckMeta.getAvailable()) {
proofCheckMeta.setPromotionAmount(0);
}
return proofCheckMeta;
}).collect(Collectors.toList());