fix(测试跟踪): 功能用例批量删除和恢复,全选后取消部分勾选失效

--bug=1020772 --user=陈建星 [测试跟踪]github#20565测试跟踪-功能用例-回收站列表,全选所有用例后,再将部分用例取消勾选,点击恢复后,仍会恢复所有用例 https://www.tapd.cn/55049933/s/1315758
--bug=1020770 --user=陈建星 [测试跟踪]github#20553测试跟踪-功能用例列表,全选所有用例后,再将部分用例取消勾选,点击批量删除后,仍会删除所有用例 https://www.tapd.cn/55049933/s/1315755
This commit is contained in:
chenjianxing 2022-12-14 17:45:15 +08:00 committed by jianxing
parent 0fc9f1c0b0
commit e5a366de15
2 changed files with 5 additions and 16 deletions

View File

@ -170,9 +170,9 @@ public class IssuesService {
issues = platformPluginService.getPlatform(project.getPlatform()) issues = platformPluginService.getPlatform(project.getPlatform())
.addIssue(platformIssuesUpdateRequest); .addIssue(platformIssuesUpdateRequest);
issues.setPlatform(project.getPlatform());
insertIssues(issues); insertIssues(issues);
issuesRequest.setId(issues.getId()); issuesRequest.setId(issues.getId());
issues.setPlatform(project.getPlatform());
// 用例与第三方缺陷平台中的缺陷关联 // 用例与第三方缺陷平台中的缺陷关联
handleTestCaseIssues(issuesRequest); handleTestCaseIssues(issuesRequest);

View File

@ -704,14 +704,8 @@ public class TestCaseService {
} }
public int deleteToGcBatch(TestCaseBatchRequest request) { public int deleteToGcBatch(TestCaseBatchRequest request) {
List<String> ids = new ArrayList<String>(); ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) -> extTestCaseMapper.selectIds(query));
if (request.getCondition() != null && request.getCondition().isSelectAll()) { return deleteToGcBatch(request.getIds(), null);
List<TestCaseDTO> testCaseDTOS = listTestCase(request.getCondition());
ids = testCaseDTOS.stream().map(TestCaseDTO::getId).collect(Collectors.toList());
} else {
ids = request.getIds();
}
return deleteToGcBatch(ids, null);
} }
public int deleteToGcBatch(List<String> ids, String projectId) { public int deleteToGcBatch(List<String> ids, String projectId) {
@ -2434,13 +2428,8 @@ public class TestCaseService {
} }
public void reduction(TestCaseBatchRequest request) { public void reduction(TestCaseBatchRequest request) {
List<String> ids = new ArrayList<>(); ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) -> extTestCaseMapper.selectIds(query));
if (request.getCondition() != null && request.getCondition().isSelectAll()) { List<String> ids = request.getIds();
List<TestCaseDTO> allReductionTestCases = listTestCase(request.getCondition());
ids = allReductionTestCases.stream().map(TestCaseDTO::getId).collect(Collectors.toList());
} else {
ids = request.getIds();
}
if (CollectionUtils.isNotEmpty(ids)) { if (CollectionUtils.isNotEmpty(ids)) {
extTestCaseMapper.checkOriginalStatusByIds(ids); extTestCaseMapper.checkOriginalStatusByIds(ids);