diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 978c4cdc..e8cfbd77 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -525,16 +525,17 @@ public class ResourceServiceImpl extends CrudServiceImpl { ResourceDTO index = (ResourceDTO) x; return index.getPinTop() == null ? 0 : index.getPinTop(); - }, Comparator.reverseOrder()) + }).reversed() .thenComparing(x -> { ResourceDTO index = (ResourceDTO) x; int pinTop = index.getPinTop() == null ? 0 : index.getPinTop(); if (pinTop > 0) { - return index.getPinTopTime() == null ? new Date(0).getTime() : index.getPinTopTime().getTime(); + return index.getPinTopTime() == null ? new Date(0).getTime() + pinTop : index.getPinTopTime().getTime() + pinTop; } else { - return new Date(0).getTime(); + return new Date(0).getTime() + pinTop; } - }, Comparator.reverseOrder()).thenComparing(x -> { + }).reversed() + .thenComparing(x -> { ResourceDTO index = (ResourceDTO) x; return index.getTotal() == null ? 0L : index.getTotal(); }, Comparator.reverseOrder()) @@ -543,7 +544,8 @@ public class ResourceServiceImpl extends CrudServiceImpl { ResourceDTO index = (ResourceDTO) x; return index.getPinTop() == null ? 0 : index.getPinTop(); - }, Comparator.reverseOrder()).thenComparing(x -> { + }).reversed() + .thenComparing(x -> { ResourceDTO index = (ResourceDTO) x; int pinTop = index.getPinTop() == null ? 0 : index.getPinTop(); if (pinTop > 0) { @@ -551,7 +553,7 @@ public class ResourceServiceImpl extends CrudServiceImpl { ResourceDTO index = (ResourceDTO) x; return index.getTotal() == null ? 0L : index.getTotal();