fix(测试跟踪): 修复复制测试计划时里面接口测试顺序不对的问题

--bug=1020633 --user=宋天阳 【测试跟踪】github
#20421,复制测试计划,里面关联的接口测试顺序与原测试计划的关联接口测试顺序不一致。
https://www.tapd.cn/55049933/s/1317058
This commit is contained in:
song-tianyang 2022-12-19 18:00:57 +08:00 committed by 建国
parent e6121017d0
commit 6d9e08172f
2 changed files with 2 additions and 6 deletions

View File

@ -621,7 +621,6 @@ public class TestPlanApiCaseService {
List<TestPlanApiCase> testPlanApiCases = testPlanApiCaseMapper.selectByExample(testPlanApiCaseExample);
TestPlanApiCaseMapper apiCaseMapper = sqlSession.getMapper(TestPlanApiCaseMapper.class);
if (!CollectionUtils.isEmpty(testPlanApiCases)) {
Long nextApiOrder = ServiceUtils.getNextOrder(targetPlanId, extTestPlanApiCaseMapper::getLastOrder);
for (TestPlanApiCase apiCase : testPlanApiCases) {
TestPlanApiCase api = new TestPlanApiCase();
api.setId(UUID.randomUUID().toString());
@ -631,8 +630,7 @@ public class TestPlanApiCaseService {
api.setCreateTime(System.currentTimeMillis());
api.setUpdateTime(System.currentTimeMillis());
api.setCreateUser(SessionUtils.getUserId());
api.setOrder(nextApiOrder);
nextApiOrder += 5000;
api.setOrder(apiCase.getOrder());
apiCaseMapper.insert(api);
}
}

View File

@ -711,7 +711,6 @@ public class TestPlanScenarioCaseService {
List<TestPlanApiScenario> apiScenarios = testPlanApiScenarioMapper.selectByExampleWithBLOBs(testPlanApiScenarioExample);
TestPlanApiScenarioMapper apiScenarioMapper = sqlSession.getMapper(TestPlanApiScenarioMapper.class);
if (!CollectionUtils.isEmpty(apiScenarios)) {
Long nextScenarioOrder = ServiceUtils.getNextOrder(targetPlanId, extTestPlanScenarioCaseMapper::getLastOrder);
for (TestPlanApiScenario apiScenario : apiScenarios) {
TestPlanApiScenario planScenario = new TestPlanApiScenario();
planScenario.setId(UUID.randomUUID().toString());
@ -724,8 +723,7 @@ public class TestPlanScenarioCaseService {
planScenario.setCreateTime(System.currentTimeMillis());
planScenario.setUpdateTime(System.currentTimeMillis());
planScenario.setCreateUser(SessionUtils.getUserId());
planScenario.setOrder(nextScenarioOrder);
nextScenarioOrder += 5000;
planScenario.setOrder(apiScenario.getOrder());
apiScenarioMapper.insert(planScenario);
}
}