Browse Source

fix--业务明细取每一个子类

master
parent
commit
ce515d79e6
  1. 33
      src/main/java/com/biutag/supervision/service/report/impl/ReportBusinessLineSectionServiceImpl.java

33
src/main/java/com/biutag/supervision/service/report/impl/ReportBusinessLineSectionServiceImpl.java

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

Loading…
Cancel
Save