测试用例执行人显示名称

This commit is contained in:
chenjianxing 2020-05-09 19:26:42 +08:00
parent e50241158f
commit b941ffebf5
5 changed files with 20 additions and 9 deletions

View File

@ -19,5 +19,4 @@ public class QueryTestPlanCaseRequest extends TestPlanTestCase {
private String workspaceId;
private String name;
}

View File

@ -1,6 +1,5 @@
package io.metersphere.dto;
import io.metersphere.base.domain.TestCase;
import io.metersphere.base.domain.TestCaseWithBLOBs;
import lombok.Data;
@ -8,6 +7,7 @@ import lombok.Data;
public class TestPlanCaseDTO extends TestCaseWithBLOBs {
private String executor;
private String executorName;
private String status;
private String results;
}

View File

@ -2,20 +2,25 @@ package io.metersphere.service;
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.ExtTestCaseMapper;
import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper;
import io.metersphere.commons.constants.TestPlanTestCaseStatus;
import io.metersphere.commons.utils.BeanUtils;
import io.metersphere.controller.request.member.QueryMemberRequest;
import io.metersphere.controller.request.testcase.TestPlanCaseBatchRequest;
import io.metersphere.controller.request.testplancase.QueryTestPlanCaseRequest;
import io.metersphere.dto.TestPlanCaseDTO;
import io.metersphere.user.SessionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
@ -24,11 +29,22 @@ public class TestPlanTestCaseService {
@Resource
TestPlanTestCaseMapper testPlanTestCaseMapper;
@Resource
UserService userService;
@Resource
ExtTestPlanTestCaseMapper extTestPlanTestCaseMapper;
public List<TestPlanCaseDTO> getTestPlanCases(QueryTestPlanCaseRequest request) {
return extTestPlanTestCaseMapper.list(request);
List<TestPlanCaseDTO> list = extTestPlanTestCaseMapper.list(request);
QueryMemberRequest queryMemberRequest = new QueryMemberRequest();
queryMemberRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
Map<String, String> userMap = userService.getMemberList(queryMemberRequest)
.stream().collect(Collectors.toMap(User::getId, User::getName));
list.forEach(item -> {
item.setExecutorName(userMap.get(item.getExecutor()));
});
return list;
}
public void editTestCase(TestPlanTestCase testPlanTestCase) {

View File

@ -5,7 +5,7 @@
width="20%">
<el-select v-model="executor" :placeholder="$t('test_track.plan_view.select_executor')">
<el-option v-for="item in executorOptions" :key="item.id"
:label="item.id" :value="item.id"></el-option>
:label="item.name" :value="item.id"></el-option>
</el-select>
<template v-slot:footer>

View File

@ -69,7 +69,7 @@
</el-table-column>
<el-table-column
prop="executor"
prop="executorName"
:label="$t('test_track.plan_view.executor')">
</el-table-column>
@ -297,10 +297,6 @@
}
this.initTableData();
},
// filter(value, row, column) {
// const property = column['property'];
// return row[property] === value;
// },
openTestReport() {
this.$refs.testReporTtemplateList.open();
},