diff --git a/test-test/src/main/java/com/test/test/service/ITestCaseResultService.java b/test-test/src/main/java/com/test/test/service/ITestCaseResultService.java index 9cb03fa..09f6f31 100644 --- a/test-test/src/main/java/com/test/test/service/ITestCaseResultService.java +++ b/test-test/src/main/java/com/test/test/service/ITestCaseResultService.java @@ -1,6 +1,7 @@ package com.test.test.service; import com.test.test.domain.TestCaseResult; +import com.test.test.domain.vo.TestCaseResultVO; import java.util.List; @@ -26,7 +27,7 @@ public interface ITestCaseResultService * @param testCaseResult 用例执行报告 * @return 用例执行报告集合 */ - public List selectTestCaseResultList(TestCaseResult testCaseResult); + public List selectTestCaseResultList(TestCaseResult testCaseResult); /** * 查询用例执行报告最小化列表 diff --git a/test-test/src/main/java/com/test/test/service/impl/TestCaseResultServiceImpl.java b/test-test/src/main/java/com/test/test/service/impl/TestCaseResultServiceImpl.java index afb0343..4b25e7e 100644 --- a/test-test/src/main/java/com/test/test/service/impl/TestCaseResultServiceImpl.java +++ b/test-test/src/main/java/com/test/test/service/impl/TestCaseResultServiceImpl.java @@ -1,12 +1,16 @@ package com.test.test.service.impl; import com.test.test.domain.TestCaseResult; +import com.test.test.domain.vo.TestCaseResultVO; import com.test.test.mapper.TestCaseResultMapper; +import com.test.test.mapper.TestCaseStepMapper; import com.test.test.service.ITestCaseResultService; +import com.test.test.service.ITestCaseStepService; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -22,6 +26,8 @@ public class TestCaseResultServiceImpl implements ITestCaseResultService @Resource private TestCaseResultMapper testCaseResultMapper; + @Resource + private TestCaseStepMapper testCaseStepMapper; /** * 查询用例执行报告 * @@ -41,9 +47,16 @@ public class TestCaseResultServiceImpl implements ITestCaseResultService * @return 用例执行报告 */ @Override - public List selectTestCaseResultList(TestCaseResult testCaseResult) + public List selectTestCaseResultList(TestCaseResult testCaseResult) { - return testCaseResultMapper.selectTestCaseResultList(testCaseResult); + List list = new ArrayList(); + testCaseResultMapper.selectTestCaseResultList(testCaseResult).forEach(item -> { + TestCaseResultVO vo = new TestCaseResultVO(); + vo.setResult(item); + vo.setStep(testCaseStepMapper.selectTestCaseStepById(item.getStepId())); + list.add(vo); + }); + return list; } /**