fix(测试计划): 修复测试计划模块移动的问题

This commit is contained in:
Jianguo-Genius 2024-11-25 14:43:03 +08:00 committed by Craftsman
parent afc8f54f96
commit 784f37d67f
2 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,9 @@ public class ApiDefinitionUtils {
customRequestUrl = customRequestUrl.substring(1); customRequestUrl = customRequestUrl.substring(1);
} }
if (StringUtils.isNotEmpty(customRequestUrl)) { if (StringUtils.isNotEmpty(customRequestUrl)) {
if (customRequestUrl.contains("?")) {
customRequestUrl = customRequestUrl.substring(0, customRequestUrl.indexOf("?"));
}
String[] customUrlArr = customRequestUrl.split("/"); String[] customUrlArr = customRequestUrl.split("/");
if (StringUtils.startsWithAny(customRequestUrl.toLowerCase(), "https://", "http://") if (StringUtils.startsWithAny(customRequestUrl.toLowerCase(), "https://", "http://")

View File

@ -167,6 +167,7 @@ public class TestPlanModuleService extends ModuleTreeService {
TestPlanModuleExample example = new TestPlanModuleExample(); TestPlanModuleExample example = new TestPlanModuleExample();
// 拖拽后, 父级模块下存在同名模块 // 拖拽后, 父级模块下存在同名模块
example.createCriteria().andParentIdEqualTo(nodeSortDTO.getParent().getId()).andNameEqualTo(nodeSortDTO.getNode().getName()) example.createCriteria().andParentIdEqualTo(nodeSortDTO.getParent().getId()).andNameEqualTo(nodeSortDTO.getNode().getName())
.andProjectIdEqualTo(nodeSortDTO.getNode().getProjectId())
.andIdNotEqualTo(nodeSortDTO.getNode().getId()); .andIdNotEqualTo(nodeSortDTO.getNode().getId());
if (testPlanModuleMapper.countByExample(example) > 0) { if (testPlanModuleMapper.countByExample(example) > 0) {
throw new MSException(Translator.get("test_plan_module_already_exists")); throw new MSException(Translator.get("test_plan_module_already_exists"));