From 6e9868e0f7a6ff8944a0691f7ccc26a105181adc Mon Sep 17 00:00:00 2001 From: wangliwen Date: Mon, 15 Aug 2022 17:05:33 +0800 Subject: [PATCH] ... --- .../service/impl/ResourceServiceImpl.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) 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 32edef91..1d3d97ea 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 @@ -472,6 +472,11 @@ public class ResourceServiceImpl extends CrudServiceImpl { List temp = selectDTOPageSpecilTotal.parallelStream().map(Map.class::cast) .sorted(Comparator.comparing(x -> { + Map index = (Map) x; + String string = (index.get("total") == null) ? "0" : index.get("total").toString(); + return Long.valueOf(string); + }).reversed() + .thenComparing(x -> { Map index = (Map) x; int pingTOp_ = (index.get("pin_top") == null) ? 0 : Integer.parseInt(index.get("pin_top").toString()); if (pingTOp_ <= 0) { @@ -479,11 +484,6 @@ public class ResourceServiceImpl extends CrudServiceImpl { - Map index = (Map) x; - String string = (index.get("total") == null) ? "0" : index.get("total").toString(); - return Long.valueOf(string); }, Comparator.reverseOrder()) ).skip((long) (pageNum - 1) * pageSize).limit(pageSize).map(x -> Long.valueOf(x.get("id").toString())).limit(pageSize).collect(Collectors.toList()); return temp; @@ -493,6 +493,11 @@ public class ResourceServiceImpl extends CrudServiceImpl { List temp = selectDTOPageSpecilTotal.parallelStream().map(Map.class::cast) .sorted(Comparator.comparing(x -> { + Map index = (Map) x; + String string = (index.get("total") == null) ? "0" : index.get("total").toString(); + return Long.valueOf(string); + }) + .thenComparing(x -> { Map index = (Map) x; int pingTOp_ = (index.get("pin_top") == null) ? 0 : Integer.parseInt(index.get("pin_top").toString()); if (pingTOp_ <= 0) { @@ -500,12 +505,7 @@ public class ResourceServiceImpl extends CrudServiceImpl { - Map index = (Map) x; - String string = (index.get("total") == null) ? "0" : index.get("total").toString(); - return Long.valueOf(string); - })).skip((pageNum - 1) * pageSize).limit(pageSize).map(x -> Long.valueOf(x.get("id").toString())).limit(pageSize).collect(Collectors.toList()); + }).reversed()).skip((pageNum - 1) * pageSize).limit(pageSize).map(x -> Long.valueOf(x.get("id").toString())).limit(pageSize).collect(Collectors.toList()); return temp; }).get(); break;