fix(测试计划): 查询问题#1005198
--bug=1005198 --user=lyh 【测试跟踪】有一个测试计划进入详情后没显示名称 https://www.tapd.cn/55049933/s/1025888
This commit is contained in:
parent
499d062784
commit
8127cab0c9
|
@ -63,9 +63,8 @@ public class TestPlanController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/list/all")
|
@PostMapping("/list/all")
|
||||||
public List<TestPlan> listAll() {
|
public List<TestPlan> listAll(@RequestBody QueryTestPlanRequest request) {
|
||||||
String currentWorkspaceId = SessionUtils.getCurrentWorkspaceId();
|
return testPlanService.listTestAllPlan(request);
|
||||||
return testPlanService.listTestAllPlan(currentWorkspaceId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/list/all/relate")
|
@PostMapping("/list/all/relate")
|
||||||
|
|
|
@ -560,23 +560,15 @@ public class TestPlanService {
|
||||||
return extTestPlanMapper.listRecent(SessionUtils.getUserId(), projectId);
|
return extTestPlanMapper.listRecent(SessionUtils.getUserId(), projectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TestPlan> listTestAllPlan(String currentWorkspaceId) {
|
public List<TestPlan> listTestAllPlan(QueryTestPlanRequest request) {
|
||||||
if (StringUtils.isNotBlank(SessionUtils.getCurrentProjectId())) {
|
String projectId = request.getProjectId();
|
||||||
TestPlanExample testPlanExample = new TestPlanExample();
|
if (StringUtils.isBlank(projectId)) {
|
||||||
TestPlanExample.Criteria criteria = testPlanExample.createCriteria();
|
return new ArrayList<>();
|
||||||
criteria.andProjectIdEqualTo(SessionUtils.getCurrentProjectId());
|
|
||||||
List<TestPlan> testPlans = testPlanMapper.selectByExample(testPlanExample);
|
|
||||||
if (!CollectionUtils.isEmpty(testPlans)) {
|
|
||||||
List<String> testPlanIds = testPlans.stream().map(TestPlan::getId).collect(Collectors.toList());
|
|
||||||
TestPlanExample testPlanExample1 = new TestPlanExample();
|
|
||||||
TestPlanExample.Criteria testPlanCriteria = testPlanExample1.createCriteria();
|
|
||||||
testPlanCriteria.andWorkspaceIdEqualTo(currentWorkspaceId);
|
|
||||||
testPlanCriteria.andIdIn(testPlanIds);
|
|
||||||
return testPlanMapper.selectByExample(testPlanExample1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ArrayList<>();
|
TestPlanExample example = new TestPlanExample();
|
||||||
|
example.createCriteria().andProjectIdEqualTo(projectId);
|
||||||
|
return testPlanMapper.selectByExample(example);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TestPlanDTOWithMetric> listRelateAllPlan() {
|
public List<TestPlanDTOWithMetric> listRelateAllPlan() {
|
||||||
|
|
|
@ -48,6 +48,7 @@ import TestPlanApi from "./comonents/api/TestPlanApi";
|
||||||
import TestCaseStatisticsReportView from "./comonents/report/statistics/TestCaseStatisticsReportView";
|
import TestCaseStatisticsReportView from "./comonents/report/statistics/TestCaseStatisticsReportView";
|
||||||
import TestReportTemplateList from "./comonents/TestReportTemplateList";
|
import TestReportTemplateList from "./comonents/TestReportTemplateList";
|
||||||
import TestPlanLoad from "@/business/components/track/plan/view/comonents/load/TestPlanLoad";
|
import TestPlanLoad from "@/business/components/track/plan/view/comonents/load/TestPlanLoad";
|
||||||
|
import {getCurrentProjectID} from "@/common/js/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestPlanView",
|
name: "TestPlanView",
|
||||||
|
@ -114,7 +115,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getTestPlans() {
|
getTestPlans() {
|
||||||
this.$post('/test/plan/list/all', {}, response => {
|
this.$post('/test/plan/list/all', {projectId: getCurrentProjectID()}, response => {
|
||||||
this.testPlans = response.data;
|
this.testPlans = response.data;
|
||||||
this.testPlans.forEach(plan => {
|
this.testPlans.forEach(plan => {
|
||||||
if (this.planId && plan.id === this.planId) {
|
if (this.planId && plan.id === this.planId) {
|
||||||
|
|
Loading…
Reference in New Issue