diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommonService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommonService.java index 90f141c302..0da022ee9e 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommonService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugCommonService.java @@ -16,7 +16,6 @@ import io.metersphere.system.domain.ServiceIntegration; import io.metersphere.system.service.PlatformPluginService; import io.metersphere.system.service.PluginLoadService; import jakarta.annotation.Resource; -import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -51,8 +50,7 @@ public class BugCommonService { // Local处理人 return getLocalHandlerOption(projectId); } else { - // 第三方平台(Local处理人 && 平台处理人) - List localHandlerOption = getLocalHandlerOption(projectId); + // 第三方平台处理人 // 获取插件中自定义的注入字段(处理人) Platform platform = platformPluginService.getPlatform(serviceIntegration.getPluginId(), serviceIntegration.getOrganizationId(), new String(serviceIntegration.getConfiguration())); @@ -66,7 +64,7 @@ public class BugCommonService { platformHandlerOption = platform.getFormOptions(request); } } - return ListUtils.union(localHandlerOption, platformHandlerOption); + return platformHandlerOption; } } diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java index 3c98fbf4a9..e34fd5ab95 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java @@ -1118,17 +1118,21 @@ public class BugService { List ids = bugs.stream().map(BugDTO::getId).toList(); List customFields = extBugCustomFieldMapper.getBugAllCustomFields(ids, projectId); Map> customFieldMap = customFields.stream().collect(Collectors.groupingBy(BugCustomFieldDTO::getBugId)); - // 处理人选项 + // 表头处理人选项 List handleUserOption = bugCommonService.getHeaderHandlerOption(projectId); Map handleMap = handleUserOption.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); - // 状态选项 + List localHandlerOption = bugCommonService.getLocalHandlerOption(projectId); + Map localHandleMap = localHandlerOption.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); + // 表头状态选项 List statusOption = bugStatusService.getHeaderStatusOption(projectId); Map statusMap = statusOption.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); + List localStatusOptions = bugStatusService.getAllLocalStatusOptions(projectId); + Map localStatusMap = localStatusOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); bugs.forEach(bug -> { bug.setCustomFields(customFieldMap.get(bug.getId())); - // 解析处理人, 状态, 严重程度 - bug.setHandleUserName(handleMap.get(bug.getHandleUser())); - bug.setStatusName(statusMap.get(bug.getStatus())); + // 解析处理人, 状态 + bug.setHandleUserName(StringUtils.isBlank(handleMap.get(bug.getHandleUser())) ? localHandleMap.get(bug.getHandleUser()) : handleMap.get(bug.getHandleUser())); + bug.setStatusName(StringUtils.isBlank(statusMap.get(bug.getStatus())) ? localStatusMap.get(bug.getStatus()) : statusMap.get(bug.getStatus())); }); return bugs; } diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugStatusService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugStatusService.java index d1516779c8..23c14e402f 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugStatusService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugStatusService.java @@ -12,7 +12,6 @@ import io.metersphere.sdk.util.LogUtils; import io.metersphere.system.service.BaseStatusFlowSettingService; import jakarta.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -41,8 +40,7 @@ public class BugStatusService { // Local状态流 return getAllLocalStatusOptions(projectId); } else { - // 第三方平台(Local状态流 && 第三方平台状态流) - List localStatusOption = getAllLocalStatusOptions(projectId); + // 第三方平台状态流 Platform platform = projectApplicationService.getPlatform(projectId, true); String projectConfig = projectApplicationService.getProjectBugThirdPartConfig(projectId); // 获取一条最新的Jira默认模板缺陷Key @@ -52,7 +50,7 @@ public class BugStatusService { } catch (Exception e) { LogUtils.error("获取平台状态选项有误: " + e.getMessage()); } - return ListUtils.union(localStatusOption, platformStatusOption); + return platformStatusOption; } }