From 66551a3b4fff5089000b80dde0c1e51a9f22965f Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 25 Nov 2024 13:52:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E5=BE=85?= =?UTF-8?q?=E5=8A=9E=E8=AE=A1=E5=88=92=E5=88=97=E8=A1=A8=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E6=9C=AA=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1049452 --user=宋昌昌 【工作台】待办-测试计划列表-创建时间-点击排序未生效 https://www.tapd.cn/55049933/s/1616331 --- .../io/metersphere/dashboard/controller/ToDoController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/services/dashboard/src/main/java/io/metersphere/dashboard/controller/ToDoController.java b/backend/services/dashboard/src/main/java/io/metersphere/dashboard/controller/ToDoController.java index d9acd02ec1..cef18c6abd 100644 --- a/backend/services/dashboard/src/main/java/io/metersphere/dashboard/controller/ToDoController.java +++ b/backend/services/dashboard/src/main/java/io/metersphere/dashboard/controller/ToDoController.java @@ -27,6 +27,7 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; @@ -64,7 +65,9 @@ public class ToDoController { @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") public Pager> planPage(@Validated @RequestBody TestPlanTableRequest request) { // 默认按照创建时间倒序 - request.setSort(Map.of("createTime", "desc")); + if (MapUtils.isEmpty(request.getSort())) { + request.setSort(Map.of("createTime", "desc")); + } request.setMyTodo(true); request.setMyTodoUserId(SessionUtils.getUserId()); return testPlanManagementService.page(request);