@@ -123,6 +123,7 @@ public class ExcelExportUtil { | |||||
* 模板集合 | * 模板集合 | ||||
* @return | * @return | ||||
*/ | */ | ||||
@Deprecated | |||||
public static Workbook exportExcel(TemplateExportParams params, Class<?> pojoClass, | public static Workbook exportExcel(TemplateExportParams params, Class<?> pojoClass, | ||||
Collection<?> dataSet, Map<String, Object> map) { | Collection<?> dataSet, Map<String, Object> map) { | ||||
return new ExcelExportOfTemplateUtil().createExcleByTemplate(params, pojoClass, dataSet, | return new ExcelExportOfTemplateUtil().createExcleByTemplate(params, pojoClass, dataSet, | ||||
@@ -52,7 +52,6 @@ public class ExcelBaseEntity { | |||||
private Method method; | private Method method; | ||||
/** | /** | ||||
* 这个是不是超链接,如果是需要实现接口返回对象 | * 这个是不是超链接,如果是需要实现接口返回对象 | ||||
* @return | |||||
*/ | */ | ||||
private boolean hyperlink; | private boolean hyperlink; | ||||
@@ -152,7 +152,7 @@ public class ExcelExportServer extends ExcelExportBase { | |||||
} | } | ||||
try { | try { | ||||
dataHanlder = entity.getDataHanlder(); | dataHanlder = entity.getDataHanlder(); | ||||
if (dataHanlder != null) { | |||||
if (dataHanlder != null && dataHanlder.getNeedHandlerFields() != null) { | |||||
needHanlderList = Arrays.asList(dataHanlder.getNeedHandlerFields()); | needHanlderList = Arrays.asList(dataHanlder.getNeedHandlerFields()); | ||||
} | } | ||||
// 创建表格样式 | // 创建表格样式 | ||||
@@ -78,7 +78,7 @@ public final class ExcelExportOfTemplateUtil extends ExcelExportBase { | |||||
/** | /** | ||||
* 往Sheet 填充正常数据,根据表头信息 使用导入的部分逻辑,坐对象映射 | * 往Sheet 填充正常数据,根据表头信息 使用导入的部分逻辑,坐对象映射 | ||||
* | * | ||||
* @param teplateParams | |||||
* @param sheet | |||||
* @param pojoClass | * @param pojoClass | ||||
* @param dataSet | * @param dataSet | ||||
* @param workbook | * @param workbook | ||||
@@ -124,7 +124,7 @@ public final class ExcelExportOfTemplateUtil extends ExcelExportBase { | |||||
/** | /** | ||||
* 下移数据 | * 下移数据 | ||||
* @param its | |||||
* @param dataSet | |||||
* @param excelParams | * @param excelParams | ||||
* @return | * @return | ||||
*/ | */ | ||||
@@ -204,10 +204,7 @@ public final class ExcelExportOfTemplateUtil extends ExcelExportBase { | |||||
/** | /** | ||||
* 克隆excel防止操作原对象,workbook无法克隆,只能对excel进行克隆 | * 克隆excel防止操作原对象,workbook无法克隆,只能对excel进行克隆 | ||||
* | * | ||||
* @param teplateParams | |||||
* @throws Exception | * @throws Exception | ||||
* @author JueYue | |||||
* 2013-11-11 | |||||
*/ | */ | ||||
private Workbook getCloneWorkBook() throws Exception { | private Workbook getCloneWorkBook() throws Exception { | ||||
return ExcelCache.getWorkbook(teplateParams.getTemplateUrl(), teplateParams.getSheetNum(), | return ExcelCache.getWorkbook(teplateParams.getTemplateUrl(), teplateParams.getSheetNum(), | ||||
@@ -218,7 +215,6 @@ public final class ExcelExportOfTemplateUtil extends ExcelExportBase { | |||||
/** | /** | ||||
* 获取表头数据,设置表头的序号 | * 获取表头数据,设置表头的序号 | ||||
* | * | ||||
* @param teplateParams | |||||
* @param sheet | * @param sheet | ||||
* @return | * @return | ||||
*/ | */ | ||||
@@ -349,7 +345,7 @@ public final class ExcelExportOfTemplateUtil extends ExcelExportBase { | |||||
* 利用foreach循环输出数据 | * 利用foreach循环输出数据 | ||||
* @param cell | * @param cell | ||||
* @param map | * @param map | ||||
* @param oldString | |||||
* @param name | |||||
* @throws Exception | * @throws Exception | ||||
*/ | */ | ||||
private void addListDataToExcel(Cell cell, Map<String, Object> map, | private void addListDataToExcel(Cell cell, Map<String, Object> map, | ||||
@@ -417,12 +413,15 @@ public final class ExcelExportOfTemplateUtil extends ExcelExportBase { | |||||
MergedRegionHelper mergedRegionHelper) throws Exception { | MergedRegionHelper mergedRegionHelper) throws Exception { | ||||
//所有的cell创建一遍 | //所有的cell创建一遍 | ||||
for (int i = 0; i < rowspan; i++) { | for (int i = 0; i < rowspan; i++) { | ||||
int size = columns.size();//判断是不是超出设置了 | |||||
for (int j = columnIndex, max = columnIndex + colspan; j < max; j++) { | for (int j = columnIndex, max = columnIndex + colspan; j < max; j++) { | ||||
if (row.getCell(j) == null) { | if (row.getCell(j) == null) { | ||||
row.createCell(j); | row.createCell(j); | ||||
CellStyle style = row.getRowNum() % 2 == 0 | CellStyle style = row.getRowNum() % 2 == 0 | ||||
? getStyles(false, columns.get(columnIndex - j)) | |||||
: getStyles(true, columns.get(columnIndex - j)); | |||||
? getStyles(false, | |||||
size >= j - columnIndex ? null : columns.get(j - columnIndex)) | |||||
: getStyles(true, | |||||
size >= j - columnIndex ? null : columns.get(j - columnIndex)); | |||||
//返回的styler不为空时才使用,否则使用Excel设置的,更加推荐Excel设置的样式 | //返回的styler不为空时才使用,否则使用Excel设置的,更加推荐Excel设置的样式 | ||||
if (style != null) | if (style != null) | ||||
row.getCell(j).setCellStyle(style); | row.getCell(j).setCellStyle(style); | ||||
@@ -501,7 +500,7 @@ public final class ExcelExportOfTemplateUtil extends ExcelExportBase { | |||||
* 设置合并单元格的样式 | * 设置合并单元格的样式 | ||||
* @param row | * @param row | ||||
* @param ci | * @param ci | ||||
* @param excelForEachParams | |||||
* @param params | |||||
*/ | */ | ||||
private void setMergedRegionStyle(Row row, int ci, ExcelForEachParams params) { | private void setMergedRegionStyle(Row row, int ci, ExcelForEachParams params) { | ||||
//第一行数据 | //第一行数据 | ||||
@@ -593,7 +592,7 @@ public final class ExcelExportOfTemplateUtil extends ExcelExportBase { | |||||
/** | /** | ||||
* 获取模板参数 | * 获取模板参数 | ||||
* @param string | |||||
* @param name | |||||
* @param cell | * @param cell | ||||
* @param mergedRegionHelper | * @param mergedRegionHelper | ||||
* @return | * @return | ||||
@@ -628,7 +627,6 @@ public final class ExcelExportOfTemplateUtil extends ExcelExportBase { | |||||
* | * | ||||
* @param excelParams | * @param excelParams | ||||
* @param titlemap | * @param titlemap | ||||
* @return | |||||
*/ | */ | ||||
private void sortAndFilterExportField(List<ExcelExportEntity> excelParams, | private void sortAndFilterExportField(List<ExcelExportEntity> excelParams, | ||||
Map<String, Integer> titlemap) { | Map<String, Integer> titlemap) { | ||||
@@ -149,7 +149,6 @@ public class ExcelChartBuildService { | |||||
/** | /** | ||||
* 构建图形对象 | * 构建图形对象 | ||||
* @param workbook | |||||
* @param dataSourceSheet | * @param dataSourceSheet | ||||
* @param tragetSheet | * @param tragetSheet | ||||
* @param graph | * @param graph | ||||
@@ -242,7 +242,7 @@ public class ExcelToHtmlServer { | |||||
* 获取图片最大宽度 | * 获取图片最大宽度 | ||||
* @param colIndex | * @param colIndex | ||||
* @param sheet | * @param sheet | ||||
* @param span | |||||
* @param rowAndColSpan | |||||
* @return | * @return | ||||
*/ | */ | ||||
private int getImageMaxWidth(Integer[] rowAndColSpan, int colIndex, Sheet sheet) { | private int getImageMaxWidth(Integer[] rowAndColSpan, int colIndex, Sheet sheet) { | ||||
@@ -56,7 +56,7 @@ public class CellValueServer { | |||||
* 获取单元格内的值 | * 获取单元格内的值 | ||||
* | * | ||||
* @param cell | * @param cell | ||||
* @param colInfo | |||||
* @param entity | |||||
* @return | * @return | ||||
*/ | */ | ||||
private Object getCellValue(String xclass, Cell cell, ExcelImportEntity entity) { | private Object getCellValue(String xclass, Cell cell, ExcelImportEntity entity) { | ||||
@@ -86,7 +86,6 @@ public class ExcelImportServer extends ImportBaseService { | |||||
/*** | /*** | ||||
* 向List里面继续添加元素 | * 向List里面继续添加元素 | ||||
* | * | ||||
* @param exclusions | |||||
* @param object | * @param object | ||||
* @param param | * @param param | ||||
* @param row | * @param row | ||||
@@ -157,16 +157,15 @@ public class SaxRowRead extends ImportBaseService implements ISaxRowRead { | |||||
} | } | ||||
/*** | |||||
/** | |||||
* 向List里面继续添加元素 | * 向List里面继续添加元素 | ||||
* | |||||
* @param exclusions | |||||
* @param object | * @param object | ||||
* @param param | * @param param | ||||
* @param datas | * @param datas | ||||
* @param titlemap | * @param titlemap | ||||
* @param targetId | * @param targetId | ||||
* @param params | * @param params | ||||
* @throws Exception | |||||
*/ | */ | ||||
private void addListContinue(Object object, ExcelCollectionParams param, | private void addListContinue(Object object, ExcelCollectionParams param, | ||||
List<SaxReadCellEntity> datas, Map<Integer, String> titlemap, | List<SaxReadCellEntity> datas, Map<Integer, String> titlemap, | ||||
@@ -169,7 +169,7 @@ public class PdfExportServer extends ExportBase { | |||||
* @param table | * @param table | ||||
* @param obj | * @param obj | ||||
* @param rowHeight | * @param rowHeight | ||||
* @param list | |||||
* @param excelParams | |||||
* @throws Exception | * @throws Exception | ||||
*/ | */ | ||||
private void createListCells(PdfPTable table, Object obj, List<ExcelExportEntity> excelParams, | private void createListCells(PdfPTable table, Object obj, List<ExcelExportEntity> excelParams, | ||||
@@ -247,7 +247,7 @@ public class PdfExportServer extends ExportBase { | |||||
* 创建表头 | * 创建表头 | ||||
* | * | ||||
* @param title | * @param title | ||||
* @param index | |||||
* @param table | |||||
*/ | */ | ||||
private int createTitleRow(PdfExportParams title, PdfPTable table, | private int createTitleRow(PdfExportParams title, PdfPTable table, | ||||
List<ExcelExportEntity> excelParams) { | List<ExcelExportEntity> excelParams) { | ||||
@@ -132,7 +132,7 @@ public final class PoiElUtil { | |||||
/** | /** | ||||
* 判断是不是常量 | * 判断是不是常量 | ||||
* @param string | |||||
* @param param | |||||
* @return | * @return | ||||
*/ | */ | ||||
private static String isConstant(String param) { | private static String isConstant(String param) { | ||||
@@ -66,10 +66,10 @@ public class ParseWord07 { | |||||
Object[] isAndType = PoiPublicUtil.getIsAndType(obj); | Object[] isAndType = PoiPublicUtil.getIsAndType(obj); | ||||
String picId; | String picId; | ||||
try { | try { | ||||
picId = currentRun.getParagraph().getDocument().addPictureData((byte[]) isAndType[0], | |||||
picId = currentRun.getDocument().addPictureData((byte[]) isAndType[0], | |||||
(Integer) isAndType[1]); | (Integer) isAndType[1]); | ||||
((MyXWPFDocument) currentRun.getParagraph().getDocument()).createPicture(currentRun, | |||||
picId, currentRun.getParagraph().getDocument() | |||||
((MyXWPFDocument) currentRun.getDocument()).createPicture(currentRun, | |||||
picId, currentRun.getDocument() | |||||
.getNextPicNameNumber((Integer) isAndType[1]), | .getNextPicNameNumber((Integer) isAndType[1]), | ||||
obj.getWidth(), obj.getHeight()); | obj.getWidth(), obj.getHeight()); | ||||
@@ -200,7 +200,6 @@ public class ExcelEntityParse extends ExportBase { | |||||
* | * | ||||
* @param excelParams | * @param excelParams | ||||
* @param titlemap | * @param titlemap | ||||
* @return | |||||
*/ | */ | ||||
private void sortAndFilterExportField(List<ExcelExportEntity> excelParams, | private void sortAndFilterExportField(List<ExcelExportEntity> excelParams, | ||||
Map<String, Integer> titlemap) { | Map<String, Integer> titlemap) { | ||||