From ab426e98533edbf473edb6c139b113f733f8ab79 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 13 Nov 2024 11:07:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BE=85=E5=8A=9E=E7=BC=BA=E9=99=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/platform/spi/Platform.java | 10 ++- .../bug/dto/request/BugPageRequest.java | 9 +-- .../bug/dto/request/BugTodoRequest.java | 31 ++++++++ .../metersphere/bug/mapper/ExtBugMapper.java | 7 ++ .../metersphere/bug/mapper/ExtBugMapper.xml | 43 +++++++++-- .../bug/service/BugCommonService.java | 22 ++++++ .../dashboard/controller/ToDoController.java | 76 +++++++++++++++++-- .../service/UserPlatformAccountService.java | 8 ++ 8 files changed, 184 insertions(+), 22 deletions(-) create mode 100644 backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugTodoRequest.java diff --git a/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/spi/Platform.java b/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/spi/Platform.java index 89aa3e8317..9676c7d392 100644 --- a/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/spi/Platform.java +++ b/backend/framework/plugin/plugin-platform-sdk/src/main/java/io/metersphere/plugin/platform/spi/Platform.java @@ -69,7 +69,7 @@ public interface Platform extends ExtensionPoint { List getFormOptions(GetOptionRequest optionsRequest); /** - * 获取第三方平台缺陷状态选项 + * 获取第三方平台缺陷状态流选项 * @param projectConfig 项目配置信息 * @param issueKey 缺陷ID * @param previousStatus 当前状态 @@ -78,6 +78,14 @@ public interface Platform extends ExtensionPoint { */ List getStatusTransitions(String projectConfig, String issueKey, String previousStatus) throws Exception; + /** + * 获取第三方平台缺陷状态流结束状态选项 (用于工作台过滤展示, 不实现则默认都展示第三方平台所有状态) + * @param projectConfig 项目配置信息(暂定, 可能其他平台后续需提供服务集成配置信息) + * @return 平台结束状态流选项 + * @throws Exception 获取平台结束状态异常 + */ + List getStatusTransitionsLastSteps(String projectConfig) throws Exception; + /** * 获取第三方平台关联需求列表 * @param request 需求分页查询参数 diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugPageRequest.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugPageRequest.java index a2f282ce04..08b6d22c2b 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugPageRequest.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugPageRequest.java @@ -17,12 +17,9 @@ public class BugPageRequest extends BasePageRequest { @NotBlank(message = "{bug.project_id.not_blank}") private String projectId; - @Schema(description = "是否回收站") + @Schema(description = "是否回收站, 后台默认设置") private boolean useTrash; - @Schema(description = "是否我的待办, 默认查询全部") - private boolean myTodo = false; - - @Schema(description = "我的待办用户ID, 组合使用: myTodo=true, myTodoUserId=xxx") - private String myTodoUserId; + @Schema(description = "待办参数, 后台默认设置") + private BugTodoRequest todoParam; } diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugTodoRequest.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugTodoRequest.java new file mode 100644 index 0000000000..9be571a4c7 --- /dev/null +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/dto/request/BugTodoRequest.java @@ -0,0 +1,31 @@ +package io.metersphere.bug.dto.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Builder; +import lombok.Data; + +import java.util.List; + +/** + * @author song-cc-rock + * 缺陷待办参数 + */ +@Data +@Builder +public class BugTodoRequest { + + @Schema(description = "当前用户ID") + private String msUserId; + + @Schema(description = "Local状态结束标识集合") + private List msLastStepStatus; + + @Schema(description = "当前对接平台; 非Local时需要") + private String currentPlatform; + + @Schema(description = "当前对接平台用户ID") + private String platformUser; + + @Schema(description = "对接平台状态结束标识集合") + private List platformLastStatus; +} diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.java index 8a9e0b4f2e..aadc4ac757 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.java @@ -28,6 +28,13 @@ public interface ExtBugMapper { @BaseConditionFilter List list(@Param("request") BugPageRequest request, @Param("sort") String sort); + /** + * 获取项目状态流结束标识 + * @param projectId 项目ID + * @return 结束标识集合 + */ + List getLocalLastStepStatusIds(@Param("projectId") String projectId); + /** * 缺陷列表查询 * diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.xml b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.xml index 6c92c0d0ea..8a19f2a1dd 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.xml +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.xml @@ -23,6 +23,11 @@ + +