|
@@ -16,6 +16,7 @@ import org.apache.pdfbox.Loader;
|
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
|
import org.apache.poi.hssf.usermodel.*;
|
|
import org.apache.poi.hssf.usermodel.*;
|
|
import org.apache.poi.ss.usermodel.*;
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
|
+import org.apache.poi.ss.util.CellRangeAddress;
|
|
import org.apache.poi.xssf.usermodel.*;
|
|
import org.apache.poi.xssf.usermodel.*;
|
|
import org.jsoup.Jsoup;
|
|
import org.jsoup.Jsoup;
|
|
import org.jsoup.nodes.Document;
|
|
import org.jsoup.nodes.Document;
|
|
@@ -538,10 +539,10 @@ public class ExcelUtil {
|
|
return localDate.format(formatter);
|
|
return localDate.format(formatter);
|
|
}
|
|
}
|
|
|
|
|
|
- public static HSSFWorkbook getProductHSSFWorkbook(List<ProductDataVO> productDataVOList) {
|
|
|
|
|
|
+ public static XSSFWorkbook getProductXSSFWorkbook(List<ProductDataVO> productDataVOList) {
|
|
|
|
|
|
// 第一步,创建一个HSSFWorkbook,对应一个Excel文件
|
|
// 第一步,创建一个HSSFWorkbook,对应一个Excel文件
|
|
- HSSFWorkbook wb = new HSSFWorkbook();
|
|
|
|
|
|
+ XSSFWorkbook wb = new XSSFWorkbook();
|
|
try {
|
|
try {
|
|
createProductInfoSheet(wb,productDataVOList);
|
|
createProductInfoSheet(wb,productDataVOList);
|
|
createProductContractSheet(wb,productDataVOList);
|
|
createProductContractSheet(wb,productDataVOList);
|
|
@@ -553,28 +554,43 @@ public class ExcelUtil {
|
|
return wb;
|
|
return wb;
|
|
}
|
|
}
|
|
|
|
|
|
- private static void createInvestmentManagerSheet(HSSFWorkbook wb, List<ProductDataVO> productDataVOList) {
|
|
|
|
|
|
+ private static void createInvestmentManagerSheet(XSSFWorkbook wb, List<ProductDataVO> productDataVOList) {
|
|
try{
|
|
try{
|
|
- HSSFSheet sheet = wb.createSheet("投资经理信息");
|
|
|
|
|
|
+ XSSFSheet sheet = wb.createSheet("投资经理信息");
|
|
List<String> title = new ArrayList<>();
|
|
List<String> title = new ArrayList<>();
|
|
title.add("编号");
|
|
title.add("编号");
|
|
title.add("中基协基金编号");
|
|
title.add("中基协基金编号");
|
|
title.add("投资经理任职起始时间");
|
|
title.add("投资经理任职起始时间");
|
|
title.add("投资经理任职结束时间");
|
|
title.add("投资经理任职结束时间");
|
|
title.add("投资经理");
|
|
title.add("投资经理");
|
|
- // 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制
|
|
|
|
- HSSFRow row = sheet.createRow(0);
|
|
|
|
- // 第四步,创建单元格,并设置值表头 设置表头居中
|
|
|
|
- HSSFCellStyle style = wb.createCellStyle();
|
|
|
|
|
|
+ //创建第一行
|
|
|
|
+ XSSFRow row1 = sheet.createRow(0);
|
|
|
|
+ XSSFRow row2 = sheet.createRow(1);
|
|
|
|
+ for (int i = 0; i < title.size(); i++) {
|
|
|
|
+ row1.createCell(i);
|
|
|
|
+ row2.createCell(i);
|
|
|
|
+ }
|
|
|
|
+ XSSFCell firstCcell = row1.createCell(0);
|
|
|
|
+ firstCcell.setCellValue("私募管理人数据推送信息填写(投资经理情况)");
|
|
|
|
+ XSSFCellStyle style = wb.createCellStyle();
|
|
|
|
+ Font font = wb.createFont();
|
|
|
|
+ font.setFontName("微软");//设置字体
|
|
|
|
+ font.setBold(true);//加粗
|
|
|
|
+ font.setFontHeightInPoints((short) 12);//设置字体大小
|
|
|
|
+ font.setBold(true);
|
|
|
|
+ style.setFont(font);//设置单元格字体
|
|
style.setAlignment(HorizontalAlignment.LEFT);
|
|
style.setAlignment(HorizontalAlignment.LEFT);
|
|
style.setWrapText(true);
|
|
style.setWrapText(true);
|
|
- sheet.setColumnWidth(0, 1000);
|
|
|
|
|
|
+ firstCcell.setCellStyle(style);
|
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(0,1,0,title.size()));
|
|
|
|
+ XSSFRow row = sheet.createRow(2);
|
|
|
|
+ sheet.setColumnWidth(0, 3000);
|
|
sheet.setColumnWidth(1, 5000);
|
|
sheet.setColumnWidth(1, 5000);
|
|
- sheet.setColumnWidth(2, 5000);
|
|
|
|
|
|
+ sheet.setColumnWidth(2, 8000);
|
|
sheet.setColumnWidth(3, 8000);
|
|
sheet.setColumnWidth(3, 8000);
|
|
sheet.setColumnWidth(4, 10000);
|
|
sheet.setColumnWidth(4, 10000);
|
|
//声明列对象
|
|
//声明列对象
|
|
- HSSFCell cell = null;
|
|
|
|
|
|
+ XSSFCell cell = null;
|
|
//创建标题
|
|
//创建标题
|
|
for (int i = 0; i < title.size(); i++) {
|
|
for (int i = 0; i < title.size(); i++) {
|
|
cell = row.createCell(i);
|
|
cell = row.createCell(i);
|
|
@@ -597,7 +613,7 @@ public class ExcelUtil {
|
|
}
|
|
}
|
|
//创建内容
|
|
//创建内容
|
|
for (int i = 0; i < values.size(); i++) {
|
|
for (int i = 0; i < values.size(); i++) {
|
|
- row = sheet.createRow(i + 1);
|
|
|
|
|
|
+ row = sheet.createRow(i + 3);
|
|
for (int j = 0; j < values.get(i).size(); j++) {
|
|
for (int j = 0; j < values.get(i).size(); j++) {
|
|
//将内容按顺序赋给对应的列对象
|
|
//将内容按顺序赋给对应的列对象
|
|
row.createCell(j).setCellValue(values.get(i).get(j));
|
|
row.createCell(j).setCellValue(values.get(i).get(j));
|
|
@@ -611,9 +627,9 @@ public class ExcelUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private static void createProductContractSheet(HSSFWorkbook wb, List<ProductDataVO> productDataVOList) {
|
|
|
|
|
|
+ private static void createProductContractSheet(XSSFWorkbook wb, List<ProductDataVO> productDataVOList) {
|
|
try{
|
|
try{
|
|
- HSSFSheet sheet = wb.createSheet("产品合同信息");
|
|
|
|
|
|
+ XSSFSheet sheet = wb.createSheet("产品合同信息");
|
|
List<String> title = new ArrayList<>();
|
|
List<String> title = new ArrayList<>();
|
|
title.add("编号");
|
|
title.add("编号");
|
|
title.add("中基协基金编号");
|
|
title.add("中基协基金编号");
|
|
@@ -626,13 +642,29 @@ public class ExcelUtil {
|
|
title.add("业绩比较基准");
|
|
title.add("业绩比较基准");
|
|
title.add("业绩报酬计提方式");
|
|
title.add("业绩报酬计提方式");
|
|
title.add("备注");
|
|
title.add("备注");
|
|
- // 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制
|
|
|
|
- HSSFRow row = sheet.createRow(0);
|
|
|
|
- // 第四步,创建单元格,并设置值表头 设置表头居中
|
|
|
|
- HSSFCellStyle style = wb.createCellStyle();
|
|
|
|
|
|
+ //创建第一行
|
|
|
|
+ XSSFRow row1 = sheet.createRow(0);
|
|
|
|
+ XSSFRow row2 = sheet.createRow(1);
|
|
|
|
+ for (int i = 0; i < title.size(); i++) {
|
|
|
|
+ row1.createCell(i);
|
|
|
|
+ row2.createCell(i);
|
|
|
|
+ }
|
|
|
|
+ XSSFCell firstCcell = row1.createCell(0);
|
|
|
|
+ firstCcell.setCellValue("私募管理人数据推送信息填写(其他信息)");
|
|
|
|
+ XSSFCellStyle style = wb.createCellStyle();
|
|
|
|
+ Font font = wb.createFont();
|
|
|
|
+ font.setFontName("微软");//设置字体
|
|
|
|
+ font.setBold(true);//加粗
|
|
|
|
+ font.setFontHeightInPoints((short) 12);//设置字体大小
|
|
|
|
+ font.setBold(true);
|
|
|
|
+ style.setFont(font);//设置单元格字体
|
|
style.setAlignment(HorizontalAlignment.LEFT);
|
|
style.setAlignment(HorizontalAlignment.LEFT);
|
|
style.setWrapText(true);
|
|
style.setWrapText(true);
|
|
- sheet.setColumnWidth(0, 1000);
|
|
|
|
|
|
+ firstCcell.setCellStyle(style);
|
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(0,1,0,title.size()));
|
|
|
|
+ XSSFRow row = sheet.createRow(2);
|
|
|
|
+ // 第四步,创建单元格,并设置值表头 设置表头居中
|
|
|
|
+ sheet.setColumnWidth(0, 2000);
|
|
sheet.setColumnWidth(1, 5000);
|
|
sheet.setColumnWidth(1, 5000);
|
|
sheet.setColumnWidth(2, 10000);
|
|
sheet.setColumnWidth(2, 10000);
|
|
sheet.setColumnWidth(3, 8000);
|
|
sheet.setColumnWidth(3, 8000);
|
|
@@ -641,10 +673,10 @@ public class ExcelUtil {
|
|
sheet.setColumnWidth(6, 5000);
|
|
sheet.setColumnWidth(6, 5000);
|
|
sheet.setColumnWidth(7, 5000);
|
|
sheet.setColumnWidth(7, 5000);
|
|
sheet.setColumnWidth(8, 5000);
|
|
sheet.setColumnWidth(8, 5000);
|
|
- sheet.setColumnWidth(9, 5000);
|
|
|
|
|
|
+ sheet.setColumnWidth(9, 8000);
|
|
sheet.setColumnWidth(10, 5000);
|
|
sheet.setColumnWidth(10, 5000);
|
|
//声明列对象
|
|
//声明列对象
|
|
- HSSFCell cell = null;
|
|
|
|
|
|
+ XSSFCell cell = null;
|
|
//创建标题
|
|
//创建标题
|
|
for (int i = 0; i < title.size(); i++) {
|
|
for (int i = 0; i < title.size(); i++) {
|
|
cell = row.createCell(i);
|
|
cell = row.createCell(i);
|
|
@@ -671,7 +703,7 @@ public class ExcelUtil {
|
|
}
|
|
}
|
|
//创建内容
|
|
//创建内容
|
|
for (int i = 0; i < values.size(); i++) {
|
|
for (int i = 0; i < values.size(); i++) {
|
|
- row = sheet.createRow(i + 1);
|
|
|
|
|
|
+ row = sheet.createRow(i + 3);
|
|
for (int j = 0; j < values.get(i).size(); j++) {
|
|
for (int j = 0; j < values.get(i).size(); j++) {
|
|
//将内容按顺序赋给对应的列对象
|
|
//将内容按顺序赋给对应的列对象
|
|
row.createCell(j).setCellValue(values.get(i).get(j));
|
|
row.createCell(j).setCellValue(values.get(i).get(j));
|
|
@@ -685,9 +717,9 @@ public class ExcelUtil {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private static void createProductDetailSheet(HSSFWorkbook wb, List<ProductDataVO> productDataVOList) {
|
|
|
|
|
|
+ private static void createProductDetailSheet(XSSFWorkbook wb, List<ProductDataVO> productDataVOList) {
|
|
try{
|
|
try{
|
|
- HSSFSheet sheet = wb.createSheet("产品其他信息");
|
|
|
|
|
|
+ XSSFSheet sheet = wb.createSheet("产品其他信息");
|
|
List<String> title = new ArrayList<>();
|
|
List<String> title = new ArrayList<>();
|
|
title.add("编号");
|
|
title.add("编号");
|
|
title.add("中基协基金编号");
|
|
title.add("中基协基金编号");
|
|
@@ -705,13 +737,28 @@ public class ExcelUtil {
|
|
title.add("管理人费率");
|
|
title.add("管理人费率");
|
|
title.add("托管费率");
|
|
title.add("托管费率");
|
|
title.add("外包费率");
|
|
title.add("外包费率");
|
|
- // 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制
|
|
|
|
- HSSFRow row = sheet.createRow(0);
|
|
|
|
- // 第四步,创建单元格,并设置值表头 设置表头居中
|
|
|
|
- HSSFCellStyle style = wb.createCellStyle();
|
|
|
|
|
|
+ //创建第一行
|
|
|
|
+ XSSFRow row1 = sheet.createRow(0);
|
|
|
|
+ XSSFRow row2 = sheet.createRow(1);
|
|
|
|
+ for (int i = 0; i < title.size(); i++) {
|
|
|
|
+ row1.createCell(i);
|
|
|
|
+ row2.createCell(i);
|
|
|
|
+ }
|
|
|
|
+ XSSFCell firstCcell = row1.createCell(0);
|
|
|
|
+ firstCcell.setCellValue("私募管理人数据推送信息填写(其他信息)");
|
|
|
|
+ XSSFCellStyle style = wb.createCellStyle();
|
|
|
|
+ Font font = wb.createFont();
|
|
|
|
+ font.setFontName("微软");//设置字体
|
|
|
|
+ font.setBold(true);//加粗
|
|
|
|
+ font.setFontHeightInPoints((short) 12);//设置字体大小
|
|
|
|
+ font.setBold(true);
|
|
|
|
+ style.setFont(font);//设置单元格字体
|
|
style.setAlignment(HorizontalAlignment.LEFT);
|
|
style.setAlignment(HorizontalAlignment.LEFT);
|
|
style.setWrapText(true);
|
|
style.setWrapText(true);
|
|
- sheet.setColumnWidth(0, 1000);
|
|
|
|
|
|
+ firstCcell.setCellStyle(style);
|
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(0,1,0,title.size()));
|
|
|
|
+ XSSFRow row = sheet.createRow(2);
|
|
|
|
+ sheet.setColumnWidth(0, 3000);
|
|
sheet.setColumnWidth(1, 5000);
|
|
sheet.setColumnWidth(1, 5000);
|
|
sheet.setColumnWidth(2, 10000);
|
|
sheet.setColumnWidth(2, 10000);
|
|
sheet.setColumnWidth(3, 8000);
|
|
sheet.setColumnWidth(3, 8000);
|
|
@@ -719,16 +766,16 @@ public class ExcelUtil {
|
|
sheet.setColumnWidth(5, 5000);
|
|
sheet.setColumnWidth(5, 5000);
|
|
sheet.setColumnWidth(6, 5000);
|
|
sheet.setColumnWidth(6, 5000);
|
|
sheet.setColumnWidth(7, 5000);
|
|
sheet.setColumnWidth(7, 5000);
|
|
- sheet.setColumnWidth(8, 15000);
|
|
|
|
- sheet.setColumnWidth(9, 5000);
|
|
|
|
- sheet.setColumnWidth(10, 5000);
|
|
|
|
|
|
+ sheet.setColumnWidth(8, 17000);
|
|
|
|
+ sheet.setColumnWidth(9, 8000);
|
|
|
|
+ sheet.setColumnWidth(10, 8000);
|
|
sheet.setColumnWidth(11, 5000);
|
|
sheet.setColumnWidth(11, 5000);
|
|
sheet.setColumnWidth(12, 5000);
|
|
sheet.setColumnWidth(12, 5000);
|
|
sheet.setColumnWidth(13, 5000);
|
|
sheet.setColumnWidth(13, 5000);
|
|
sheet.setColumnWidth(14, 5000);
|
|
sheet.setColumnWidth(14, 5000);
|
|
sheet.setColumnWidth(15, 5000);
|
|
sheet.setColumnWidth(15, 5000);
|
|
//声明列对象
|
|
//声明列对象
|
|
- HSSFCell cell = null;
|
|
|
|
|
|
+ XSSFCell cell = null;
|
|
//创建标题
|
|
//创建标题
|
|
for (int i = 0; i < title.size(); i++) {
|
|
for (int i = 0; i < title.size(); i++) {
|
|
cell = row.createCell(i);
|
|
cell = row.createCell(i);
|
|
@@ -760,7 +807,7 @@ public class ExcelUtil {
|
|
}
|
|
}
|
|
//创建内容
|
|
//创建内容
|
|
for (int i = 0; i < values.size(); i++) {
|
|
for (int i = 0; i < values.size(); i++) {
|
|
- row = sheet.createRow(i + 1);
|
|
|
|
|
|
+ row = sheet.createRow(i + 3);
|
|
for (int j = 0; j < values.get(i).size(); j++) {
|
|
for (int j = 0; j < values.get(i).size(); j++) {
|
|
//将内容按顺序赋给对应的列对象
|
|
//将内容按顺序赋给对应的列对象
|
|
row.createCell(j).setCellValue(values.get(i).get(j));
|
|
row.createCell(j).setCellValue(values.get(i).get(j));
|
|
@@ -775,9 +822,9 @@ public class ExcelUtil {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private static void createProductInfoSheet(HSSFWorkbook wb, List<ProductDataVO> productDataVOList) {
|
|
|
|
|
|
+ private static void createProductInfoSheet(XSSFWorkbook wb, List<ProductDataVO> productDataVOList) {
|
|
try{
|
|
try{
|
|
- HSSFSheet sheet = wb.createSheet("产品基本信息");
|
|
|
|
|
|
+ XSSFSheet sheet = wb.createSheet("产品基本信息");
|
|
List<String> title = new ArrayList<>();
|
|
List<String> title = new ArrayList<>();
|
|
title.add("编号");
|
|
title.add("编号");
|
|
title.add("中基协基金编号");
|
|
title.add("中基协基金编号");
|
|
@@ -796,31 +843,46 @@ public class ExcelUtil {
|
|
title.add("基金资产净值提供频率");
|
|
title.add("基金资产净值提供频率");
|
|
title.add("定期报告");
|
|
title.add("定期报告");
|
|
title.add("备注");
|
|
title.add("备注");
|
|
- // 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制
|
|
|
|
- HSSFRow row = sheet.createRow(0);
|
|
|
|
- // 第四步,创建单元格,并设置值表头 设置表头居中
|
|
|
|
- HSSFCellStyle style = wb.createCellStyle();
|
|
|
|
|
|
+ //创建第一行
|
|
|
|
+ XSSFRow row1 = sheet.createRow(0);
|
|
|
|
+ XSSFRow row2 = sheet.createRow(1);
|
|
|
|
+ for (int i = 0; i < title.size(); i++) {
|
|
|
|
+ row1.createCell(i);
|
|
|
|
+ row2.createCell(i);
|
|
|
|
+ }
|
|
|
|
+ XSSFCell firstCcell = row1.createCell(0);
|
|
|
|
+ firstCcell.setCellValue("私募管理人数据推送信息填写(产品基本信息)");
|
|
|
|
+ XSSFCellStyle style = wb.createCellStyle();
|
|
|
|
+ Font font = wb.createFont();
|
|
|
|
+ font.setFontName("微软");//设置字体
|
|
|
|
+ font.setBold(true);//加粗
|
|
|
|
+ font.setFontHeightInPoints((short) 12);//设置字体大小
|
|
|
|
+ font.setBold(true);
|
|
|
|
+ style.setFont(font);//设置单元格字体
|
|
style.setAlignment(HorizontalAlignment.LEFT);
|
|
style.setAlignment(HorizontalAlignment.LEFT);
|
|
style.setWrapText(true);
|
|
style.setWrapText(true);
|
|
- sheet.setColumnWidth(0, 1000);
|
|
|
|
- sheet.setColumnWidth(1, 5000);
|
|
|
|
|
|
+ firstCcell.setCellStyle(style);
|
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(0,1,0,title.size()));
|
|
|
|
+ XSSFRow row = sheet.createRow(2);
|
|
|
|
+ sheet.setColumnWidth(0, 3000);
|
|
|
|
+ sheet.setColumnWidth(1, 10000);
|
|
sheet.setColumnWidth(2, 10000);
|
|
sheet.setColumnWidth(2, 10000);
|
|
sheet.setColumnWidth(3, 8000);
|
|
sheet.setColumnWidth(3, 8000);
|
|
sheet.setColumnWidth(4, 8000);
|
|
sheet.setColumnWidth(4, 8000);
|
|
sheet.setColumnWidth(5, 5000);
|
|
sheet.setColumnWidth(5, 5000);
|
|
- sheet.setColumnWidth(6, 5000);
|
|
|
|
|
|
+ sheet.setColumnWidth(6, 10000);
|
|
sheet.setColumnWidth(7, 5000);
|
|
sheet.setColumnWidth(7, 5000);
|
|
sheet.setColumnWidth(8, 5000);
|
|
sheet.setColumnWidth(8, 5000);
|
|
sheet.setColumnWidth(9, 5000);
|
|
sheet.setColumnWidth(9, 5000);
|
|
sheet.setColumnWidth(10, 15000);
|
|
sheet.setColumnWidth(10, 15000);
|
|
sheet.setColumnWidth(11, 5000);
|
|
sheet.setColumnWidth(11, 5000);
|
|
sheet.setColumnWidth(12, 5000);
|
|
sheet.setColumnWidth(12, 5000);
|
|
- sheet.setColumnWidth(13, 5000);
|
|
|
|
- sheet.setColumnWidth(14, 5000);
|
|
|
|
|
|
+ sheet.setColumnWidth(13, 10000);
|
|
|
|
+ sheet.setColumnWidth(14, 10000);
|
|
sheet.setColumnWidth(15, 5000);
|
|
sheet.setColumnWidth(15, 5000);
|
|
sheet.setColumnWidth(16, 5000);
|
|
sheet.setColumnWidth(16, 5000);
|
|
//声明列对象
|
|
//声明列对象
|
|
- HSSFCell cell = null;
|
|
|
|
|
|
+ XSSFCell cell = null;
|
|
//创建标题
|
|
//创建标题
|
|
for (int i = 0; i < title.size(); i++) {
|
|
for (int i = 0; i < title.size(); i++) {
|
|
cell = row.createCell(i);
|
|
cell = row.createCell(i);
|
|
@@ -853,7 +915,7 @@ public class ExcelUtil {
|
|
}
|
|
}
|
|
//创建内容
|
|
//创建内容
|
|
for (int i = 0; i < values.size(); i++) {
|
|
for (int i = 0; i < values.size(); i++) {
|
|
- row = sheet.createRow(i + 1);
|
|
|
|
|
|
+ row = sheet.createRow(i + 3);
|
|
for (int j = 0; j < values.get(i).size(); j++) {
|
|
for (int j = 0; j < values.get(i).size(); j++) {
|
|
//将内容按顺序赋给对应的列对象
|
|
//将内容按顺序赋给对应的列对象
|
|
row.createCell(j).setCellValue(values.get(i).get(j));
|
|
row.createCell(j).setCellValue(values.get(i).get(j));
|