fix(测试跟踪): 功能用例重复显示缺陷

--bug=1010386 --user=陈建星 【测试计划】-功能用例已关联的缺陷和测试计划中再次关联该缺陷后,用例显示重复了 https://www.tapd.cn/55049933/s/11059644
This commit is contained in:
chenjianxing 2022-02-18 18:10:52 +08:00 committed by jianxing
parent 4a58792154
commit fb74d1e957
1 changed files with 8 additions and 4 deletions

View File

@ -161,7 +161,7 @@ public class IssuesService {
issueRequest.setCaseResourceId(caseResourceId); issueRequest.setCaseResourceId(caseResourceId);
ServiceUtils.getDefaultOrder(issueRequest.getOrders()); ServiceUtils.getDefaultOrder(issueRequest.getOrders());
issueRequest.setRefType(refType); issueRequest.setRefType(refType);
return extIssuesMapper.getIssuesByCaseId(issueRequest); return disconnectIssue(extIssuesMapper.getIssuesByCaseId(issueRequest));
} }
public IssuesWithBLOBs getIssue(String id) { public IssuesWithBLOBs getIssue(String id) {
@ -588,8 +588,12 @@ public class IssuesService {
IssuesRequest issueRequest = new IssuesRequest(); IssuesRequest issueRequest = new IssuesRequest();
issueRequest.setPlanId(planId); issueRequest.setPlanId(planId);
List<IssuesDao> planIssues = extIssuesMapper.getPlanIssues(issueRequest); List<IssuesDao> planIssues = extIssuesMapper.getPlanIssues(issueRequest);
Set<String> ids = new HashSet<>(planIssues.size()); return disconnectIssue(planIssues);
Iterator<IssuesDao> iterator = planIssues.iterator(); }
public List<IssuesDao> disconnectIssue(List<IssuesDao> issues) {
Set<String> ids = new HashSet<>(issues.size());
Iterator<IssuesDao> iterator = issues.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
IssuesDao next = iterator.next(); IssuesDao next = iterator.next();
if (ids.contains(next.getId())) { if (ids.contains(next.getId())) {
@ -597,7 +601,7 @@ public class IssuesService {
} }
ids.add(next.getId()); ids.add(next.getId());
} }
return planIssues; return issues;
} }
public void changeStatus(IssuesRequest request) { public void changeStatus(IssuesRequest request) {