parent
ec618b68db
commit
bb4eafd718
|
@ -614,9 +614,14 @@ public class ApiAutomationService {
|
|||
if (scenario == null) {
|
||||
return;
|
||||
}
|
||||
ApiScenarioRequest request = new ApiScenarioRequest();
|
||||
request.setRefId(scenario.getRefId());
|
||||
List<String> scenarioIds = extApiScenarioMapper.selectIdsByQuery(request);
|
||||
List<String> scenarioIds = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(scenario.getRefId())) {
|
||||
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()));
|
||||
ApiScenarioExampleWithOperation example = new ApiScenarioExampleWithOperation();
|
||||
|
@ -1254,6 +1259,9 @@ public class ApiAutomationService {
|
|||
if (scenarioWithBLOBs.getNum() == null) {
|
||||
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
||||
}
|
||||
if (scenarioWithBLOBs.getRefId() == null) {
|
||||
scenarioWithBLOBs.setRefId(scenarioWithBLOBs.getId());
|
||||
}
|
||||
batchMapper.insert(scenarioWithBLOBs);
|
||||
apiScenarioReferenceIdService.saveApiAndScenarioRelation(scenarioWithBLOBs);
|
||||
extApiScenarioMapper.clearLatestVersion(scenarioWithBLOBs.getRefId());
|
||||
|
@ -1284,6 +1292,9 @@ public class ApiAutomationService {
|
|||
if (scenarioWithBLOBs.getNum() == null) {
|
||||
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
||||
}
|
||||
if (scenarioWithBLOBs.getRefId() == null) {
|
||||
scenarioWithBLOBs.setRefId(scenarioWithBLOBs.getId());
|
||||
}
|
||||
batchMapper.insert(scenarioWithBLOBs);
|
||||
} else {
|
||||
ApiScenarioWithBLOBs existScenario = scenarioOp.get();
|
||||
|
@ -1298,6 +1309,9 @@ public class ApiAutomationService {
|
|||
if (scenarioWithBLOBs.getNum() == null) {
|
||||
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
||||
}
|
||||
if (scenarioWithBLOBs.getRefId() == null) {
|
||||
scenarioWithBLOBs.setRefId(scenarioWithBLOBs.getId());
|
||||
}
|
||||
batchMapper.updateByPrimaryKeyWithBLOBs(scenarioWithBLOBs);
|
||||
}
|
||||
checkReferenceCase(scenarioWithBLOBs, apiTestCaseMapper, apiDefinitionMapper);
|
||||
|
@ -1378,6 +1392,9 @@ public class ApiAutomationService {
|
|||
if (scenarioWithBLOBs.getNum() == null) {
|
||||
scenarioWithBLOBs.setNum(getNextNum(scenarioWithBLOBs.getProjectId()));
|
||||
}
|
||||
if (scenarioWithBLOBs.getRefId() == null) {
|
||||
scenarioWithBLOBs.setRefId(scenarioWithBLOBs.getId());
|
||||
}
|
||||
batchMapper.insert(scenarioWithBLOBs);
|
||||
// 存储依赖关系
|
||||
ApiAutomationRelationshipEdgeService relationshipEdgeService = CommonBeanFactory.getBean(ApiAutomationRelationshipEdgeService.class);
|
||||
|
|
Loading…
Reference in New Issue