fix(工作台): 工作台跳转加载第三方处理人选项问题

--bug=1050515 --user=宋昌昌 【工作台】缺陷数卡片-点击缺陷总数/遗留缺陷数跳转页面数据经常加载失败 https://www.tapd.cn/55049933/s/1632370
This commit is contained in:
song-cc-rock 2024-12-17 14:47:34 +08:00 committed by Craftsman
parent 66fa5aa3b2
commit be8e9ed152
1 changed files with 7 additions and 3 deletions

View File

@ -1536,16 +1536,20 @@ public class BugService {
Map<String, List<BugCustomFieldDTO>> customFieldMap = customFields.stream().collect(Collectors.groupingBy(BugCustomFieldDTO::getBugId)); Map<String, List<BugCustomFieldDTO>> customFieldMap = customFields.stream().collect(Collectors.groupingBy(BugCustomFieldDTO::getBugId));
// MS处理人会与第三方的值冲突, 分开查询 // MS处理人会与第三方的值冲突, 分开查询
List<SelectOption> headerOptions = bugCommonService.getHeaderHandlerOption(projectId); List<SelectOption> headerOptions = bugCommonService.getHeaderHandlerOption(projectId);
Map<String, String> headerHandleUserMap = headerOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); Map<String, String> headerHandleUserMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(headerOptions)) {
headerHandleUserMap = headerOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText));
}
List<SelectOption> localOptions = bugCommonService.getLocalHandlerOption(projectId); List<SelectOption> localOptions = bugCommonService.getLocalHandlerOption(projectId);
Map<String, String> localHandleUserMap = localOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText)); Map<String, String> localHandleUserMap = localOptions.stream().collect(Collectors.toMap(SelectOption::getValue, SelectOption::getText));
Map<String, String> allStatusMap = bugCommonService.getAllStatusMap(projectId); Map<String, String> allStatusMap = bugCommonService.getAllStatusMap(projectId);
final Map<String, String> tmpHandleUserMap = headerHandleUserMap;
bugs.forEach(bug -> { bugs.forEach(bug -> {
bug.setCustomFields(customFieldMap.get(bug.getId())); bug.setCustomFields(customFieldMap.get(bug.getId()));
// 解析处理人, 状态 // 解析处理人, 状态
bug.setHandleUserName(headerHandleUserMap.containsKey(bug.getHandleUser()) ? bug.setHandleUserName(tmpHandleUserMap.containsKey(bug.getHandleUser()) ?
headerHandleUserMap.get(bug.getHandleUser()) : localHandleUserMap.get(bug.getHandleUser())); tmpHandleUserMap.get(bug.getHandleUser()) : localHandleUserMap.get(bug.getHandleUser()));
bug.setStatusName(allStatusMap.get(bug.getStatus())); bug.setStatusName(allStatusMap.get(bug.getStatus()));
}); });
return bugs; return bugs;