测试跟踪首页
This commit is contained in:
parent
ff387a1b0c
commit
7364f84da0
|
@ -42,7 +42,8 @@
|
|||
#{planId}
|
||||
</foreach>
|
||||
</if>
|
||||
);
|
||||
)
|
||||
order by test_plan.update_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -16,4 +16,8 @@ public interface ExtTestPlanTestCaseMapper {
|
|||
List<TestPlanCaseDTO> list(@Param("request") QueryTestPlanCaseRequest request);
|
||||
|
||||
List<String> findRelateTestPlanId(String userId);
|
||||
|
||||
List<TestPlanCaseDTO> getRecentTestedTestCase(@Param("request") QueryTestPlanCaseRequest request);
|
||||
|
||||
List<TestPlanCaseDTO> getPendingTestCases(@Param("request") QueryTestPlanCaseRequest request);
|
||||
}
|
||||
|
|
|
@ -59,8 +59,31 @@
|
|||
</select>
|
||||
|
||||
<select id="findRelateTestPlanId" resultType="java.lang.String">
|
||||
select distinct plan_id from test_plan_test_case where executor = #{userId};
|
||||
select distinct plan_id from test_plan_test_case where executor = #{userId}
|
||||
</select>
|
||||
<select id="getRecentTestedTestCase" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||
select test_plan_test_case.*, test_case.*
|
||||
from test_plan_test_case
|
||||
inner join test_case on test_plan_test_case.case_id = test_case.id
|
||||
where status != 'Prepare'
|
||||
and status != 'Underway'
|
||||
and test_plan_test_case.Executor = #{request.executor}
|
||||
and test_plan_test_case.plan_id in
|
||||
<foreach collection="request.planIds" item="planId" separator="," open="(" close=")">
|
||||
#{planId}
|
||||
</foreach>
|
||||
order by test_plan_test_case.update_time desc
|
||||
</select>
|
||||
<select id="getPendingTestCases" resultType="io.metersphere.track.dto.TestPlanCaseDTO">
|
||||
select test_plan_test_case.*, test_case.*
|
||||
from test_plan_test_case
|
||||
inner join test_case on test_plan_test_case.case_id = test_case.id
|
||||
where (status = 'Prepare' or status = 'Underway')
|
||||
and test_plan_test_case.Executor = #{request.executor}
|
||||
and test_plan_test_case.plan_id in
|
||||
<foreach collection="request.planIds" item="planId" separator="," open="(" close=")">
|
||||
#{planId}
|
||||
</foreach>
|
||||
order by test_plan_test_case.update_time asc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -24,12 +24,22 @@ public class TestPlanTestCaseController {
|
|||
@PostMapping("/list/{goPage}/{pageSize}")
|
||||
public Pager<List<TestPlanCaseDTO>> getTestPlanCases(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryTestPlanCaseRequest request){
|
||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
return PageUtils.setPageInfo(page, testPlanTestCaseService.getTestPlanCases(request));
|
||||
return PageUtils.setPageInfo(page, testPlanTestCaseService.list(request));
|
||||
}
|
||||
|
||||
@PostMapping("recent/{count}")
|
||||
public List<TestPlanCaseDTO> getRecentTestCases(@PathVariable int count, @RequestBody QueryTestPlanCaseRequest request){
|
||||
return testPlanTestCaseService.getRecentTestCases(request, count);
|
||||
}
|
||||
|
||||
@PostMapping("pending/{count}")
|
||||
public List<TestPlanCaseDTO> getPrepareTestCases(@PathVariable int count, @RequestBody QueryTestPlanCaseRequest request){
|
||||
return testPlanTestCaseService.getPendingTestCases(request, count);
|
||||
}
|
||||
|
||||
@PostMapping("/list/all")
|
||||
public List<TestPlanCaseDTO> getTestPlanCases(@RequestBody QueryTestPlanCaseRequest request){
|
||||
return testPlanTestCaseService.getTestPlanCases(request);
|
||||
return testPlanTestCaseService.list(request);
|
||||
}
|
||||
|
||||
@PostMapping("/edit")
|
||||
|
|
|
@ -18,6 +18,8 @@ public class QueryTestPlanCaseRequest extends TestPlanTestCase {
|
|||
|
||||
private Map<String, List<String>> filters;
|
||||
|
||||
private List<String> planIds;
|
||||
|
||||
private String workspaceId;
|
||||
|
||||
private String name;
|
||||
|
|
|
@ -144,7 +144,6 @@ public class TestPlanService {
|
|||
QueryTestPlanRequest request = new QueryTestPlanRequest();
|
||||
request.setPrincipal(user.getId());
|
||||
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||
request.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||
request.setPlanIds(extTestPlanTestCaseMapper.findRelateTestPlanId(user.getId()));
|
||||
return extTestPlanMapper.listRelate(request);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package io.metersphere.track.service;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.metersphere.base.domain.TestPlanTestCase;
|
||||
import io.metersphere.base.domain.TestPlanTestCaseExample;
|
||||
import io.metersphere.base.domain.User;
|
||||
import io.metersphere.base.mapper.TestPlanTestCaseMapper;
|
||||
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
|
||||
import io.metersphere.commons.constants.TestPlanTestCaseStatus;
|
||||
import io.metersphere.commons.user.SessionUser;
|
||||
import io.metersphere.commons.utils.BeanUtils;
|
||||
import io.metersphere.commons.utils.SessionUtils;
|
||||
import io.metersphere.controller.request.member.QueryMemberRequest;
|
||||
|
@ -18,6 +20,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -35,7 +38,7 @@ public class TestPlanTestCaseService {
|
|||
@Resource
|
||||
ExtTestPlanTestCaseMapper extTestPlanTestCaseMapper;
|
||||
|
||||
public List<TestPlanCaseDTO> getTestPlanCases(QueryTestPlanCaseRequest request) {
|
||||
public List<TestPlanCaseDTO> list(QueryTestPlanCaseRequest request) {
|
||||
List<TestPlanCaseDTO> list = extTestPlanTestCaseMapper.list(request);
|
||||
QueryMemberRequest queryMemberRequest = new QueryMemberRequest();
|
||||
queryMemberRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||
|
@ -69,4 +72,29 @@ public class TestPlanTestCaseService {
|
|||
testPlanTestCase,
|
||||
testPlanTestCaseExample);
|
||||
}
|
||||
|
||||
public List<TestPlanCaseDTO> getRecentTestCases(QueryTestPlanCaseRequest request, int count) {
|
||||
buildQueryRequest(request, count);
|
||||
if (request.getPlanIds().isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return extTestPlanTestCaseMapper.getRecentTestedTestCase(request);
|
||||
}
|
||||
|
||||
public List<TestPlanCaseDTO> getPendingTestCases(QueryTestPlanCaseRequest request, int count) {
|
||||
buildQueryRequest(request, count);
|
||||
if (request.getPlanIds().isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return extTestPlanTestCaseMapper.getPendingTestCases(request);
|
||||
}
|
||||
|
||||
public void buildQueryRequest(QueryTestPlanCaseRequest request, int count) {
|
||||
SessionUser user = SessionUtils.getUser();
|
||||
List<String> relateTestPlanIds = extTestPlanTestCaseMapper.findRelateTestPlanId(user.getId());
|
||||
PageHelper.startPage(1, count, true);
|
||||
request.setPlanIds(relateTestPlanIds);
|
||||
request.setExecutor(user.getId());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
<div class="container">
|
||||
<div class="main-content">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-col :span="15">
|
||||
<related-test-plan-list/>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="9">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<recent-test-case-list/>
|
||||
|
@ -32,4 +32,8 @@
|
|||
|
||||
<style scoped>
|
||||
|
||||
.main-content >>> .el-table {
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -2,15 +2,70 @@
|
|||
|
||||
<home-base-component :title="'待测试'">
|
||||
|
||||
<el-table
|
||||
row-key="id"
|
||||
:data="tableData">
|
||||
|
||||
<el-table-column
|
||||
prop="name"
|
||||
:label="$t('commons.name')"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="priority"
|
||||
:label="$t('test_track.case.priority')">
|
||||
<template v-slot:default="scope">
|
||||
<priority-table-item :value="scope.row.priority" ref="priority"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="type"
|
||||
:label="$t('test_track.case.type')"
|
||||
show-overflow-tooltip>
|
||||
<template v-slot:default="scope">
|
||||
<type-table-item :value="scope.row.type"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="status"
|
||||
:label="$t('test_track.plan_view.execute_result')">
|
||||
<template v-slot:default="scope">
|
||||
<status-table-item :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
</home-base-component>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HomeBaseComponent from "./HomeBaseComponent";
|
||||
import PriorityTableItem from "../../common/tableItems/planview/PriorityTableItem";
|
||||
import TypeTableItem from "../../common/tableItems/planview/TypeTableItem";
|
||||
import StatusTableItem from "../../common/tableItems/planview/StatusTableItem";
|
||||
export default {
|
||||
name: "PendingTestCaseList",
|
||||
components: {HomeBaseComponent}
|
||||
components: {StatusTableItem, TypeTableItem, PriorityTableItem, HomeBaseComponent},
|
||||
data() {
|
||||
return {
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initTableData();
|
||||
},
|
||||
methods: {
|
||||
initTableData() {
|
||||
this.result = this.$post('/test/plan/case/pending/5', {}, response => {
|
||||
this.tableData = response.data;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,14 +1,71 @@
|
|||
<template>
|
||||
|
||||
<home-base-component :title="'最近测试'"/>
|
||||
<home-base-component :title="'最近测试'">
|
||||
|
||||
<el-table
|
||||
row-key="id"
|
||||
:data="tableData">
|
||||
|
||||
<el-table-column
|
||||
prop="name"
|
||||
:label="$t('commons.name')"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="priority"
|
||||
:label="$t('test_track.case.priority')">
|
||||
<template v-slot:default="scope">
|
||||
<priority-table-item :value="scope.row.priority" ref="priority"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="type"
|
||||
:label="$t('test_track.case.type')"
|
||||
show-overflow-tooltip>
|
||||
<template v-slot:default="scope">
|
||||
<type-table-item :value="scope.row.type"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="status"
|
||||
:label="$t('test_track.plan_view.execute_result')">
|
||||
<template v-slot:default="scope">
|
||||
<status-table-item :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
</home-base-component>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HomeBaseComponent from "./HomeBaseComponent";
|
||||
import StatusTableItem from "../../common/tableItems/planview/StatusTableItem";
|
||||
import TypeTableItem from "../../common/tableItems/planview/TypeTableItem";
|
||||
import PriorityTableItem from "../../common/tableItems/planview/PriorityTableItem";
|
||||
export default {
|
||||
name: "RecentTestCaseList",
|
||||
components: {HomeBaseComponent}
|
||||
components: {PriorityTableItem, TypeTableItem, StatusTableItem, HomeBaseComponent},
|
||||
data() {
|
||||
return {
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initTableData();
|
||||
},
|
||||
methods: {
|
||||
initTableData() {
|
||||
this.result = this.$post('/test/plan/case/recent/5', {}, response => {
|
||||
this.tableData = response.data;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<home-base-component :title="'测试计划'">
|
||||
<home-base-component :title="'我的计划'">
|
||||
|
||||
<el-table
|
||||
:data="tableData"
|
||||
|
@ -92,9 +92,4 @@
|
|||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.el-table {
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue