测试计划关联测试报告界面调整

This commit is contained in:
pfl
2025-06-26 16:19:57 +08:00
parent 963e9a8162
commit 924f5a935f
3 changed files with 24 additions and 9 deletions

View File

@@ -68,16 +68,22 @@ public class TestReportServiceImpl implements ITestReportService {
List<TestCaseResult> testCaseResults = testCaseResultMapper.selectTestCaseResultList(testCaseResult);
int count = testCaseResults.size();
int passNum = (int)testCaseResults.stream().filter(result -> "成功".equals(result.getStatus())).count();
if (count == passNum) {
testReportAddQO.setResult("1");
}
TestCaseReportVO testCaseReportVO = new TestCaseReportVO();
testCaseReportVO.setName(testReportAddQO.getName());
testCaseReportVO.setResult("success");
testCaseReportVO.setResult("0");
testCaseReportVO.setCaseNum(count);
testCaseReportVO.setPassNum(passNum);
String reportJson = JSONObject.toJSONString(testCaseReportVO);
TestReport testReport = new TestReport();
if (count == passNum) {
testReport.setResult("1");
}
BeanUtils.copyProperties(testReportAddQO,testReport);
testReport.setSerialNumber(generateSerialNumber());
testReport.setResult("1");
testReport.setResult("0");
testReport.setStatus("0");
testReport.setReport(reportJson);
testReport.setCreateTime(DateUtils.getNowDate());