fix(测试跟踪): 修复功能用例回收站批量恢复的问题

--bug=1015435 --user=宋昌昌 [测试跟踪]github#16367回收站选择所有数据,批量恢复用例,每次只恢复10条 https://www.tapd.cn/55049933/s/1213602
This commit is contained in:
song-cc-rock 2022-07-27 17:01:14 +08:00 committed by f2c-ci-robot[bot]
parent be5f059836
commit 4dc817436d
1 changed files with 10 additions and 3 deletions

View File

@ -2241,13 +2241,20 @@ public class TestCaseService {
}
public void reduction(TestCaseBatchRequest request) {
if (CollectionUtils.isNotEmpty(request.getIds())) {
extTestCaseMapper.checkOriginalStatusByIds(request.getIds());
List<String> ids = new ArrayList<>();
if (request.getCondition().isSelectAll()) {
List<TestCaseDTO> allReductionTestCases = listTestCase(request.getCondition());
ids = allReductionTestCases.stream().map(TestCaseDTO::getId).collect(Collectors.toList());
} else {
ids = request.getIds();
}
if (CollectionUtils.isNotEmpty(ids)) {
extTestCaseMapper.checkOriginalStatusByIds(ids);
//检查原来模块是否还在
TestCaseExample example = new TestCaseExample();
// 关联版本之后必须查询每一个数据的所有版本依次还原
example.createCriteria().andIdIn(request.getIds());
example.createCriteria().andIdIn(ids);
List<TestCase> reductionCaseList = testCaseMapper.selectByExample(example);
List<String> refIds = reductionCaseList.stream().map(TestCase::getRefId).collect(Collectors.toList());
example.clear();