From 58ba499f79d850df90eb5aabe2f3e81c654ec386 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 19 Jul 2022 16:47:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=82=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../renren/modules/activiti/service/ActTaskService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java index 4a804305..f3d58814 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java @@ -192,7 +192,13 @@ public class ActTaskService extends BaseServiceImpl { page.setTotal(0); } else { ArrayList recordLists = new ArrayList<>(); - recordLists.addAll(taskDtoList.stream().distinct().skip((curPage - 1) * limit).limit(limit).collect(Collectors.toList())); + recordLists.addAll(taskDtoList.stream() + .sorted(Comparator.comparing(TaskDTO::getCreateTime).reversed()) + .distinct() + .skip((curPage - 1) * limit) + .limit(limit) + .collect(Collectors.toList()) + ); page.setRecords(recordLists); page.setTotal(count.stream().mapToLong(index -> index.longValue()).sum()); } From 6954af5ba4ee4a129698385fcb459357658bcda6 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 19 Jul 2022 16:52:40 +0800 Subject: [PATCH 2/2] deal with --- .../io/renren/modules/activiti/service/ActTaskService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java index f3d58814..580bd6db 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java @@ -193,9 +193,8 @@ public class ActTaskService extends BaseServiceImpl { } else { ArrayList recordLists = new ArrayList<>(); recordLists.addAll(taskDtoList.stream() - .sorted(Comparator.comparing(TaskDTO::getCreateTime).reversed()) .distinct() - .skip((curPage - 1) * limit) + .sorted(Comparator.comparing(TaskDTO::getCreateTime).reversed()) .limit(limit) .collect(Collectors.toList()) );