|
|
|
@ -11,7 +11,7 @@ import java.io.IOException;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
public class ExcelCoreUtil {
|
|
|
|
|
public class ExcelUtil {
|
|
|
|
|
/**
|
|
|
|
|
* 将xls的转换为xlsx,数据样式和格式一同转换,并输出为文件流
|
|
|
|
|
*
|
|
|
|
@ -33,7 +33,7 @@ public class ExcelCoreUtil {
|
|
|
|
|
// 复制sheet,合并栏和冻结窗格之类
|
|
|
|
|
Sheet sheet1 = copySheet(wb, swb, i);
|
|
|
|
|
// 写入xls模板
|
|
|
|
|
ExcelCoreUtil builder = new ExcelCoreUtil(wb);
|
|
|
|
|
ExcelUtil builder = new ExcelUtil(wb);
|
|
|
|
|
int rowNum = sheet.getLastRowNum();
|
|
|
|
|
// 复制单元格值与样式
|
|
|
|
|
builder.copyRows(swb, sheet, sheet1, 0, rowNum + 1, 0);
|
|
|
|
@ -49,11 +49,11 @@ public class ExcelCoreUtil {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Workbook template = null;
|
|
|
|
|
private Workbook template;
|
|
|
|
|
private final Map<Integer, Font> fonts = new HashMap<>();
|
|
|
|
|
private final Map<Integer, CellStyle> styles = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
public ExcelCoreUtil(Workbook template) {
|
|
|
|
|
public ExcelUtil(Workbook template) {
|
|
|
|
|
this.template = template;
|
|
|
|
|
}
|
|
|
|
|
|