fix(接口自动化): #1006813 接口自动化批量添加到测试计划失败
【【接口自动化】批量添加到测试计划后,测试计划-场景用例列表,没看到该场景】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001006813
This commit is contained in:
parent
a7bcf2c46a
commit
41780b2e4a
|
@ -1556,6 +1556,8 @@ public class ApiAutomationService {
|
||||||
testPlanApiScenario.setCreateTime(System.currentTimeMillis());
|
testPlanApiScenario.setCreateTime(System.currentTimeMillis());
|
||||||
testPlanApiScenario.setUpdateTime(System.currentTimeMillis());
|
testPlanApiScenario.setUpdateTime(System.currentTimeMillis());
|
||||||
testPlanApiScenario.setEnvironment(JSON.toJSONString(newEnvMap));
|
testPlanApiScenario.setEnvironment(JSON.toJSONString(newEnvMap));
|
||||||
|
Long nextScenarioOrder = ServiceUtils.getNextOrder(testPlan.getId(), extTestPlanScenarioCaseMapper::getLastOrder);
|
||||||
|
testPlanApiScenario.setOrder(nextScenarioOrder);
|
||||||
scenarioBatchMapper.insertIfNotExists(testPlanApiScenario);
|
scenarioBatchMapper.insertIfNotExists(testPlanApiScenario);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
<insert id="insertIfNotExists" parameterType="io.metersphere.base.domain.TestPlanApiScenario">
|
<insert id="insertIfNotExists" parameterType="io.metersphere.base.domain.TestPlanApiScenario">
|
||||||
-- 查询没有数据再插入
|
-- 查询没有数据再插入
|
||||||
INSERT INTO test_plan_api_scenario(id, test_plan_id, api_scenario_id, create_time, update_time, environment)
|
INSERT INTO test_plan_api_scenario(id, test_plan_id, api_scenario_id, create_time, update_time, environment, `order`)
|
||||||
SELECT #{request.id}, #{request.testPlanId}, #{request.apiScenarioId}, #{request.createTime}, #{request.updateTime}, #{request.environment}
|
SELECT #{request.id}, #{request.testPlanId}, #{request.apiScenarioId}, #{request.createTime}, #{request.updateTime}, #{request.environment}, #{request.order}
|
||||||
FROM DUAL
|
FROM DUAL
|
||||||
WHERE NOT EXISTS(
|
WHERE NOT EXISTS(
|
||||||
SELECT id FROM
|
SELECT id FROM
|
||||||
|
|
Loading…
Reference in New Issue