parent
7ef9a91dea
commit
6cb785ed13
|
@ -1289,6 +1289,7 @@ public class ApiAutomationService {
|
|||
if (StringUtils.equals("fullCoverage", apiTestImportRequest.getModeId())) {
|
||||
_importCreate(sameList, batchMapper, extApiScenarioMapper, scenarioWithBLOBs, apiTestImportRequest, apiTestCaseMapper, apiDefinitionMapper);
|
||||
} else if (StringUtils.equals("incrementalMerge", apiTestImportRequest.getModeId())) {
|
||||
scenarioWithBLOBs.setId(UUID.randomUUID().toString());
|
||||
if (CollectionUtils.isEmpty(sameList)) {
|
||||
if (scenarioWithBLOBs.getVersionId() != null && scenarioWithBLOBs.getVersionId().equals("new")) {
|
||||
scenarioWithBLOBs.setLatest(apiTestImportRequest.getVersionId().equals(apiTestImportRequest.getDefaultVersion()));
|
||||
|
@ -1297,7 +1298,6 @@ public class ApiAutomationService {
|
|||
scenarioWithBLOBs.setRefId(scenarioWithBLOBs.getId());
|
||||
scenarioWithBLOBs.setLatest(true);
|
||||
}
|
||||
scenarioWithBLOBs.setId(UUID.randomUUID().toString());
|
||||
if (StringUtils.isNotEmpty(apiTestImportRequest.getVersionId())) {
|
||||
scenarioWithBLOBs.setVersionId(apiTestImportRequest.getVersionId());
|
||||
} else {
|
||||
|
|
|
@ -785,6 +785,7 @@ public class ApiDefinitionService {
|
|||
} else if (StringUtils.equals("incrementalMerge", apiTestImportRequest.getModeId())) {
|
||||
if (CollectionUtils.isEmpty(collect)) {
|
||||
String originId = apiDefinition.getId();
|
||||
apiDefinition.setId(UUID.randomUUID().toString());
|
||||
//postman 可能含有前置脚本,接口定义去掉脚本
|
||||
if (apiDefinition.getVersionId() != null && apiDefinition.getVersionId().equals("new")) {
|
||||
apiDefinition.setLatest(apiTestImportRequest.getVersionId().equals(apiTestImportRequest.getDefaultVersion()));
|
||||
|
@ -793,7 +794,6 @@ public class ApiDefinitionService {
|
|||
apiDefinition.setRefId(apiDefinition.getId());
|
||||
apiDefinition.setLatest(true); // 新增的接口 latest = true
|
||||
}
|
||||
apiDefinition.setId(UUID.randomUUID().toString());
|
||||
if (StringUtils.isNotEmpty(apiTestImportRequest.getVersionId())) {
|
||||
apiDefinition.setVersionId(apiTestImportRequest.getVersionId());
|
||||
} else {
|
||||
|
@ -801,7 +801,6 @@ public class ApiDefinitionService {
|
|||
}
|
||||
batchMapper.insert(apiDefinition);
|
||||
String requestStr = setImportHashTree(apiDefinition);
|
||||
|
||||
// case 设置版本
|
||||
cases.forEach(c -> {
|
||||
c.setVersionId(apiDefinition.getVersionId());
|
||||
|
|
|
@ -749,7 +749,7 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
|
|||
List<String> nameList = optionData.stream().map(ApiDefinitionWithBLOBs::getName).collect(Collectors.toList());
|
||||
|
||||
//获取系统内重复数据
|
||||
repeatApiDefinitionWithBLOBs = extApiDefinitionMapper.selectRepeatByProtocol(nameList, protocol);
|
||||
repeatApiDefinitionWithBLOBs = extApiDefinitionMapper.selectRepeatByProtocol(nameList, protocol, projectId);
|
||||
|
||||
Map<String, ApiDefinitionWithBLOBs> repeatDataMap = null;
|
||||
|
||||
|
|
|
@ -95,6 +95,6 @@ public interface ExtApiDefinitionMapper {
|
|||
|
||||
List<ApiDefinitionWithBLOBs> selectRepeatByBLOBsSameUrl(@Param("blobs") List<ApiDefinitionWithBLOBs> blobs, @Param("projectId") String projectId, @Param("moduleId") String moduleId);
|
||||
|
||||
List<ApiDefinitionWithBLOBs> selectRepeatByProtocol(@Param("names") List<String> names, @Param("protocol") String protocol);
|
||||
List<ApiDefinitionWithBLOBs> selectRepeatByProtocol(@Param("names") List<String> names, @Param("protocol") String protocol, @Param("projectId") String projectId);
|
||||
|
||||
}
|
||||
|
|
|
@ -1010,6 +1010,7 @@
|
|||
#{name}
|
||||
</foreach>
|
||||
and protocol = #{protocol}
|
||||
and project_id = #{projectId}
|
||||
and status != 'Trash'
|
||||
</select>
|
||||
<sql id="Same_Where_Clause">
|
||||
|
|
Loading…
Reference in New Issue