diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java index 64ce85768d..63a99c0ed3 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java @@ -264,7 +264,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService { item.setProjectName(projectMap.get(item.getProjectId())); item.setCreateUserName(userMap.get(item.getCreateUser())); item.setExecuteUserName(userMap.get(item.getExecuteUser())); - item.setModuleName(moduleNameMap.get(item.getModuleId())); + item.setModuleName(StringUtils.isNotBlank(moduleNameMap.get(item.getModuleId())) ? moduleNameMap.get(item.getModuleId()) : Translator.get("api_unplanned_request")); if (secondEnvMap.containsKey(item.getTestPlanCollectionId())) { TestPlanCollectionEnvDTO collectEnv = secondEnvMap.get(item.getTestPlanCollectionId()); if (collectEnv.getExtended()) { diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java index 0550a5f5b0..70b7581339 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanFunctionalCaseService.java @@ -252,7 +252,7 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService { testPlanCasePageResponse.setCustomFields(collect.get(testPlanCasePageResponse.getCaseId())); testPlanCasePageResponse.setCreateUserName(userMap.get(testPlanCasePageResponse.getCreateUser())); testPlanCasePageResponse.setExecuteUserName(userMap.get(testPlanCasePageResponse.getExecuteUser())); - testPlanCasePageResponse.setModuleName(moduleNameMap.get(testPlanCasePageResponse.getModuleId())); + testPlanCasePageResponse.setModuleName(StringUtils.isNotBlank(moduleNameMap.get(testPlanCasePageResponse.getModuleId())) ? moduleNameMap.get(testPlanCasePageResponse.getModuleId()) : Translator.get("functional_case.module.default.name")); if (bugListMap.containsKey(testPlanCasePageResponse.getCaseId())) { List bugDTOList = bugListMap.get(testPlanCasePageResponse.getCaseId()); testPlanCasePageResponse.setBugList(handleStatus(bugDTOList, statusMap));