fix(接口测试): 修复场景导入自定义id与回收站冲突问题

https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001018278
--user=郭雨琦
This commit is contained in:
guoyuqi 2022-10-17 19:25:54 +08:00 committed by xiaomeinvG
parent 6a7e7c5386
commit 38364e48c5
1 changed files with 2 additions and 1 deletions

View File

@ -324,7 +324,7 @@ public class ApiScenarioService {
String id = request.getId();
ApiScenarioWithBLOBs apiScenarioWithBLOBs = apiScenarioMapper.selectByPrimaryKey(id);
ApiScenarioExample.Criteria criteria = example.createCriteria();
criteria.andCustomNumEqualTo(request.getCustomNum()).andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(id);
criteria.andCustomNumEqualTo(request.getCustomNum()).andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(id).andStatusNotEqualTo(ApiTestDataStatus.TRASH.getValue());
if (apiScenarioWithBLOBs != null && StringUtils.isNotBlank(apiScenarioWithBLOBs.getRefId())) {
criteria.andRefIdNotEqualTo(apiScenarioWithBLOBs.getRefId());
}
@ -1256,6 +1256,7 @@ public class ApiScenarioService {
if (BooleanUtils.isTrue(openCustomNum)) {
ApiScenarioExample example = new ApiScenarioExample();
ApiScenarioExample.Criteria criteria = example.createCriteria();
criteria.andStatusNotEqualTo(ApiTestDataStatus.TRASH.getValue());
if (CollectionUtils.isEmpty(sameList)) {
criteria.andCustomNumEqualTo(scenarioWithBLOBs.getCustomNum()).andProjectIdEqualTo(scenarioWithBLOBs.getProjectId());
} else {