Commit 56faaccc authored by yanzg's avatar yanzg

接口文档的支持

parent 9be36a77
...@@ -154,6 +154,10 @@ public class ExcelConsole<T extends Object> implements DbRow<T> { ...@@ -154,6 +154,10 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
if (this.workbook != null) { if (this.workbook != null) {
throw new CodeException("Excel已初始化"); throw new CodeException("Excel已初始化");
} }
// 创建合并对象数据检测
mergerGroup = new HashMap<>();
mergerGroupData = new HashMap<>();
// 创建工作簿对象 // 创建工作簿对象
workbook = new XSSFWorkbook(); workbook = new XSSFWorkbook();
sheet = workbook.createSheet(); sheet = workbook.createSheet();
...@@ -167,10 +171,6 @@ public class ExcelConsole<T extends Object> implements DbRow<T> { ...@@ -167,10 +171,6 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
writeHead(head); writeHead(head);
rowIndex += head.getTotalRow(); rowIndex += head.getTotalRow();
// 创建合并对象数据检测
mergerGroup = new HashMap<>();
mergerGroupData = new HashMap<>();
} }
/** /**
...@@ -227,6 +227,7 @@ public class ExcelConsole<T extends Object> implements DbRow<T> { ...@@ -227,6 +227,7 @@ public class ExcelConsole<T extends Object> implements DbRow<T> {
for (ExportColumn column : this.config.getColumns()) { for (ExportColumn column : this.config.getColumns()) {
// 获取需要合并的組,不能为null // 获取需要合并的組,不能为null
String group = StringHelper.getFirst(column.getMegerGroup()); String group = StringHelper.getFirst(column.getMegerGroup());
column.setMegerGroup(group);
if (!mergerGroup.containsKey(group)) { if (!mergerGroup.containsKey(group)) {
mergerGroup.put(group, new ArrayList<>()); mergerGroup.put(group, new ArrayList<>());
mergerGroupData.put(group, new ExcelMergerData()); mergerGroupData.put(group, new ExcelMergerData());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment