diff --git a/api-test/backend/src/main/java/io/metersphere/controller/remote/TestPlanController.java b/api-test/backend/src/main/java/io/metersphere/controller/remote/TestPlanController.java
index 8b6f04f508..ce1a7e3073 100644
--- a/api-test/backend/src/main/java/io/metersphere/controller/remote/TestPlanController.java
+++ b/api-test/backend/src/main/java/io/metersphere/controller/remote/TestPlanController.java
@@ -1,8 +1,8 @@
package io.metersphere.controller.remote;
-import io.metersphere.service.remote.RemoteTestPlanService;
import io.metersphere.api.dto.QueryTestPlanRequest;
import io.metersphere.commons.exception.MSException;
+import io.metersphere.service.remote.RemoteTestPlanService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
@@ -22,6 +22,11 @@ public class TestPlanController {
add("test/plan/scenario/case");
}};
+ @PostMapping("/list/all/{goPage}/{pageSize}")
+ public Object planListAll(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestPlanRequest request) {
+ return remoteTestPlanService.planListAll("/test/plan", goPage, pageSize, request);
+ }
+
@GetMapping("/**")
public List getStageOption(HttpServletRequest request) {
excludeApi(request.getRequestURI());
@@ -37,6 +42,7 @@ public class TestPlanController {
/**
* 解决不同模块路径冲突,导致循环调用
* todo 待优化
+ *
* @param url
*/
public void excludeApi(String url) {
diff --git a/api-test/backend/src/main/java/io/metersphere/service/remote/RemoteTestPlanService.java b/api-test/backend/src/main/java/io/metersphere/service/remote/RemoteTestPlanService.java
index 189451e0e4..73e366d639 100644
--- a/api-test/backend/src/main/java/io/metersphere/service/remote/RemoteTestPlanService.java
+++ b/api-test/backend/src/main/java/io/metersphere/service/remote/RemoteTestPlanService.java
@@ -39,4 +39,13 @@ public class RemoteTestPlanService {
return new ArrayList();
}
}
+
+ public Object planListAll(String url, int goPage, int pageSize, QueryTestPlanRequest request) {
+ try {
+ return microService.postForData(MicroServiceName.TEST_TRACK, url + String.format("/list/all/%s/%s", goPage, pageSize), request);
+ } catch (Exception e) {
+ LogUtil.info("测试计划服务调用失败", e);
+ return new ArrayList();
+ }
+ }
}
diff --git a/api-test/frontend/src/api/test-plan.js b/api-test/frontend/src/api/test-plan.js
index 3941a5028f..ab29fdf8ff 100644
--- a/api-test/frontend/src/api/test-plan.js
+++ b/api-test/frontend/src/api/test-plan.js
@@ -7,7 +7,11 @@ export function getPlanStageOption() {
}
export function planPage(page, pageSize, params) {
- return post('/test/plan/list/all/', params);
+ return post('/test/plan/list/all/'+ page + '/' + pageSize, params);
+}
+
+export function testPlanGetPrincipal(id) {
+ return get('/test/plan/' + `principal/${id}`);
}
export function getApiScenarioIdByPlanScenarioId(id) {
diff --git a/api-test/frontend/src/business/automation/scenario/testplan/TestPlanList.vue b/api-test/frontend/src/business/automation/scenario/testplan/TestPlanList.vue
index 2b6285e397..0644d2d551 100644
--- a/api-test/frontend/src/business/automation/scenario/testplan/TestPlanList.vue
+++ b/api-test/frontend/src/business/automation/scenario/testplan/TestPlanList.vue
@@ -34,7 +34,7 @@
show-overflow-tooltip>
@@ -109,6 +109,8 @@
+
{{ $t('test_track.plan.plan_delete_tip') }}
@@ -135,7 +137,7 @@ import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
import {_filter, _sort} from "metersphere-frontend/src/utils/tableUtils";
import EnvPopover from "@/business/automation/scenario/EnvPopover";
import {ENV_TYPE} from "metersphere-frontend/src/utils/constants";
-import {getPlanStageOption, planPage} from "@/api/test-plan";
+import {getPlanStageOption, planPage, testPlanGetPrincipal} from "@/api/test-plan";
import {getApiScenarioProjectIdByConditions, getScenarioByProjectId} from "@/api/scenario";
import {getOwnerProjects} from "@/api/project";
@@ -277,7 +279,27 @@ export default {
this.result = planPage(this.currentPage, this.pageSize, this.condition).then(response => {
let data = response.data;
this.total = data.itemCount;
- this.tableData = data;
+ data.listObject.forEach(item => {
+ testPlanGetPrincipal(item.id)
+ .then(res => {
+ let data = res.data;
+ let principal = "";
+ let principalIds = data.map(d => d.id);
+ if (data) {
+ data.forEach(d => {
+ if (principal !== "") {
+ principal = principal + "、" + d.name;
+ } else {
+ principal = principal + d.name;
+ }
+ })
+ }
+ this.$set(item, "principalName", principal);
+ // 编辑时初始化id
+ this.$set(item, "principals", principalIds);
+ });
+ });
+ this.tableData = data.listObject;
});
},
buildPagePath(path) {
diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.java b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.java
index f32fde8931..7eaee9338d 100644
--- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.java
+++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.java
@@ -1,7 +1,6 @@
package io.metersphere.base.mapper.ext;
import io.metersphere.base.domain.TestPlan;
-
import io.metersphere.dto.ParamsDTO;
import io.metersphere.dto.TestPlanDTOWithMetric;
import io.metersphere.plan.dto.TestPlanDTO;
@@ -39,17 +38,19 @@ public interface ExtTestPlanMapper {
int updateActualEndTimeIsNullById(String testPlanID);
@MapKey("id")
- Map testPlanTestCaseCount(@Param("planIds")Set planIds);
+ Map testPlanTestCaseCount(@Param("planIds") Set planIds);
@MapKey("id")
- Map testPlanApiCaseCount(@Param("planIds")Set planIds);
+ Map testPlanApiCaseCount(@Param("planIds") Set planIds);
@MapKey("id")
- Map testPlanApiScenarioCount(@Param("planIds")Set planIds);
+ Map testPlanApiScenarioCount(@Param("planIds") Set planIds);
@MapKey("id")
- Map testPlanLoadCaseCount(@Param("planIds")Set planIds);
+ Map testPlanLoadCaseCount(@Param("planIds") Set planIds);
@MapKey("id")
- Map testPlanUiScenarioCount(@Param("planIds")Set planIds);
+ Map testPlanUiScenarioCount(@Param("planIds") Set planIds);
+
+ List planListAll(@Param("request") QueryTestPlanRequest params);
}
diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml
index 10f474bf3c..be6eb8fe26 100644
--- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml
+++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml
@@ -406,6 +406,17 @@
GROUP BY t.test_plan_id
+
update test_plan
set actual_end_time = null
diff --git a/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java b/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java
index 467e6c91c7..32484bcde1 100644
--- a/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java
+++ b/test-track/backend/src/main/java/io/metersphere/controller/TestPlanController.java
@@ -88,6 +88,13 @@ public class TestPlanController {
return testPlanService.listTestAllPlan(request);
}
+ @PostMapping("/list/all/{goPage}/{pageSize}")
+ @RequiresPermissions("PROJECT_TRACK_PLAN:READ")
+ public Pager> planListAll(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestPlanRequest request) {
+ Page