fix(测试跟踪): 首页缺陷统计第三方平台状态有误

--bug=1024695 --user=陈建星 【测试跟踪】项目集成JIRA 缺陷平台,测试计划中关联的缺陷在首页未统计 https://www.tapd.cn/55049933/s/1353723
--bug=1024696 --user=陈建星 【测试跟踪】项目修改为集成jira平台(之前使用zentao),首页遗留缺陷统计信息为0 的也显示了 https://www.tapd.cn/55049933/s/1353837
This commit is contained in:
chenjianxing 2023-03-21 16:53:07 +08:00 committed by jianxing
parent d80283a769
commit 7a620db6be
1 changed files with 14 additions and 7 deletions

View File

@ -262,7 +262,8 @@ public class TrackService {
bugStatusMap.put(Translator.get(statusEnum.getI18nKey()), count);
}
} else {
statusArray.forEach(item -> {
boolean isInStatusArray = false;
for (Object item : statusArray) {
JSONObject statusObj = (JSONObject) item;
if (StringUtils.equals(status, statusObj.get("value").toString())) {
Integer count = bugStatusMap.get(statusObj.get("text").toString());
@ -272,17 +273,23 @@ public class TrackService {
count += 1;
bugStatusMap.put(statusObj.get("text").toString(), count);
}
isInStatusArray = true;
}
});
}
if (!isInStatusArray) {
Integer count = bugStatusMap.get(status);
if (count == null) {
bugStatusMap.put(status, 1);
} else {
count += 1;
bugStatusMap.put(status, count);
}
}
}
}
}
}
if (MapUtils.isEmpty(bugStatusMap)) {
for (IssueStatus statusEnum : IssueStatus.values()) {
bugStatusMap.put(Translator.get(statusEnum.getI18nKey()), 0);
}
}
return bugStatusMap;
}