From afbfd42c0701852c4298fcdcc32c7d04097c3062 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 17 Aug 2022 09:13:05 +0800 Subject: [PATCH] ... --- .../resource/service/impl/ResourceServiceImpl.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 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 a0c10375..cc7f7e6d 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 @@ -35,7 +35,6 @@ import io.renren.modules.resource.entity.ResourceEntity; import io.renren.modules.resource.entity.ResourceEntityDelFlag; import io.renren.modules.resource.entity.TbDataResourceRelEntity; import io.renren.modules.resource.service.ResourceService; -import io.renren.modules.resourceBrowse.dao.ResourceBrowseDao; import io.renren.modules.resourceCar.dao.ResourceCarDao; import io.renren.modules.resourceCollection.dao.ResourceCollectionDao; import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO; @@ -474,7 +473,7 @@ public class ResourceServiceImpl extends CrudServiceImpl Long.valueOf(x.get("id").toString())).limit(pageSize).collect(Collectors.toList()); return temp; @@ -484,14 +483,14 @@ public class ResourceServiceImpl extends CrudServiceImpl { List temp = selectDTOPageSpecilTotal.parallelStream().map(Map.class::cast) .sorted(Comparator.comparing(x -> { - Map index = x; + Map index = (Map) x; int pingTOp_ = (index.get("pin_top") == null) ? 0 : Integer.parseInt(index.get("pin_top").toString()); - String string = (index.get("total") == null) ? "0" : index.get("total").toString(); + String total = (index.get("total") == null) ? "0" : index.get("total").toString(); if (pingTOp_ <= 0) { - return 0l + Long.valueOf(string); + return 0l + Long.valueOf(total) == 0 ? -1 : Long.valueOf(total); } - long pingTOp = (index.get("pin_top_time") == null) ? 0 + Long.valueOf(string) : Long.parseLong(index.get("pin_top_time").toString()) + Long.valueOf(string); - return pingTOp; + long pingTOp = (index.get("pin_top_time") == null) ? 0 + (Long.valueOf(total) == 0 ? -1 : Long.valueOf(total)) : Long.parseLong(index.get("pin_top_time").toString()) + Long.valueOf(total); + return (pingTOp % 1000) == 0 ? -1 : pingTOp % 1000; })).skip((pageNum - 1) * pageSize).limit(pageSize).map(x -> Long.valueOf(x.get("id").toString())).limit(pageSize).collect(Collectors.toList()); return temp; }).get();