fix(测试跟踪): 复制测试计划性能用例修改配置资源池没显示

--bug=1024599 --user=李玉号 【测试跟踪】复制测试计划-性能用例-点击修改配置-资源池没显示
https://www.tapd.cn/55049933/s/1352457
This commit is contained in:
shiziyuan9527 2023-03-17 18:23:07 +08:00 committed by lyh
parent b5edcdab7c
commit 96779c7d44
1 changed files with 5 additions and 2 deletions

View File

@ -479,11 +479,11 @@ public class TestPlanLoadCaseService {
try (SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH)) { try (SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH)) {
TestPlanLoadCaseExample example = new TestPlanLoadCaseExample(); TestPlanLoadCaseExample example = new TestPlanLoadCaseExample();
example.createCriteria().andTestPlanIdEqualTo(sourcePlanId); example.createCriteria().andTestPlanIdEqualTo(sourcePlanId);
List<TestPlanLoadCase> loadCases = testPlanLoadCaseMapper.selectByExample(example); List<TestPlanLoadCaseWithBLOBs> loadCases = testPlanLoadCaseMapper.selectByExampleWithBLOBs(example);
TestPlanLoadCaseMapper mapper = sqlSession.getMapper(TestPlanLoadCaseMapper.class); TestPlanLoadCaseMapper mapper = sqlSession.getMapper(TestPlanLoadCaseMapper.class);
if (!org.apache.commons.collections.CollectionUtils.isEmpty(loadCases)) { if (!org.apache.commons.collections.CollectionUtils.isEmpty(loadCases)) {
Long nextLoadOrder = ServiceUtils.getNextOrder(targetPlanId, extTestPlanLoadCaseMapper::getLastOrder); Long nextLoadOrder = ServiceUtils.getNextOrder(targetPlanId, extTestPlanLoadCaseMapper::getLastOrder);
for (TestPlanLoadCase loadCase : loadCases) { for (TestPlanLoadCaseWithBLOBs loadCase : loadCases) {
TestPlanLoadCaseWithBLOBs load = new TestPlanLoadCaseWithBLOBs(); TestPlanLoadCaseWithBLOBs load = new TestPlanLoadCaseWithBLOBs();
load.setId(UUID.randomUUID().toString()); load.setId(UUID.randomUUID().toString());
load.setTestPlanId(targetPlanId); load.setTestPlanId(targetPlanId);
@ -492,6 +492,9 @@ public class TestPlanLoadCaseService {
load.setUpdateTime(System.currentTimeMillis()); load.setUpdateTime(System.currentTimeMillis());
load.setCreateUser(SessionUtils.getUserId()); load.setCreateUser(SessionUtils.getUserId());
load.setOrder(nextLoadOrder); load.setOrder(nextLoadOrder);
load.setTestResourcePoolId(loadCase.getTestResourcePoolId());
load.setLoadConfiguration(loadCase.getLoadConfiguration());
load.setAdvancedConfiguration(loadCase.getAdvancedConfiguration());
mapper.insert(load); mapper.insert(load);
nextLoadOrder += 5000; nextLoadOrder += 5000;
} }