fix: 缺陷数为0的测试计划不统计#1006130

--bug=1006130 --user=lyh 【测试跟踪-首页】遗留缺陷统计不对
https://www.tapd.cn/55049933/s/1052500
This commit is contained in:
shiziyuan9527 2021-09-27 16:52:44 +08:00 committed by shiziyuan9527
parent ff1407d24f
commit ebec57f2e5
1 changed files with 6 additions and 1 deletions

View File

@ -118,6 +118,12 @@ public class TrackService {
int totalBugSize = 0;
int totalCaseSize = 0;
for (TestPlan plan : plans) {
int planBugSize = getPlanBugSize(plan.getId());
// bug为0不记录
if (planBugSize == 0) {
continue;
}
TestPlanBugCount testPlanBug = new TestPlanBugCount();
testPlanBug.setIndex(index++);
testPlanBug.setPlanName(plan.getName());
@ -127,7 +133,6 @@ public class TrackService {
int planCaseSize = getPlanCaseSize(plan.getId());
testPlanBug.setCaseSize(planCaseSize);
int planBugSize = getPlanBugSize(plan.getId());
testPlanBug.setBugSize(planBugSize);
double planPassRage = getPlanPassRage(plan.getId());
testPlanBug.setPassRage(planPassRage + "%");