diff --git a/src/main/java/com/biutag/supervision/service/report/impl/ReportBusinessLineSectionServiceImpl.java b/src/main/java/com/biutag/supervision/service/report/impl/ReportBusinessLineSectionServiceImpl.java index 9ed783e..9fa2737 100644 --- a/src/main/java/com/biutag/supervision/service/report/impl/ReportBusinessLineSectionServiceImpl.java +++ b/src/main/java/com/biutag/supervision/service/report/impl/ReportBusinessLineSectionServiceImpl.java @@ -143,21 +143,21 @@ public class ReportBusinessLineSectionServiceImpl implements ReportBusinessLineS // 本期按业务条线分组 Map> currentGroup = currentList.stream() .collect(Collectors.groupingBy( - vo -> parentLabel2Level(vo.getProblemSourcesCode(), idMap), + NegativeQueryVo::getProblemSourcesCode, LinkedHashMap::new, Collectors.toList() )); // 环比分组 Map> momGroup = momList.stream() .collect(Collectors.groupingBy( - vo -> parentLabel2Level(vo.getProblemSourcesCode(), idMap), + NegativeQueryVo::getProblemSourcesCode, LinkedHashMap::new, Collectors.toList() )); // 同比分组 Map> yoyGroup = yoyList.stream() .collect(Collectors.groupingBy( - vo -> parentLabel2Level(vo.getProblemSourcesCode(), idMap), + NegativeQueryVo::getProblemSourcesCode, LinkedHashMap::new, Collectors.toList() )); @@ -171,15 +171,16 @@ public class ReportBusinessLineSectionServiceImpl implements ReportBusinessLineS List result = new ArrayList<>(); int index = 1; for (Map.Entry> entry : sortedEntries) { - String fatherBusinessLineName = entry.getKey(); + String sourceCode = entry.getKey(); List lineList = entry.getValue(); if (CollUtil.isEmpty(lineList)) { continue; } BusinessLineDetailSection section = new BusinessLineDetailSection(); section.setOrderNo(toChineseOrderNo(index++)); - section.setBusinessFatherLineName(fatherBusinessLineName); - section.setBusinessLineName(lineList.get(0).getProblemSources()); + // 父级条线名 + section.setBusinessFatherLineName(parentLabel2Level(sourceCode, idMap)); + section.setBusinessLineName(selfLabel(sourceCode, idMap)); int totalIssued = lineList.size(); section.setTotalIssued(totalIssued); @@ -213,10 +214,10 @@ public class ReportBusinessLineSectionServiceImpl implements ReportBusinessLineS section.setTopPersons(accountabilityStats.getTopPersons().stream().limit(3).toList()); BigDecimal currentVerifiedRate = closedStats.getVerifiedRate(); ClosedStatsCalcRequestDTO momRequestDTO = new ClosedStatsCalcRequestDTO(); - momRequestDTO.setNegativeQueryVoList(momGroup.getOrDefault(fatherBusinessLineName, Collections.emptyList())); + momRequestDTO.setNegativeQueryVoList(momGroup.getOrDefault(sourceCode, Collections.emptyList())); ClosedStatsCalcResponseDTO momClosedStats = reportClosedStatsService.calculateClosedStats(momRequestDTO); ClosedStatsCalcRequestDTO yoyRequestDTO = new ClosedStatsCalcRequestDTO(); - yoyRequestDTO.setNegativeQueryVoList(yoyGroup.getOrDefault(fatherBusinessLineName, Collections.emptyList())); + yoyRequestDTO.setNegativeQueryVoList(yoyGroup.getOrDefault(sourceCode, Collections.emptyList())); ClosedStatsCalcResponseDTO yoyClosedStats = reportClosedStatsService.calculateClosedStats(yoyRequestDTO); BigDecimal momVerifiedRate = momClosedStats.getVerifiedRate(); BigDecimal yoyVerifiedRate = yoyClosedStats.getVerifiedRate(); @@ -247,6 +248,22 @@ public class ReportBusinessLineSectionServiceImpl implements ReportBusinessLineS : StrUtil.blankToDefault(child.getLabel(), "未归类"); } + + /** + * 根据问题来源ID,解析当前节点名称(自己的 name) + */ + private String selfLabel(String sourceCode, Map idMap) { + if (StrUtil.isBlank(sourceCode)) { + return "未归类"; + } + DictProblemSourceTree current = idMap.get(sourceCode); + if (current == null) { + return "未归类"; + } + return StrUtil.blankToDefault(current.getLabel(), "未归类"); + } + + /** * 阿拉伯数字序号转中文序号 */