diff --git a/backend/framework/sdk/src/main/resources/i18n/commons_en_US.properties b/backend/framework/sdk/src/main/resources/i18n/commons_en_US.properties index 91d039593e..fb1385589f 100644 --- a/backend/framework/sdk/src/main/resources/i18n/commons_en_US.properties +++ b/backend/framework/sdk/src/main/resources/i18n/commons_en_US.properties @@ -597,4 +597,5 @@ user_view.all_data=All data user_view.my_follow=I followed user_view.my_create=I created user_view.my_review=I review +user_view.archived=Archived user_view_exist=The view already exists \ No newline at end of file diff --git a/backend/framework/sdk/src/main/resources/i18n/commons_zh_CN.properties b/backend/framework/sdk/src/main/resources/i18n/commons_zh_CN.properties index 994f04cde5..72613c2103 100644 --- a/backend/framework/sdk/src/main/resources/i18n/commons_zh_CN.properties +++ b/backend/framework/sdk/src/main/resources/i18n/commons_zh_CN.properties @@ -592,4 +592,5 @@ user_view.all_data=全部数据 user_view.my_follow=我关注的 user_view.my_create=我创建的 user_view.my_review=我评审的 +user_view.archived=已归档 user_view_exist=视图已存在 \ No newline at end of file diff --git a/backend/framework/sdk/src/main/resources/i18n/commons_zh_TW.properties b/backend/framework/sdk/src/main/resources/i18n/commons_zh_TW.properties index ec1f993361..ad2591e573 100644 --- a/backend/framework/sdk/src/main/resources/i18n/commons_zh_TW.properties +++ b/backend/framework/sdk/src/main/resources/i18n/commons_zh_TW.properties @@ -592,4 +592,5 @@ user_view.all_data=全部數據 user_view.my_follow=我關注的 user_view.my_create=我創建的 user_view.my_review=我評審的 +user_view.archived=已歸檔 user_view_exist=視圖已存在 \ No newline at end of file diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/constants/InternalUserView.java b/backend/services/system-setting/src/main/java/io/metersphere/system/constants/InternalUserView.java index 9d34b0321a..d918adce49 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/constants/InternalUserView.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/constants/InternalUserView.java @@ -44,6 +44,15 @@ public enum InternalUserView { condition.setOperator(CombineCondition.CombineConditionOperator.IN.name()); userViewDTO.setConditions(List.of(condition)); return userViewDTO; + }), + ARCHIVED(() -> { + UserViewDTO userViewDTO = getUserViewDTO("archived"); + CombineCondition condition = new CombineCondition(); + condition.setName("archived"); + condition.setValue("ARCHIVED"); + condition.setOperator(CombineCondition.CombineConditionOperator.EQUALS.name()); + userViewDTO.setConditions(List.of(condition)); + return userViewDTO; }); private static UserViewDTO getUserViewDTO(String name) { diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/constants/UserViewType.java b/backend/services/system-setting/src/main/java/io/metersphere/system/constants/UserViewType.java index 9e49c20e9a..06efa5a98c 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/constants/UserViewType.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/constants/UserViewType.java @@ -8,10 +8,9 @@ import java.util.List; /** * @Author: jianxing * @CreateTime: 2024-09-02 10:47 - * + *

* 视图的类型 * 例如:功能用例视图 - * */ public enum UserViewType implements ValueEnum { @@ -54,8 +53,23 @@ public enum UserViewType implements ValueEnum { PLAN_API_SCENARIO_DRAWER("plan-api-scenario-drawer", List.of(InternalUserView.ALL_DATA, InternalUserView.MY_CREATE)), PLAN_BUG_DRAWER("plan-bug-drawer", - List.of(InternalUserView.ALL_DATA, InternalUserView.MY_CREATE)); + List.of(InternalUserView.ALL_DATA, InternalUserView.MY_CREATE)), + /** + * 测试计划列表 + */ + TEST_PLAN_ALL("test-plan-all", + List.of(InternalUserView.ALL_DATA, InternalUserView.ARCHIVED, InternalUserView.MY_CREATE)), + TEST_PLAN("test-plan", + List.of(InternalUserView.ALL_DATA, InternalUserView.ARCHIVED, InternalUserView.MY_FOLLOW, InternalUserView.MY_CREATE)), + TEST_PLAN_GROUP("test-plan-group", + List.of(InternalUserView.ALL_DATA, InternalUserView.ARCHIVED, InternalUserView.MY_CREATE)), + + /** + * 测试计划报告 + */ + TEST_PLAN_REPORT("test-plan-report", + List.of(InternalUserView.ALL_DATA, InternalUserView.MY_CREATE)); private String value; private List internalViews; diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.java index a0744c3b73..1611b53905 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.java @@ -11,6 +11,7 @@ import io.metersphere.plan.dto.response.TestPlanResponse; import io.metersphere.project.dto.DropNode; import io.metersphere.project.dto.ModuleCountDTO; import io.metersphere.project.dto.NodeSortQueryParam; +import io.metersphere.system.interceptor.BaseConditionFilter; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -20,6 +21,7 @@ public interface ExtTestPlanMapper { List selectByGroupIdList(@Param("list") List parentTestPlanId); + @BaseConditionFilter List selectByConditions(@Param("request") TestPlanTableRequest request); List selectIdByConditions(@Param("request") TestPlanBatchProcessRequest request); diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml index eddeef7350..f319b0a4cf 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/mapper/ExtTestPlanMapper.xml @@ -113,7 +113,7 @@ - + - + + + @@ -147,7 +149,61 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <!– 名称 –> t.name @@ -168,7 +224,7 @@ - + <!– id –> t.num @@ -178,7 +234,7 @@ - + <!– 所属模块 –> t.moduleId @@ -188,7 +244,7 @@ - + <!– 创建人 –> t.create_user @@ -198,7 +254,7 @@ - + <!– 创建时间 –> t.create_time @@ -208,16 +264,16 @@ - + <!– 标签 –> - + --> - + - - + + <!– 包含 –> JSON_CONTAINS(t.tags, JSON_ARRAY(#{tag})) @@ -251,14 +307,14 @@ - + <!– 空 –> (t.tags is null or t.tags = '[]') - + -->