parent
9a407e4b4d
commit
b31a208690
|
@ -599,9 +599,14 @@ public class ApiAutomationService {
|
||||||
if (scenario == null) {
|
if (scenario == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ApiScenarioRequest request = new ApiScenarioRequest();
|
List<String> scenarioIds = new ArrayList<>();
|
||||||
request.setRefId(scenario.getRefId());
|
if (StringUtils.isNotBlank(scenario.getRefId())) {
|
||||||
List<String> scenarioIds = extApiScenarioMapper.selectIdsByQuery(request);
|
ApiScenarioRequest request = new ApiScenarioRequest();
|
||||||
|
request.setRefId(scenario.getRefId());
|
||||||
|
scenarioIds = extApiScenarioMapper.selectIdsByQuery(request);
|
||||||
|
} else {
|
||||||
|
scenarioIds.add(scenario.getId());
|
||||||
|
}
|
||||||
//将这些场景的定时任务删除掉
|
//将这些场景的定时任务删除掉
|
||||||
scenarioIds.forEach(scenarioId -> scheduleService.deleteByResourceId(scenarioId, ScheduleGroup.API_SCENARIO_TEST.name()));
|
scenarioIds.forEach(scenarioId -> scheduleService.deleteByResourceId(scenarioId, ScheduleGroup.API_SCENARIO_TEST.name()));
|
||||||
ApiScenarioExampleWithOperation example = new ApiScenarioExampleWithOperation();
|
ApiScenarioExampleWithOperation example = new ApiScenarioExampleWithOperation();
|
||||||
|
@ -1238,6 +1243,9 @@ public class ApiAutomationService {
|
||||||
if (scenarioWithBLOBs.getNum() == null) {
|
if (scenarioWithBLOBs.getNum() == null) {
|
||||||
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
||||||
}
|
}
|
||||||
|
if (scenarioWithBLOBs.getRefId() == null) {
|
||||||
|
scenarioWithBLOBs.setRefId(scenarioWithBLOBs.getId());
|
||||||
|
}
|
||||||
batchMapper.insert(scenarioWithBLOBs);
|
batchMapper.insert(scenarioWithBLOBs);
|
||||||
apiScenarioReferenceIdService.saveApiAndScenarioRelation(scenarioWithBLOBs);
|
apiScenarioReferenceIdService.saveApiAndScenarioRelation(scenarioWithBLOBs);
|
||||||
extApiScenarioMapper.clearLatestVersion(scenarioWithBLOBs.getRefId());
|
extApiScenarioMapper.clearLatestVersion(scenarioWithBLOBs.getRefId());
|
||||||
|
@ -1268,6 +1276,9 @@ public class ApiAutomationService {
|
||||||
if (scenarioWithBLOBs.getNum() == null) {
|
if (scenarioWithBLOBs.getNum() == null) {
|
||||||
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
||||||
}
|
}
|
||||||
|
if (scenarioWithBLOBs.getRefId() == null) {
|
||||||
|
scenarioWithBLOBs.setRefId(scenarioWithBLOBs.getId());
|
||||||
|
}
|
||||||
batchMapper.insert(scenarioWithBLOBs);
|
batchMapper.insert(scenarioWithBLOBs);
|
||||||
} else {
|
} else {
|
||||||
ApiScenarioWithBLOBs existScenario = scenarioOp.get();
|
ApiScenarioWithBLOBs existScenario = scenarioOp.get();
|
||||||
|
@ -1282,6 +1293,9 @@ public class ApiAutomationService {
|
||||||
if (scenarioWithBLOBs.getNum() == null) {
|
if (scenarioWithBLOBs.getNum() == null) {
|
||||||
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
||||||
}
|
}
|
||||||
|
if (scenarioWithBLOBs.getRefId() == null) {
|
||||||
|
scenarioWithBLOBs.setRefId(scenarioWithBLOBs.getId());
|
||||||
|
}
|
||||||
batchMapper.updateByPrimaryKeyWithBLOBs(scenarioWithBLOBs);
|
batchMapper.updateByPrimaryKeyWithBLOBs(scenarioWithBLOBs);
|
||||||
}
|
}
|
||||||
checkReferenceCase(scenarioWithBLOBs, apiTestCaseMapper, apiDefinitionMapper);
|
checkReferenceCase(scenarioWithBLOBs, apiTestCaseMapper, apiDefinitionMapper);
|
||||||
|
@ -1362,6 +1376,9 @@ public class ApiAutomationService {
|
||||||
if (scenarioWithBLOBs.getNum() == null) {
|
if (scenarioWithBLOBs.getNum() == null) {
|
||||||
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
||||||
}
|
}
|
||||||
|
if (scenarioWithBLOBs.getRefId() == null) {
|
||||||
|
scenarioWithBLOBs.setRefId(scenarioWithBLOBs.getId());
|
||||||
|
}
|
||||||
batchMapper.insert(scenarioWithBLOBs);
|
batchMapper.insert(scenarioWithBLOBs);
|
||||||
// 存储依赖关系
|
// 存储依赖关系
|
||||||
ApiAutomationRelationshipEdgeService relationshipEdgeService = CommonBeanFactory.getBean(ApiAutomationRelationshipEdgeService.class);
|
ApiAutomationRelationshipEdgeService relationshipEdgeService = CommonBeanFactory.getBean(ApiAutomationRelationshipEdgeService.class);
|
||||||
|
|
Loading…
Reference in New Issue