fix(测试计划): 修复关联问题
--bug=1044413 --user=王旭 【测试计划】测试规划-接口用例-选中模块后再取消勾选一个接口关联数据错误 https://www.tapd.cn/55049933/s/1554109
This commit is contained in:
parent
a58083f3b1
commit
3652b3db10
|
@ -642,7 +642,6 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(dto.getSelectIds())) {
|
if (CollectionUtils.isNotEmpty(dto.getSelectIds())) {
|
||||||
CollectionUtils.removeAll(dto.getSelectIds(), apiTestCaseList.stream().map(ApiTestCase::getId).toList());
|
|
||||||
//获取选中的ids数据
|
//获取选中的ids数据
|
||||||
List<ApiTestCase> selectIdList = extApiTestCaseMapper.getCaseListBySelectIds(isRepeat, apiCase.getModules().getProjectId(), dto.getSelectIds(), testPlan.getId(), apiCase.getModules().getProtocols());
|
List<ApiTestCase> selectIdList = extApiTestCaseMapper.getCaseListBySelectIds(isRepeat, apiCase.getModules().getProjectId(), dto.getSelectIds(), testPlan.getId(), apiCase.getModules().getProtocols());
|
||||||
apiTestCaseList.addAll(selectIdList);
|
apiTestCaseList.addAll(selectIdList);
|
||||||
|
@ -650,8 +649,9 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(dto.getExcludeIds())) {
|
if (CollectionUtils.isNotEmpty(dto.getExcludeIds())) {
|
||||||
//排除的ids
|
//排除的ids
|
||||||
List<String> excludeIds = dto.getExcludeIds();
|
List<ApiTestCase> excludeList = extApiTestCaseMapper.getCaseListBySelectIds(isRepeat, apiCase.getModules().getProjectId(), dto.getExcludeIds(), testPlan.getId(), apiCase.getModules().getProtocols());
|
||||||
apiTestCaseList = apiTestCaseList.stream().filter(item -> !excludeIds.contains(item.getId())).toList();
|
List<String> excludeIds = excludeList.stream().map(ApiTestCase::getId).toList();
|
||||||
|
apiTestCaseList = apiTestCaseList.stream().filter(item -> !excludeIds.contains(item.getId())).distinct().toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(apiTestCaseList)) {
|
if (CollectionUtils.isNotEmpty(apiTestCaseList)) {
|
||||||
|
|
Loading…
Reference in New Issue