fix(测试跟踪): 测试跟踪,测试计划列表标签和执行次数显示错误
This commit is contained in:
parent
793758ac62
commit
4f7db52966
|
@ -88,10 +88,6 @@ public class TestPlanReportService {
|
|||
*/
|
||||
public TestPlanReport genTestPlanReport(TestPlanReportSaveRequest saveRequest) {
|
||||
TestPlan testPlan = testPlanMapper.selectByPrimaryKey(saveRequest.getPlanId());
|
||||
testPlan.setExecutionTimes(1);
|
||||
testPlan.setExecutionTimes(testPlan.getExecutionTimes() + 1);
|
||||
testPlanMapper.updateByPrimaryKey(testPlan);
|
||||
|
||||
String testPlanReportID = saveRequest.getReportID();
|
||||
TestPlanReport testPlanReport = new TestPlanReport();
|
||||
testPlanReport.setTestPlanId(saveRequest.getPlanId());
|
||||
|
|
|
@ -131,6 +131,8 @@ public class TestPlanService {
|
|||
private TestCaseTestMapper testCaseTestMapper;
|
||||
@Resource
|
||||
private ApiScenarioReportMapper apiScenarioReportMapper;
|
||||
@Resource
|
||||
private TestPlanReportMapper testPlanReportMapper;
|
||||
|
||||
public synchronized String addTestPlan(AddTestPlanRequest testPlan) {
|
||||
if (getTestPlanByName(testPlan.getName()).size() > 0) {
|
||||
|
@ -385,6 +387,11 @@ public class TestPlanService {
|
|||
request.setProjectId(projectId);
|
||||
}
|
||||
List<TestPlanDTOWithMetric> testPlans = extTestPlanMapper.list(request);
|
||||
testPlans.forEach(item -> {
|
||||
TestPlanReportExample example = new TestPlanReportExample();
|
||||
example.createCriteria().andTestPlanIdEqualTo(item.getId());
|
||||
item.setExecutionTimes((int) testPlanReportMapper.countByExample(example));
|
||||
});
|
||||
calcTestPlanRate(testPlans);
|
||||
return testPlans;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue