|
@@ -100,17 +100,25 @@ public class ReportExcelUtil {
|
|
|
if (CollectionUtil.isEmpty(list)) {
|
|
|
return null;
|
|
|
}
|
|
|
- String name = null;
|
|
|
+ String preDimensionName = null;
|
|
|
+ String dimensionName = null;
|
|
|
+ String kongGe = " ";
|
|
|
List<List<String>> result = new ArrayList<>();
|
|
|
for (ReportTitleDto reportTitleDto : list) {
|
|
|
for (ReportTitleDto.DeviceChildren deviceChildren:reportTitleDto.getDeviceChildren()) {
|
|
|
for (ReportTitleDto.StatisticalDimension dimensionList:deviceChildren.getDimensionList()) {
|
|
|
List<String> child = new ArrayList<>();
|
|
|
- name = reportTitleDto.getClassify().indexOf("isNull") != -1 ? deviceChildren.getName() :reportTitleDto.getClassify();
|
|
|
- child.add(name);
|
|
|
+ child.add(reportTitleDto.getClassify().indexOf("isNull") != -1 ? deviceChildren.getName() :reportTitleDto.getClassify());
|
|
|
child.add(deviceChildren.getName());
|
|
|
- child.add(dimensionList.getDimensionName());
|
|
|
+ // 避免第三行,在邻列的情况下相同值被合并
|
|
|
+ if (preDimensionName != null && preDimensionName.equals(dimensionList.getDimensionName())) {
|
|
|
+ dimensionName = kongGe + dimensionList.getDimensionName();
|
|
|
+ } else {
|
|
|
+ dimensionName = dimensionList.getDimensionName();
|
|
|
+ }
|
|
|
+ child.add(dimensionName);
|
|
|
result.add(child);
|
|
|
+ preDimensionName = dimensionName;
|
|
|
}
|
|
|
}
|
|
|
}
|