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 9876fc2b19
commit b145d08a9f

View File

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