Merge branch 'master' into docker_package

# Conflicts:
#	renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java
This commit is contained in:
wangliwen 2022-08-15 17:39:45 +08:00
commit 0e18c338e8
1 changed files with 4 additions and 4 deletions

View File

@ -513,6 +513,10 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
resourceDTOS = resourceDao.selectDTOPage(resourceDTO, null, null, null, null, ids);
if ("DESC".equals(orderType)) {
resultPage.setRecords(resourceDTOS.stream().sorted(Comparator.comparing(x -> {
ResourceDTO index = (ResourceDTO) x;
return index.getTotal() == null ? 0L : index.getTotal();
}).reversed()
.thenComparing(x -> {
ResourceDTO index = (ResourceDTO) x;
int pinTop = index.getPinTop() == null ? 0 : index.getPinTop();
if (pinTop > 0) {
@ -521,10 +525,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return new Date(0).getTime() + pinTop;
}
}).reversed()
.thenComparing(x -> {
ResourceDTO index = (ResourceDTO) x;
return index.getTotal() == null ? 0L : index.getTotal();
}, Comparator.reverseOrder())
).collect(Collectors.toList()));
} else {
resultPage.setRecords(resourceDTOS.stream().sorted(Comparator.comparing(x -> {