diff --git a/backend/src/main/java/io/metersphere/controller/request/testplancase/QueryTestPlanCaseRequest.java b/backend/src/main/java/io/metersphere/controller/request/testplancase/QueryTestPlanCaseRequest.java index 8be81d9827..2027a5aa45 100644 --- a/backend/src/main/java/io/metersphere/controller/request/testplancase/QueryTestPlanCaseRequest.java +++ b/backend/src/main/java/io/metersphere/controller/request/testplancase/QueryTestPlanCaseRequest.java @@ -19,5 +19,4 @@ public class QueryTestPlanCaseRequest extends TestPlanTestCase { private String workspaceId; private String name; - } diff --git a/backend/src/main/java/io/metersphere/dto/TestPlanCaseDTO.java b/backend/src/main/java/io/metersphere/dto/TestPlanCaseDTO.java index 067589985f..2a39cf6187 100644 --- a/backend/src/main/java/io/metersphere/dto/TestPlanCaseDTO.java +++ b/backend/src/main/java/io/metersphere/dto/TestPlanCaseDTO.java @@ -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; } diff --git a/backend/src/main/java/io/metersphere/service/TestPlanTestCaseService.java b/backend/src/main/java/io/metersphere/service/TestPlanTestCaseService.java index 8f5ab4e2eb..0c5bca8933 100644 --- a/backend/src/main/java/io/metersphere/service/TestPlanTestCaseService.java +++ b/backend/src/main/java/io/metersphere/service/TestPlanTestCaseService.java @@ -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 getTestPlanCases(QueryTestPlanCaseRequest request) { - return extTestPlanTestCaseMapper.list(request); + List list = extTestPlanTestCaseMapper.list(request); + QueryMemberRequest queryMemberRequest = new QueryMemberRequest(); + queryMemberRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId()); + Map 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) { diff --git a/frontend/src/business/components/track/plan/view/comonents/ExecutorEdit.vue b/frontend/src/business/components/track/plan/view/comonents/ExecutorEdit.vue index df639fd1f8..12fd6244c8 100644 --- a/frontend/src/business/components/track/plan/view/comonents/ExecutorEdit.vue +++ b/frontend/src/business/components/track/plan/view/comonents/ExecutorEdit.vue @@ -5,7 +5,7 @@ width="20%"> + :label="item.name" :value="item.id">