From 9b7e3bad7afbf13fa298bcced02c7916bcb660e3 Mon Sep 17 00:00:00 2001 From: jueyue Date: Sun, 10 Aug 2014 00:04:45 +0800 Subject: [PATCH] =?UTF-8?q?Word=E7=9A=84=E6=A8=A1=E6=9D=BF=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=B7=B2=E7=BB=8F=E5=9F=BA=E6=9C=AC=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org.eclipse.core.resources.prefs | 1 + easypoi-base/pom.xml | 2 +- .../poi/excel/export/ExcelExportServer.java | 1 + .../export/{ => base}/ExcelExportBase.java | 290 +--------------- .../poi/excel/export/base/ExportBase.java | 314 ++++++++++++++++++ .../template/ExcelExportOfTemplateUtil.java | 2 +- .../exception/word/WordExportException.java | 27 ++ .../exception/word/enmus/WordExportEnum.java | 29 ++ .../impl/ExcelDataHandlerDefaultImpl.java | 1 + .../poi/handler/inter/IExcelDataHandler.java | 5 +- .../handler/inter/IExcelVerifyHandler.java | 17 + .../poi/word/entity/WordImageEntity.java | 29 +- .../word/entity/params/ExcelListEntity.java | 69 ++++ .../word/entity/params/ListParamEntity.java | 78 +++++ .../poi/word/parse/ParseWord07.java | 224 ++++++------- .../word/parse/excel/ExcelEntityParse.java | 208 ++++++++++++ .../poi/word/parse/excel/ExcelMapParse.java | 71 ++++ .../poi/word/util/ParseWordUtil.java | 4 +- easypoi-test/.classpath | 6 + easypoi-test/pom.xml | 2 +- .../java/org/jeecgframework/poi/UtilTest.java | 13 + .../poi/word/WordExportUtilAnnExcelTest.java | 119 +++++++ .../poi/word/WordExportUtilBaseExcelTest.java | 79 +++++ .../jeecgframework/poi/word/doc/Excel.docx | Bin 0 -> 14845 bytes .../poi/word/doc/SimpleExcel.docx | Bin 0 -> 14706 bytes .../poi/word/entity/Person.java | 43 +++ easypoi-web/pom.xml | 2 +- pom.xml | 4 +- 28 files changed, 1218 insertions(+), 422 deletions(-) rename easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/{ => base}/ExcelExportBase.java (56%) create mode 100644 easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/base/ExportBase.java create mode 100644 easypoi-base/src/main/java/org/jeecgframework/poi/exception/word/WordExportException.java create mode 100644 easypoi-base/src/main/java/org/jeecgframework/poi/exception/word/enmus/WordExportEnum.java create mode 100644 easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/params/ExcelListEntity.java create mode 100644 easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/params/ListParamEntity.java create mode 100644 easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/excel/ExcelEntityParse.java create mode 100644 easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/excel/ExcelMapParse.java create mode 100644 easypoi-test/src/main/java/org/jeecgframework/poi/UtilTest.java create mode 100644 easypoi-test/src/main/java/org/jeecgframework/poi/word/WordExportUtilAnnExcelTest.java create mode 100644 easypoi-test/src/main/java/org/jeecgframework/poi/word/WordExportUtilBaseExcelTest.java create mode 100644 easypoi-test/src/main/java/org/jeecgframework/poi/word/doc/Excel.docx create mode 100644 easypoi-test/src/main/java/org/jeecgframework/poi/word/doc/SimpleExcel.docx create mode 100644 easypoi-test/src/main/java/org/jeecgframework/poi/word/entity/Person.java diff --git a/easypoi-base/.settings/org.eclipse.core.resources.prefs b/easypoi-base/.settings/org.eclipse.core.resources.prefs index 1f887b6..2e67b95 100644 --- a/easypoi-base/.settings/org.eclipse.core.resources.prefs +++ b/easypoi-base/.settings/org.eclipse.core.resources.prefs @@ -1,2 +1,3 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 diff --git a/easypoi-base/pom.xml b/easypoi-base/pom.xml index 3fb8ca9..bf8bb20 100644 --- a/easypoi-base/pom.xml +++ b/easypoi-base/pom.xml @@ -4,7 +4,7 @@ org.jeecgframework easypoi - 2.0.1 + 2.0.2 easypoi-base diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/ExcelExportServer.java b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/ExcelExportServer.java index d3bff42..344f158 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/ExcelExportServer.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/ExcelExportServer.java @@ -22,6 +22,7 @@ import org.apache.poi.ss.util.CellRangeAddress; import org.jeecgframework.poi.excel.annotation.ExcelTarget; import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity; +import org.jeecgframework.poi.excel.export.base.ExcelExportBase; import org.jeecgframework.poi.exception.excel.ExcelExportException; import org.jeecgframework.poi.exception.excel.enums.ExcelExportEnum; import org.jeecgframework.poi.util.POIPublicUtil; diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/ExcelExportBase.java b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/base/ExcelExportBase.java similarity index 56% rename from easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/ExcelExportBase.java rename to easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/base/ExcelExportBase.java index 88d400e..e9eccc5 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/ExcelExportBase.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/base/ExcelExportBase.java @@ -1,15 +1,12 @@ -package org.jeecgframework.poi.excel.export; +package org.jeecgframework.poi.excel.export.base; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; -import java.lang.reflect.Field; import java.lang.reflect.Method; -import java.lang.reflect.ParameterizedType; import java.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Date; @@ -33,10 +30,6 @@ import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.util.CellRangeAddress; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecgframework.poi.excel.annotation.ExcelCollection; -import org.jeecgframework.poi.excel.annotation.ExcelEntity; -import org.jeecgframework.poi.excel.entity.params.ComparatorExcelField; import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity; import org.jeecgframework.poi.excel.entity.params.MergeEntity; import org.jeecgframework.poi.handler.inter.IExcelDataHandler; @@ -48,184 +41,7 @@ import org.jeecgframework.poi.util.POIPublicUtil; * @author JueYue * @date 2014年6月17日 下午6:15:13 */ -public abstract class ExcelExportBase { - - protected IExcelDataHandler dataHanlder; - - protected List needHanlderList; - - /** - * 获取需要导出的全部字段 - * - * @param exclusions - * @param targetId - * 目标ID - * @param fields - * @throws Exception - */ - public void getAllExcelField(String[] exclusions, String targetId, - Field[] fields, List excelParams, - Class pojoClass, List getMethods) throws Exception { - List exclusionsList = exclusions != null ? Arrays - .asList(exclusions) : null; - ExcelExportEntity excelEntity; - // 遍历整个filed - for (int i = 0; i < fields.length; i++) { - Field field = fields[i]; - // 先判断是不是collection,在判断是不是java自带对象,之后就是我们自己的对象了 - if (POIPublicUtil.isNotUserExcelUserThis(exclusionsList, field, - targetId)) { - continue; - } - if (POIPublicUtil.isCollection(field.getType())) { - ExcelCollection excel = field - .getAnnotation(ExcelCollection.class); - ParameterizedType pt = (ParameterizedType) field - .getGenericType(); - Class clz = (Class) pt.getActualTypeArguments()[0]; - List list = new ArrayList(); - getAllExcelField(exclusions, - StringUtils.isNotEmpty(excel.id()) ? excel.id() - : targetId, - POIPublicUtil.getClassFields(clz), list, clz, null); - excelEntity = new ExcelExportEntity(); - excelEntity.setName(getExcelName(excel.name(), targetId)); - excelEntity - .setOrderNum(getCellOrder(excel.orderNum(), targetId)); - excelEntity.setMethod(POIPublicUtil.getMethod( - field.getName(), pojoClass)); - excelEntity.setList(list); - excelParams.add(excelEntity); - } else if (POIPublicUtil.isJavaClass(field)) { - excelParams.add(createExcelExportEntity(field, targetId, - pojoClass, getMethods)); - } else { - List newMethods = new ArrayList(); - if (getMethods != null) { - newMethods.addAll(getMethods); - } - newMethods.add(POIPublicUtil.getMethod(field.getName(), - pojoClass)); - ExcelEntity excel = field.getAnnotation(ExcelEntity.class); - getAllExcelField(exclusions, - StringUtils.isNotEmpty(excel.id()) ? excel.id() - : targetId, - POIPublicUtil.getClassFields(field.getType()), - excelParams, field.getType(), newMethods); - } - } - } - - /** - * 创建导出实体对象 - * - * @param field - * @param targetId - * @param pojoClass - * @param getMethods - * @return - * @throws Exception - */ - private ExcelExportEntity createExcelExportEntity(Field field, - String targetId, Class pojoClass, List getMethods) - throws Exception { - Excel excel = field.getAnnotation(Excel.class); - ExcelExportEntity excelEntity = new ExcelExportEntity(); - excelEntity.setType(excel.type()); - getExcelField(targetId, field, excelEntity, excel, pojoClass); - if (getMethods != null) { - List newMethods = new ArrayList(); - newMethods.addAll(getMethods); - newMethods.add(excelEntity.getMethod()); - excelEntity.setMethods(newMethods); - } - return excelEntity; - } - - /** - * 判断在这个单元格显示的名称 - * - * @param exportName - * @param targetId - * @return - */ - public String getExcelName(String exportName, String targetId) { - if (exportName.indexOf(",") < 0) { - return exportName; - } - String[] arr = exportName.split(","); - for (String str : arr) { - if (str.indexOf(targetId) != -1) { - return str.split("_")[0]; - } - } - return null; - } - - /** - * 获取这个字段的顺序 - * - * @param orderNum - * @param targetId - * @return - */ - public int getCellOrder(String orderNum, String targetId) { - if (isInteger(orderNum) || targetId == null) { - return Integer.valueOf(orderNum); - } - String[] arr = orderNum.split(","); - String[] temp; - for (String str : arr) { - temp = str.split("_"); - if (targetId.equals(temp[1])) { - return Integer.valueOf(temp[0]); - } - } - return 0; - } - - /** - * 判断字符串是否是整数 - */ - public boolean isInteger(String value) { - try { - Integer.parseInt(value); - return true; - } catch (NumberFormatException e) { - return false; - } - } - - /** - * 注解到导出对象的转换 - * - * @param targetId - * @param field - * @param excelEntity - * @param excel - * @param pojoClass - * @throws Exception - */ - private void getExcelField(String targetId, Field field, - ExcelExportEntity excelEntity, Excel excel, Class pojoClass) - throws Exception { - excelEntity.setName(getExcelName(excel.name(), targetId)); - excelEntity.setWidth(excel.width()); - excelEntity.setHeight(excel.height()); - excelEntity.setNeedMerge(excel.needMerge()); - excelEntity.setMergeVertical(excel.mergeVertical()); - excelEntity.setMergeRely(excel.mergeRely()); - excelEntity.setReplace(excel.replace()); - excelEntity.setOrderNum(getCellOrder(excel.orderNum(), targetId)); - excelEntity.setWrap(excel.isWrap()); - excelEntity.setExportImageType(excel.imageType()); - excelEntity.setDatabaseFormat(excel.databaseFormat()); - excelEntity - .setFormat(StringUtils.isNotEmpty(excel.exportFormat()) ? excel - .exportFormat() : excel.format()); - String fieldname = field.getName(); - excelEntity.setMethod(POIPublicUtil.getMethod(fieldname, pojoClass)); - } +public abstract class ExcelExportBase extends ExportBase { /** * 合并单元格 @@ -454,60 +270,6 @@ public abstract class ExcelExportBase { return null; } - /** - * 获取填如这个cell的值,提供一些附加功能 - * - * @param entity - * @param obj - * @return - * @throws Exception - */ - public Object getCellValue(ExcelExportEntity entity, Object obj) - throws Exception { - Object value = entity.getMethods() != null ? getFieldBySomeMethod( - entity.getMethods(), obj) : entity.getMethod().invoke(obj, - new Object[] {}); - if (needHanlderList != null - && needHanlderList.contains(entity.getName())) { - value = dataHanlder.exportHandler(obj, entity.getName(), value); - } else if (StringUtils.isNotEmpty(entity.getFormat())) { - value = formatValue(value, entity); - } else if (entity.getReplace() != null - && entity.getReplace().length > 0) { - value = replaceValue(entity.getReplace(), String.valueOf(value)); - } - return value == null ? "" : value.toString(); - } - - private Object replaceValue(String[] replace, String value) { - String[] temp; - for (String str : replace) { - temp = str.split("_"); - if (value.equals(temp[1])) { - value = temp[0]; - break; - } - } - return value; - } - - private Object formatValue(Object value, ExcelExportEntity entity) - throws Exception { - Date temp = null; - if (value instanceof String) { - SimpleDateFormat format = new SimpleDateFormat( - entity.getDatabaseFormat()); - temp = format.parse(value.toString()); - } else if (value instanceof Date) { - temp = (Date) value; - } - if (temp != null) { - SimpleDateFormat format = new SimpleDateFormat(entity.getFormat()); - value = format.format(temp); - } - return value; - } - /** * 创建List之后的各个Cells * @@ -543,54 +305,6 @@ public abstract class ExcelExportBase { } } - public short getRowHeight(List excelParams) { - int maxHeight = 0; - for (int i = 0; i < excelParams.size(); i++) { - maxHeight = maxHeight > excelParams.get(i).getHeight() ? maxHeight - : excelParams.get(i).getHeight(); - if (excelParams.get(i).getList() != null) { - for (int j = 0; j < excelParams.get(i).getList().size(); j++) { - maxHeight = maxHeight > excelParams.get(i).getList().get(j) - .getHeight() ? maxHeight : excelParams.get(i) - .getList().get(j).getHeight(); - } - } - } - return (short) (maxHeight * 50); - } - - /** - * 对字段根据用户设置排序 - */ - public void sortAllParams(List excelParams) { - Collections.sort(excelParams, new ComparatorExcelField()); - for (ExcelExportEntity entity : excelParams) { - if (entity.getList() != null) { - Collections.sort(entity.getList(), new ComparatorExcelField()); - } - } - } - - /** - * 多个反射获取值 - * - * @param list - * @param t - * @return - * @throws Exception - */ - public Object getFieldBySomeMethod(List list, Object t) - throws Exception { - for (Method m : list) { - if (t == null) { - t = ""; - break; - } - t = m.invoke(t, new Object[] {}); - } - return t; - } - public void setCellWith(List excelParams, Sheet sheet) { int index = 0; for (int i = 0; i < excelParams.size(); i++) { diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/base/ExportBase.java b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/base/ExportBase.java new file mode 100644 index 0000000..ba40aac --- /dev/null +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/base/ExportBase.java @@ -0,0 +1,314 @@ +package org.jeecgframework.poi.excel.export.base; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.lang.reflect.ParameterizedType; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecgframework.poi.excel.annotation.ExcelCollection; +import org.jeecgframework.poi.excel.annotation.ExcelEntity; +import org.jeecgframework.poi.excel.entity.params.ComparatorExcelField; +import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity; +import org.jeecgframework.poi.handler.inter.IExcelDataHandler; +import org.jeecgframework.poi.util.POIPublicUtil; + +/** + * 导出基础处理,不设计POI,只设计对象,保证复用性 + * + * @author JueYue + * @date 2014年8月9日 下午11:01:32 + */ +public class ExportBase { + + protected IExcelDataHandler dataHanlder; + + protected List needHanlderList; + + /** + * 获取需要导出的全部字段 + * + * @param exclusions + * @param targetId + * 目标ID + * @param fields + * @throws Exception + */ + public void getAllExcelField(String[] exclusions, String targetId, + Field[] fields, List excelParams, + Class pojoClass, List getMethods) throws Exception { + List exclusionsList = exclusions != null ? Arrays + .asList(exclusions) : null; + ExcelExportEntity excelEntity; + // 遍历整个filed + for (int i = 0; i < fields.length; i++) { + Field field = fields[i]; + // 先判断是不是collection,在判断是不是java自带对象,之后就是我们自己的对象了 + if (POIPublicUtil.isNotUserExcelUserThis(exclusionsList, field, + targetId)) { + continue; + } + if (POIPublicUtil.isCollection(field.getType())) { + ExcelCollection excel = field + .getAnnotation(ExcelCollection.class); + ParameterizedType pt = (ParameterizedType) field + .getGenericType(); + Class clz = (Class) pt.getActualTypeArguments()[0]; + List list = new ArrayList(); + getAllExcelField(exclusions, + StringUtils.isNotEmpty(excel.id()) ? excel.id() + : targetId, POIPublicUtil.getClassFields(clz), + list, clz, null); + excelEntity = new ExcelExportEntity(); + excelEntity.setName(getExcelName(excel.name(), targetId)); + excelEntity + .setOrderNum(getCellOrder(excel.orderNum(), targetId)); + excelEntity.setMethod(POIPublicUtil.getMethod(field.getName(), + pojoClass)); + excelEntity.setList(list); + excelParams.add(excelEntity); + } else if (POIPublicUtil.isJavaClass(field)) { + excelParams.add(createExcelExportEntity(field, targetId, + pojoClass, getMethods)); + } else { + List newMethods = new ArrayList(); + if (getMethods != null) { + newMethods.addAll(getMethods); + } + newMethods.add(POIPublicUtil.getMethod(field.getName(), + pojoClass)); + ExcelEntity excel = field.getAnnotation(ExcelEntity.class); + getAllExcelField(exclusions, + StringUtils.isNotEmpty(excel.id()) ? excel.id() + : targetId, POIPublicUtil.getClassFields(field + .getType()), excelParams, field.getType(), + newMethods); + } + } + } + + /** + * 创建导出实体对象 + * + * @param field + * @param targetId + * @param pojoClass + * @param getMethods + * @return + * @throws Exception + */ + private ExcelExportEntity createExcelExportEntity(Field field, + String targetId, Class pojoClass, List getMethods) + throws Exception { + Excel excel = field.getAnnotation(Excel.class); + ExcelExportEntity excelEntity = new ExcelExportEntity(); + excelEntity.setType(excel.type()); + getExcelField(targetId, field, excelEntity, excel, pojoClass); + if (getMethods != null) { + List newMethods = new ArrayList(); + newMethods.addAll(getMethods); + newMethods.add(excelEntity.getMethod()); + excelEntity.setMethods(newMethods); + } + return excelEntity; + } + + /** + * 判断在这个单元格显示的名称 + * + * @param exportName + * @param targetId + * @return + */ + public String getExcelName(String exportName, String targetId) { + if (exportName.indexOf(",") < 0) { + return exportName; + } + String[] arr = exportName.split(","); + for (String str : arr) { + if (str.indexOf(targetId) != -1) { + return str.split("_")[0]; + } + } + return null; + } + + /** + * 获取这个字段的顺序 + * + * @param orderNum + * @param targetId + * @return + */ + public int getCellOrder(String orderNum, String targetId) { + if (isInteger(orderNum) || targetId == null) { + return Integer.valueOf(orderNum); + } + String[] arr = orderNum.split(","); + String[] temp; + for (String str : arr) { + temp = str.split("_"); + if (targetId.equals(temp[1])) { + return Integer.valueOf(temp[0]); + } + } + return 0; + } + + /** + * 判断字符串是否是整数 + */ + public boolean isInteger(String value) { + try { + Integer.parseInt(value); + return true; + } catch (NumberFormatException e) { + return false; + } + } + + /** + * 注解到导出对象的转换 + * + * @param targetId + * @param field + * @param excelEntity + * @param excel + * @param pojoClass + * @throws Exception + */ + private void getExcelField(String targetId, Field field, + ExcelExportEntity excelEntity, Excel excel, Class pojoClass) + throws Exception { + excelEntity.setName(getExcelName(excel.name(), targetId)); + excelEntity.setWidth(excel.width()); + excelEntity.setHeight(excel.height()); + excelEntity.setNeedMerge(excel.needMerge()); + excelEntity.setMergeVertical(excel.mergeVertical()); + excelEntity.setMergeRely(excel.mergeRely()); + excelEntity.setReplace(excel.replace()); + excelEntity.setOrderNum(getCellOrder(excel.orderNum(), targetId)); + excelEntity.setWrap(excel.isWrap()); + excelEntity.setExportImageType(excel.imageType()); + excelEntity.setDatabaseFormat(excel.databaseFormat()); + excelEntity + .setFormat(StringUtils.isNotEmpty(excel.exportFormat()) ? excel + .exportFormat() : excel.format()); + String fieldname = field.getName(); + excelEntity.setMethod(POIPublicUtil.getMethod(fieldname, pojoClass)); + } + /** + * 根据注解获取行高 + * @param excelParams + * @return + */ + public short getRowHeight(List excelParams) { + int maxHeight = 0; + for (int i = 0; i < excelParams.size(); i++) { + maxHeight = maxHeight > excelParams.get(i).getHeight() ? maxHeight + : excelParams.get(i).getHeight(); + if (excelParams.get(i).getList() != null) { + for (int j = 0; j < excelParams.get(i).getList().size(); j++) { + maxHeight = maxHeight > excelParams.get(i).getList().get(j) + .getHeight() ? maxHeight : excelParams.get(i) + .getList().get(j).getHeight(); + } + } + } + return (short) (maxHeight * 50); + } + + + /** + * 对字段根据用户设置排序 + */ + public void sortAllParams(List excelParams) { + Collections.sort(excelParams, new ComparatorExcelField()); + for (ExcelExportEntity entity : excelParams) { + if (entity.getList() != null) { + Collections.sort(entity.getList(), new ComparatorExcelField()); + } + } + } + + /** + * 获取填如这个cell的值,提供一些附加功能 + * + * @param entity + * @param obj + * @return + * @throws Exception + */ + public Object getCellValue(ExcelExportEntity entity, Object obj) + throws Exception { + Object value = entity.getMethods() != null ? getFieldBySomeMethod( + entity.getMethods(), obj) : entity.getMethod().invoke(obj, + new Object[] {}); + if (needHanlderList != null + && needHanlderList.contains(entity.getName())) { + value = dataHanlder.exportHandler(obj, entity.getName(), value); + } else if (StringUtils.isNotEmpty(entity.getFormat())) { + value = formatValue(value, entity); + } else if (entity.getReplace() != null + && entity.getReplace().length > 0) { + value = replaceValue(entity.getReplace(), String.valueOf(value)); + } + return value == null ? "" : value.toString(); + } + + private Object replaceValue(String[] replace, String value) { + String[] temp; + for (String str : replace) { + temp = str.split("_"); + if (value.equals(temp[1])) { + value = temp[0]; + break; + } + } + return value; + } + + private Object formatValue(Object value, ExcelExportEntity entity) + throws Exception { + Date temp = null; + if (value instanceof String) { + SimpleDateFormat format = new SimpleDateFormat( + entity.getDatabaseFormat()); + temp = format.parse(value.toString()); + } else if (value instanceof Date) { + temp = (Date) value; + } + if (temp != null) { + SimpleDateFormat format = new SimpleDateFormat(entity.getFormat()); + value = format.format(temp); + } + return value; + } + + /** + * 多个反射获取值 + * + * @param list + * @param t + * @return + * @throws Exception + */ + public Object getFieldBySomeMethod(List list, Object t) + throws Exception { + for (Method m : list) { + if (t == null) { + t = ""; + break; + } + t = m.invoke(t, new Object[] {}); + } + return t; + } + +} diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/template/ExcelExportOfTemplateUtil.java b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/template/ExcelExportOfTemplateUtil.java index afa2a1e..dbbd185 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/template/ExcelExportOfTemplateUtil.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/excel/export/template/ExcelExportOfTemplateUtil.java @@ -19,7 +19,7 @@ import org.jeecgframework.poi.cache.ExcelCache; import org.jeecgframework.poi.excel.annotation.ExcelTarget; import org.jeecgframework.poi.excel.entity.TemplateExportParams; import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity; -import org.jeecgframework.poi.excel.export.ExcelExportBase; +import org.jeecgframework.poi.excel.export.base.ExcelExportBase; import org.jeecgframework.poi.exception.excel.ExcelExportException; import org.jeecgframework.poi.exception.excel.enums.ExcelExportEnum; import org.jeecgframework.poi.util.POIPublicUtil; diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/exception/word/WordExportException.java b/easypoi-base/src/main/java/org/jeecgframework/poi/exception/word/WordExportException.java new file mode 100644 index 0000000..30e20e0 --- /dev/null +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/exception/word/WordExportException.java @@ -0,0 +1,27 @@ +package org.jeecgframework.poi.exception.word; + +import org.jeecgframework.poi.exception.word.enmus.WordExportEnum; + +/** + * word导出异常 + * + * @author JueYue + * @date 2014年8月9日 下午10:32:51 + */ +public class WordExportException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + public WordExportException() { + super(); + } + + public WordExportException(String msg) { + super(msg); + } + + public WordExportException(WordExportEnum exception) { + super(exception.getMsg()); + } + +} diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/exception/word/enmus/WordExportEnum.java b/easypoi-base/src/main/java/org/jeecgframework/poi/exception/word/enmus/WordExportEnum.java new file mode 100644 index 0000000..10bcb56 --- /dev/null +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/exception/word/enmus/WordExportEnum.java @@ -0,0 +1,29 @@ +package org.jeecgframework.poi.exception.word.enmus; + +/** + * 导出异常枚举 + * + * @author JueYue + * @date 2014年8月9日 下午10:34:58 + */ +public enum WordExportEnum { + + EXCEL_PARAMS_ERROR("Excel 导出 参数错误"), + EXCEL_HEAD_HAVA_NULL("Excel 表头 有的字段为空"), + EXCEL_NO_HEAD("Excel 没有表头"); + + private String msg; + + WordExportEnum(String msg) { + this.msg = msg; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + +} diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/handler/impl/ExcelDataHandlerDefaultImpl.java b/easypoi-base/src/main/java/org/jeecgframework/poi/handler/impl/ExcelDataHandlerDefaultImpl.java index 1376803..d402c8a 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/handler/impl/ExcelDataHandlerDefaultImpl.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/handler/impl/ExcelDataHandlerDefaultImpl.java @@ -29,6 +29,7 @@ public abstract class ExcelDataHandlerDefaultImpl implements IExcelDataHandler { return needHandlerFields; } + @Override public void setNeedHandlerFields(String[] needHandlerFields) { this.needHandlerFields = needHandlerFields; } diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/handler/inter/IExcelDataHandler.java b/easypoi-base/src/main/java/org/jeecgframework/poi/handler/inter/IExcelDataHandler.java index 2901158..99c1b2a 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/handler/inter/IExcelDataHandler.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/handler/inter/IExcelDataHandler.java @@ -9,13 +9,14 @@ package org.jeecgframework.poi.handler.inter; public interface IExcelDataHandler { /** - * 获取需要处理的字段,导入和导出统一处理了, - * 减少书写的字段 + * 获取需要处理的字段,导入和导出统一处理了, 减少书写的字段 * * @return */ public String[] getNeedHandlerFields(); + public void setNeedHandlerFields(String[] fields); + /** * 导出处理方法 * diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/handler/inter/IExcelVerifyHandler.java b/easypoi-base/src/main/java/org/jeecgframework/poi/handler/inter/IExcelVerifyHandler.java index bd46a6c..1dff186 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/handler/inter/IExcelVerifyHandler.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/handler/inter/IExcelVerifyHandler.java @@ -1,12 +1,22 @@ package org.jeecgframework.poi.handler.inter; import org.jeecgframework.poi.excel.entity.result.ExcelVerifyHanlderResult; + /** * 导入校验接口 + * * @author JueYue * @date 2014年6月23日 下午11:08:21 */ public interface IExcelVerifyHandler { + + /** + * 获取需要处理的字段,导入和导出统一处理了, 减少书写的字段 + * + * @return + */ + public String[] getNeedVerifyFields(); + /** * 导出处理方法 * @@ -21,4 +31,11 @@ public interface IExcelVerifyHandler { public ExcelVerifyHanlderResult verifyHandler(Object obj, String name, Object value); + /** + * 获取需要处理的字段,导入和导出统一处理了, 减少书写的字段 + * + * @return + */ + public void setNeedVerifyFields(String[] arr); + } diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/WordImageEntity.java b/easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/WordImageEntity.java index 6c16e07..073c67a 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/WordImageEntity.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/WordImageEntity.java @@ -1,12 +1,14 @@ package org.jeecgframework.poi.word.entity; + /** * word导出,图片设置和图片信息 + * * @author JueYue * @date 2013-11-17 * @version 1.0 */ public class WordImageEntity { - + public static String URL = "url"; public static String Data = "data"; /** @@ -17,13 +19,30 @@ public class WordImageEntity { * 图片宽度 */ private int width; - //图片高度 + // 图片高度 private int height; - //图片地址 + // 图片地址 private String url; - //图片信息 + // 图片信息 private byte[] data; - + + public WordImageEntity() { + + } + + public WordImageEntity(String url, int width, int height) { + this.url = url; + this.width = width; + this.height = height; + } + + public WordImageEntity(byte[] data, int width, int height) { + this.data = data; + this.width = width; + this.height = height; + this.type = Data; + } + public String getType() { return type; } diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/params/ExcelListEntity.java b/easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/params/ExcelListEntity.java new file mode 100644 index 0000000..18ffa17 --- /dev/null +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/params/ExcelListEntity.java @@ -0,0 +1,69 @@ +package org.jeecgframework.poi.word.entity.params; + +import java.util.List; + +import org.jeecgframework.poi.excel.entity.ExcelBaseParams; +import org.jeecgframework.poi.handler.inter.IExcelDataHandler; + +/** + * Excel 导出对象 + * + * @author JueYue + * @date 2014年8月9日 下午10:21:13 + */ +public class ExcelListEntity extends ExcelBaseParams { + + public ExcelListEntity() { + + } + + public ExcelListEntity(List list, Class clazz) { + this.list = list; + this.clazz = clazz; + } + + public ExcelListEntity(List list, Class clazz, + IExcelDataHandler dataHanlder) { + this.list = list; + this.clazz = clazz; + setDataHanlder(dataHanlder); + } + + /** + * 数据源 + */ + private List list; + /** + * 实体类对象 + */ + private Class clazz; + /** + * 过滤的属性 + */ + private String[] exclusions; + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public Class getClazz() { + return clazz; + } + + public void setClazz(Class clazz) { + this.clazz = clazz; + } + + public String[] getExclusions() { + return exclusions; + } + + public void setExclusions(String[] exclusions) { + this.exclusions = exclusions; + } + +} diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/params/ListParamEntity.java b/easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/params/ListParamEntity.java new file mode 100644 index 0000000..890cbd6 --- /dev/null +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/word/entity/params/ListParamEntity.java @@ -0,0 +1,78 @@ +package org.jeecgframework.poi.word.entity.params; + +/** + * Excel 对象导出结构 + * + * @author JueYue + * @date 2014年7月26日 下午11:14:48 + */ +public class ListParamEntity { + // 唯一值,在遍历中重复使用 + public static final String SINGLE = "single"; + // 属于数组类型 + public static final String LIST = "list"; + /** + * 属性名称 + */ + private String name; + /** + * 目标 + */ + private String target; + /** + * 当是唯一值的时候直接求出值 + */ + private Object value; + /** + * 数据类型,SINGLE || LIST + */ + private String type; + + public ListParamEntity() { + + } + + public ListParamEntity(String name, String target) { + this.name = name; + this.target = target; + this.type = LIST; + } + + public ListParamEntity(String name, Object value) { + this.name = name; + this.value = value; + this.type = LIST; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } +} diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/ParseWord07.java b/easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/ParseWord07.java index 10bb4be..a4c89c0 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/ParseWord07.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/ParseWord07.java @@ -14,6 +14,9 @@ import org.apache.poi.xwpf.usermodel.XWPFTableRow; import org.jeecgframework.poi.cache.WordCache; import org.jeecgframework.poi.word.entity.JeecgXWPFDocument; import org.jeecgframework.poi.word.entity.WordImageEntity; +import org.jeecgframework.poi.word.entity.params.ExcelListEntity; +import org.jeecgframework.poi.word.parse.excel.ExcelEntityParse; +import org.jeecgframework.poi.word.parse.excel.ExcelMapParse; import org.jeecgframework.poi.word.util.ParseWordUtil; /** @@ -23,7 +26,7 @@ import org.jeecgframework.poi.word.util.ParseWordUtil; * @date 2013-11-16 * @version 1.0 */ -@SuppressWarnings({"unchecked","rawtypes"}) +@SuppressWarnings({ "unchecked", "rawtypes" }) public class ParseWord07 { /** @@ -34,28 +37,31 @@ public class ParseWord07 { * @return * @throws Exception */ - public XWPFDocument parseWord(String url, Map map) + public XWPFDocument parseWord(String url, Map map) throws Exception { JeecgXWPFDocument doc = WordCache.getXWPFDocumen(url); parseWordSetValue(doc, map); return doc; } + /** - * 按用户模板导出 - * @param document - * @param map + * 解析07版的Word并且进行赋值 + * + * @Author JueYue + * @date 2013-11-16 + * @return * @throws Exception */ - public void parseWord(XWPFDocument document, Map map) throws Exception { - parseWordSetValue((JeecgXWPFDocument)document, map); + public void parseWord(XWPFDocument document, Map map) + throws Exception { + parseWordSetValue((JeecgXWPFDocument) document, map); } - - private void parseWordSetValue(JeecgXWPFDocument doc, + private void parseWordSetValue(JeecgXWPFDocument doc, Map map) throws Exception { - //第一步解析文档 - parseAllParagraphic(doc.getParagraphs(),map); - //第二步解析所有表格 + // 第一步解析文档 + parseAllParagraphic(doc.getParagraphs(), map); + // 第二步解析所有表格 XWPFTable table; Iterator itTable = doc.getTablesIterator(); while (itTable.hasNext()) { @@ -64,18 +70,19 @@ public class ParseWord07 { parseThisTable(table, map); } } - + } /** * 解析所有的文本 - *@Author JueYue - *@date 2013-11-17 - *@param paragraphs - *@param map + * + * @Author JueYue + * @date 2013-11-17 + * @param paragraphs + * @param map */ - private void parseAllParagraphic(List paragraphs, - Map map) throws Exception { + private void parseAllParagraphic(List paragraphs, + Map map) throws Exception { XWPFParagraph paragraph; for (int i = 0; i < paragraphs.size(); i++) { paragraph = paragraphs.get(i); @@ -84,7 +91,7 @@ public class ParseWord07 { } } - + } /** @@ -95,92 +102,59 @@ public class ParseWord07 { * @param table * @param map */ - private void parseThisTable(XWPFTable table, Map map) throws Exception { + private void parseThisTable(XWPFTable table, Map map) + throws Exception { XWPFTableRow row; List cells; Object listobj; - for (int i = 0; i < table.getNumberOfRows(); i++) { - row = table.getRow(i); - cells = row.getTableCells(); - if(cells.size() == 1){ - listobj = checkThisTableIsNeedIterator(cells.get(0),map); - if(listobj==null){ - parseThisRow(cells,map); - }else{ - table.removeRow(i);//删除这一行 - parseNextRowAndAddRow(table,i,(List) listobj); - } - }else{ - parseThisRow(cells,map); - } - } - } - - - /** - * 解析下一行,并且生成更多的行 - *@Author JueYue - *@date 2013-11-18 - *@param table - *@param listobj2 - */ - private void parseNextRowAndAddRow(XWPFTable table,int index, List list) throws Exception { - XWPFTableRow currentRow = table.getRow(index); - String[] params = parseCurrentRowGetParams(currentRow); - table.removeRow(index);//移除这一行 - int cellIndex = 0;//创建完成对象一行好像多了一个cell - for(Object obj :list){ - currentRow = table.createRow(); - for(cellIndex = 0;cellIndex cells = currentRow.getTableCells(); - String[] params = new String[cells.size()]; - String text; - for (int i=0;i cells, - Map map) throws Exception { + private void parseThisRow(List cells, Map map) + throws Exception { for (XWPFTableCell cell : cells) { - parseAllParagraphic(cell.getParagraphs(),map); - } + parseAllParagraphic(cell.getParagraphs(), map); + } } /** - *判断是不是迭代输出 - *@Author JueYue - *@date 2013-11-18 - *@return - * @throws Exception + * 判断是不是迭代输出 + * + * @Author JueYue + * @date 2013-11-18 + * @return + * @throws Exception */ - private Object checkThisTableIsNeedIterator(XWPFTableCell cell - , Map map) throws Exception { + private Object checkThisTableIsNeedIterator(XWPFTableCell cell, + Map map) throws Exception { String text = cell.getText().trim(); - //判断是不是迭代输出 - if(text.startsWith("{{")&&text.endsWith("}}")&&text.indexOf("in ")!=-1){ - return ParseWordUtil.getRealValue(text.replace("in ", "").trim(),map); + // 判断是不是迭代输出 + if (text.startsWith("{{") && text.endsWith("}}") + && text.indexOf("in ") != -1) { + /*text = text.replace("{{", "").replace("}}", "") + .replaceAll("\\s{1,}", " ").trim();*/ + return ParseWordUtil.getRealValue(text.replace("in ", "").trim(), + map); } return null; } @@ -193,8 +167,8 @@ public class ParseWord07 { * @param paragraph * @param map */ - private void parseThisParagraph(XWPFParagraph paragraph, - Map map) throws Exception { + private void parseThisParagraph(XWPFParagraph paragraph, + Map map) throws Exception { XWPFRun run; XWPFRun currentRun = null;// 拿到的第一个run,用来set值,可以保存格式 String currentText = "";// 存放当前的text @@ -225,7 +199,7 @@ public class ParseWord07 { currentText = text; isfinde = true; currentRun = run; - }else{ + } else { currentText = ""; } if (currentText.indexOf("}}") != -1) { @@ -243,16 +217,16 @@ public class ParseWord07 { * @Author JueYue * @date 2013-11-16 */ - private void changeValues(XWPFParagraph paragraph, - XWPFRun currentRun, String currentText, List runIndex, - Map map) throws Exception { + private void changeValues(XWPFParagraph paragraph, XWPFRun currentRun, + String currentText, List runIndex, Map map) + throws Exception { Object obj = ParseWordUtil.getRealValue(currentText, map); - if(obj instanceof WordImageEntity){//如果是图片就设置为图片 + if (obj instanceof WordImageEntity) {// 如果是图片就设置为图片 currentRun.setText("", 0); - addAnImage((WordImageEntity)obj,currentRun); - }else{ + addAnImage((WordImageEntity) obj, currentRun); + } else { currentText = obj.toString(); - currentRun.setText(currentText,0); + currentRun.setText(currentText, 0); } for (int k = 0; k < runIndex.size(); k++) { paragraph.getRuns().get(runIndex.get(k)).setText("", 0); @@ -262,28 +236,38 @@ public class ParseWord07 { /** * 添加图片 - *@Author JueYue - *@date 2013-11-20 - *@param obj - *@param currentRun - * @throws Exception + * + * @Author JueYue + * @date 2013-11-20 + * @param obj + * @param currentRun + * @throws Exception */ - private void addAnImage(WordImageEntity obj, XWPFRun currentRun) throws Exception { - Object [] isAndType = ParseWordUtil.getIsAndType(obj); + private void addAnImage(WordImageEntity obj, XWPFRun currentRun) + throws Exception { + Object[] isAndType = ParseWordUtil.getIsAndType(obj); String picId; try { - picId = currentRun.getParagraph().getDocument().addPictureData( - (byte[]) isAndType[0], - (Integer) isAndType[1]); - ((JeecgXWPFDocument) currentRun.getParagraph().getDocument()).createPicture( - currentRun,picId, - currentRun.getParagraph().getDocument().getNextPicNameNumber((Integer) isAndType[1]), - obj.getWidth(),obj.getHeight()); - + picId = currentRun + .getParagraph() + .getDocument() + .addPictureData((byte[]) isAndType[0], + (Integer) isAndType[1]); + ((JeecgXWPFDocument) currentRun.getParagraph().getDocument()) + .createPicture( + currentRun, + picId, + currentRun + .getParagraph() + .getDocument() + .getNextPicNameNumber( + (Integer) isAndType[1]), + obj.getWidth(), obj.getHeight()); + } catch (Exception e) { e.printStackTrace(); - } - + } + } } diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/excel/ExcelEntityParse.java b/easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/excel/ExcelEntityParse.java new file mode 100644 index 0000000..75e42b2 --- /dev/null +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/excel/ExcelEntityParse.java @@ -0,0 +1,208 @@ +package org.jeecgframework.poi.word.parse.excel; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.StringUtils; +import org.apache.poi.xwpf.usermodel.XWPFTable; +import org.apache.poi.xwpf.usermodel.XWPFTableCell; +import org.apache.poi.xwpf.usermodel.XWPFTableRow; +import org.jeecgframework.poi.excel.annotation.ExcelTarget; +import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity; +import org.jeecgframework.poi.excel.export.base.ExportBase; +import org.jeecgframework.poi.exception.word.WordExportException; +import org.jeecgframework.poi.exception.word.enmus.WordExportEnum; +import org.jeecgframework.poi.util.POIPublicUtil; +import org.jeecgframework.poi.word.entity.params.ExcelListEntity; + +/** + * 解析实体类对象 复用注解 + * + * @author JueYue + * @date 2014年8月9日 下午10:30:57 + */ +public class ExcelEntityParse extends ExportBase { + + /** + * 解析上一行并生成更多行 + * + * @param table + * @param i + * @param listobj + */ + public void parseNextRowAndAddRow(XWPFTable table, int index, + ExcelListEntity entity) { + checkExcelParams(entity); + // 获取表头数据 + Map titlemap = getTitleMap(table, index); + try { + // 得到所有字段 + Field fileds[] = POIPublicUtil.getClassFields(entity.getClazz()); + ExcelTarget etarget = entity.getClazz().getAnnotation( + ExcelTarget.class); + String targetId = null; + if (etarget != null) { + targetId = etarget.value(); + } + // 获取实体对象的导出数据 + List excelParams = new ArrayList(); + getAllExcelField(null, targetId, fileds, excelParams, + entity.getClazz(), null); + // 根据表头进行筛选排序 + sortAndFilterExportField(excelParams, titlemap); + short rowHeight = getRowHeight(excelParams); + Iterator its = entity.getList().iterator(); + while (its.hasNext()) { + Object t = its.next(); + index += createCells(index, t, excelParams, table, rowHeight); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + private int createCells(int index, Object t, + List excelParams, XWPFTable table, + short rowHeight) throws Exception { + ExcelExportEntity entity; + XWPFTableRow row = table.createRow(); + row.setHeight(rowHeight); + int maxHeight = 1, cellNum = 0; + for (int k = 0, paramSize = excelParams.size(); k < paramSize; k++) { + entity = excelParams.get(k); + if (entity.getList() != null) { + Collection list = (Collection) entity.getMethod().invoke( + t, new Object[] {}); + int listC = 0; + for (Object obj : list) { + createListCells(index + listC, cellNum, obj, + entity.getList(), table); + listC++; + } + cellNum += entity.getList().size(); + if (list != null && list.size() > maxHeight) { + maxHeight = list.size(); + } + } else { + Object value = getCellValue(entity, t); + if (entity.getType() == 1) { + setCellValue(row, value, cellNum++); + } + } + } + // 合并需要合并的单元格 + cellNum = 0; + for (int k = 0, paramSize = excelParams.size(); k < paramSize; k++) { + entity = excelParams.get(k); + if (entity.getList() != null) { + cellNum += entity.getList().size(); + } else if (entity.isNeedMerge()) { + table.setCellMargins(index, index + maxHeight - 1, cellNum, + cellNum); + cellNum++; + } + } + return maxHeight; + } + + /** + * 创建List之后的各个Cells + * + * @param styles + */ + public void createListCells(int index, int cellNum, Object obj, + List excelParams, XWPFTable table) + throws Exception { + ExcelExportEntity entity; + XWPFTableRow row; + if (table.getRow(index) == null) { + row = table.createRow(); + row.setHeight(getRowHeight(excelParams)); + } else { + row = table.getRow(index); + } + for (int k = 0, paramSize = excelParams.size(); k < paramSize; k++) { + entity = excelParams.get(k); + Object value = getCellValue(entity, obj); + if (entity.getType() == 1) { + setCellValue(row, value, cellNum++); + } + } + } + + private void setCellValue(XWPFTableRow row, Object value, int cellNum) { + if (row.getCell(cellNum++) != null) { + row.getCell(cellNum - 1).setText( + value == null ? "" : value.toString()); + } else { + row.createCell().setText(value == null ? "" : value.toString()); + } + } + + /** + * 对导出序列进行排序和塞选 + * + * @param excelParams + * @param titlemap + * @return + */ + private void sortAndFilterExportField(List excelParams, + Map titlemap) { + for (int i = excelParams.size() - 1; i >= 0; i--) { + if (excelParams.get(i).getList() != null + && excelParams.get(i).getList().size() > 0) { + sortAndFilterExportField(excelParams.get(i).getList(), titlemap); + if (excelParams.get(i).getList().size() == 0) { + excelParams.remove(i); + } else { + excelParams.get(i).setOrderNum(i); + } + } else { + if (titlemap.containsKey(excelParams.get(i).getName())) { + excelParams.get(i).setOrderNum(i); + } else { + excelParams.remove(i); + } + } + } + sortAllParams(excelParams); + } + + /** + * 获取表头数据 + * + * @param table + * @param index + * @return + */ + private Map getTitleMap(XWPFTable table, int index) { + if (index == 0) { + throw new WordExportException(WordExportEnum.EXCEL_NO_HEAD); + } + List cells = table.getRow(index - 1).getTableCells(); + Map map = new HashMap(cells.size()); + String text; + for (int i = 0; i < cells.size(); i++) { + text = cells.get(i).getText(); + if (StringUtils.isEmpty(text)) { + throw new WordExportException( + WordExportEnum.EXCEL_HEAD_HAVA_NULL); + } + map.put(text, i); + } + return map; + } + + private static void checkExcelParams(ExcelListEntity entity) { + if (entity.getList() == null || entity.getClazz() == null) { + throw new WordExportException(WordExportEnum.EXCEL_PARAMS_ERROR); + } + + } + +} diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/excel/ExcelMapParse.java b/easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/excel/ExcelMapParse.java new file mode 100644 index 0000000..961fd9c --- /dev/null +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/word/parse/excel/ExcelMapParse.java @@ -0,0 +1,71 @@ +package org.jeecgframework.poi.word.parse.excel; + +import java.util.List; + +import org.apache.poi.xwpf.usermodel.XWPFTable; +import org.apache.poi.xwpf.usermodel.XWPFTableCell; +import org.apache.poi.xwpf.usermodel.XWPFTableRow; +import org.jeecgframework.poi.word.util.ParseWordUtil; + +/** + * 处理和生成Map 类型的数据变成表格 + * @author JueYue + * @date 2014年8月9日 下午10:28:46 + */ +public final class ExcelMapParse { + + /** + * 解析下一行,并且生成更多的行 + * + * @Author JueYue + * @date 2013-11-18 + * @param table + * @param listobj2 + */ + public static void parseNextRowAndAddRow(XWPFTable table, int index, + List list) throws Exception { + XWPFTableRow currentRow = table.getRow(index); + String[] params = parseCurrentRowGetParams(currentRow); + table.removeRow(index);// 移除这一行 + int cellIndex = 0;// 创建完成对象一行好像多了一个cell + for (Object obj : list) { + currentRow = table.createRow(); + for (cellIndex = 0; cellIndex < currentRow.getTableCells().size(); cellIndex++) { + currentRow + .getTableCells() + .get(cellIndex) + .setText( + ParseWordUtil.getValueDoWhile(obj, + params[cellIndex].split("\\."), 0) + .toString()); + } + for (; cellIndex < params.length; cellIndex++) { + currentRow.createCell().setText( + ParseWordUtil.getValueDoWhile(obj, + params[cellIndex].split("\\."), 0).toString()); + } + } + + } + + /** + * 解析参数行,获取参数列表 + * + * @Author JueYue + * @date 2013-11-18 + * @param currentRow + * @return + */ + private static String[] parseCurrentRowGetParams(XWPFTableRow currentRow) { + List cells = currentRow.getTableCells(); + String[] params = new String[cells.size()]; + String text; + for (int i = 0; i < cells.size(); i++) { + text = cells.get(i).getText(); + params[i] = text == null ? "" : text.trim().replace("{{", "") + .replace("}}", ""); + } + return params; + } + +} diff --git a/easypoi-base/src/main/java/org/jeecgframework/poi/word/util/ParseWordUtil.java b/easypoi-base/src/main/java/org/jeecgframework/poi/word/util/ParseWordUtil.java index 48e9549..089bfd1 100644 --- a/easypoi-base/src/main/java/org/jeecgframework/poi/word/util/ParseWordUtil.java +++ b/easypoi-base/src/main/java/org/jeecgframework/poi/word/util/ParseWordUtil.java @@ -12,10 +12,12 @@ import javax.imageio.ImageIO; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.jeecgframework.poi.util.POIPublicUtil; import org.jeecgframework.poi.word.entity.WordImageEntity; +import org.jeecgframework.poi.word.entity.params.ExcelListEntity; /** * 解析公告类 + * Excel 实体注解,暂时不支持图片 * @author JueYue * @date 2014-7-24 * @version 1.1 @@ -37,7 +39,7 @@ public class ParseWordUtil { currentText.indexOf("}}")); Object obj = getParamsValue(params.trim(),map); //判断图片或者是集合 - if(obj instanceof WordImageEntity||obj instanceof List){ + if(obj instanceof WordImageEntity||obj instanceof List ||obj instanceof ExcelListEntity){ return obj; }else{ currentText = currentText.replace("{{" + params + "}}", diff --git a/easypoi-test/.classpath b/easypoi-test/.classpath index 13ed0c0..f67a1d3 100644 --- a/easypoi-test/.classpath +++ b/easypoi-test/.classpath @@ -21,5 +21,11 @@ + + + + + + diff --git a/easypoi-test/pom.xml b/easypoi-test/pom.xml index 5b81709..77aa8d9 100644 --- a/easypoi-test/pom.xml +++ b/easypoi-test/pom.xml @@ -4,7 +4,7 @@ org.jeecgframework easypoi - 2.0.1 + 2.0.2 easypoi-test diff --git a/easypoi-test/src/main/java/org/jeecgframework/poi/UtilTest.java b/easypoi-test/src/main/java/org/jeecgframework/poi/UtilTest.java new file mode 100644 index 0000000..f6e1a7b --- /dev/null +++ b/easypoi-test/src/main/java/org/jeecgframework/poi/UtilTest.java @@ -0,0 +1,13 @@ +package org.jeecgframework.poi; + +public class UtilTest { + + + public static void main(String[] args) { + String text = " {{ p in pList}}"; + text = text.replace("{{", "").replace("}}", "").replaceAll("\\s{1,}", " ").trim(); + System.out.println(text); + System.out.println(text.length()); + } + +} diff --git a/easypoi-test/src/main/java/org/jeecgframework/poi/word/WordExportUtilAnnExcelTest.java b/easypoi-test/src/main/java/org/jeecgframework/poi/word/WordExportUtilAnnExcelTest.java new file mode 100644 index 0000000..17bc646 --- /dev/null +++ b/easypoi-test/src/main/java/org/jeecgframework/poi/word/WordExportUtilAnnExcelTest.java @@ -0,0 +1,119 @@ +package org.jeecgframework.poi.word; + +import static org.junit.Assert.*; + +import java.io.FileOutputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.poi.xwpf.usermodel.XWPFDocument; +import org.jeecgframework.poi.entity.CourseEntity; +import org.jeecgframework.poi.entity.StudentEntity; +import org.jeecgframework.poi.entity.TeacherEntity; +import org.jeecgframework.poi.word.entity.Person; +import org.jeecgframework.poi.word.entity.WordImageEntity; +import org.jeecgframework.poi.word.entity.params.ExcelListEntity; +import org.junit.Before; +import org.junit.Test; + +/** + * 注解导出测试 + * + * @author JueYue + * @date 2014年8月9日 下午11:36:33 + */ +public class WordExportUtilAnnExcelTest { + + private static SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd"); + + List list = new ArrayList(); + CourseEntity courseEntity; + + @Before + public void testBefore() { + courseEntity = new CourseEntity(); + courseEntity.setId("1131"); + courseEntity.setName("小白"); + + TeacherEntity teacherEntity = new TeacherEntity(); + teacherEntity.setId("12131231"); + teacherEntity.setName("你们"); + courseEntity.setTeacher(teacherEntity); + + teacherEntity = new TeacherEntity(); + teacherEntity.setId("121312314312421131"); + teacherEntity.setName("老王"); + courseEntity.setShuxueteacher(teacherEntity); + + StudentEntity studentEntity = new StudentEntity(); + studentEntity.setId("11231"); + studentEntity.setName("撒旦法司法局"); + studentEntity.setBirthday(new Date()); + studentEntity.setSex(1); + List studentList = new ArrayList(); + studentList.add(studentEntity); + studentList.add(studentEntity); + courseEntity.setStudents(studentList); + + for (int i = 0; i < 3; i++) { + list.add(courseEntity); + } + } + + /** + * 简单导出没有图片和Excel + */ + //@Test + public void SimpleWordExport() { + Map map = new HashMap(); + map.put("department", "Jeecg"); + map.put("person", "JueYue"); + map.put("auditPerson", "JueYue"); + map.put("time", format.format(new Date())); + List list = new ArrayList(); + Person p = new Person(); + p.setName("小明"); + p.setTel("18711111111"); + p.setEmail("18711111111@139.com"); + list.add(p); + p = new Person(); + p.setName("小红"); + p.setTel("18711111112"); + p.setEmail("18711111112@139.com"); + list.add(p); + map.put("pList", new ExcelListEntity(list, Person.class)); + try { + XWPFDocument doc = WordExportUtil.exportWord07( + "org/jeecgframework/poi/word/doc/SimpleExcel.docx", map); + FileOutputStream fos = new FileOutputStream("d:/simpleExcel.docx"); + doc.write(fos); + fos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Test + public void WordExport() { + Map map = new HashMap(); + map.put("department", "Jeecg"); + map.put("person", "JueYue"); + map.put("auditPerson", "JueYue"); + map.put("time", format.format(new Date())); + map.put("cs", new ExcelListEntity(list, CourseEntity.class)); + try { + XWPFDocument doc = WordExportUtil.exportWord07( + "org/jeecgframework/poi/word/doc/Excel.docx", map); + FileOutputStream fos = new FileOutputStream("d:/Excel.docx"); + doc.write(fos); + fos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} diff --git a/easypoi-test/src/main/java/org/jeecgframework/poi/word/WordExportUtilBaseExcelTest.java b/easypoi-test/src/main/java/org/jeecgframework/poi/word/WordExportUtilBaseExcelTest.java new file mode 100644 index 0000000..1d070fb --- /dev/null +++ b/easypoi-test/src/main/java/org/jeecgframework/poi/word/WordExportUtilBaseExcelTest.java @@ -0,0 +1,79 @@ +package org.jeecgframework.poi.word; + +import static org.junit.Assert.*; + +import java.io.FileOutputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.poi.xwpf.usermodel.XWPFDocument; +import org.jeecgframework.poi.word.entity.Person; +import org.jeecgframework.poi.word.entity.WordImageEntity; +import org.junit.Test; + +public class WordExportUtilBaseExcelTest { + + private static SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd"); + /** + * 简单导出没有图片和Excel + */ + @Test + public void SimpleWordExport() { + Map map = new HashMap(); + map.put("department", "Jeecg"); + map.put("person", "JueYue"); + map.put("auditPerson", "JueYue"); + map.put("time", format.format(new Date())); + List list = new ArrayList(); + Person p = new Person(); + p.setName("小明"); + p.setTel("18711111111"); + p.setEmail("18711111111@139.com"); + list.add(p); + p = new Person(); + p.setName("小红"); + p.setTel("18711111112"); + p.setEmail("18711111112@139.com"); + list.add(p); + map.put("pList", list); + try { + XWPFDocument doc = WordExportUtil.exportWord07( + "org/jeecgframework/poi/word/doc/SimpleExcel.docx", map); + FileOutputStream fos = new FileOutputStream("d:/simpleExcel.docx"); + doc.write(fos); + fos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + /** + * 简单导出包含图片 + */ + //@Test + public void imageWordExport() { + Map map = new HashMap(); + map.put("department", "Jeecg"); + map.put("person", "JueYue"); + map.put("time", format.format(new Date())); + WordImageEntity image = new WordImageEntity(); + image.setHeight(200); + image.setWidth(500); + image.setUrl("org/jeecgframework/poi/word/img/testCode.png"); + image.setType(WordImageEntity.URL); + map.put("testCode", image); + try { + XWPFDocument doc = WordExportUtil.exportWord07( + "org/jeecgframework/poi/word/doc/Image.docx", map); + FileOutputStream fos = new FileOutputStream("d:/image.docx"); + doc.write(fos); + fos.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} diff --git a/easypoi-test/src/main/java/org/jeecgframework/poi/word/doc/Excel.docx b/easypoi-test/src/main/java/org/jeecgframework/poi/word/doc/Excel.docx new file mode 100644 index 0000000000000000000000000000000000000000..869bbf6e13b5349f18db3bc710b3da3e74390951 GIT binary patch literal 14845 zcmeHuby!?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{~9OzBy+aHC%#$t+xIbl3)$A7`UKjd!ew|GHk2INxtXh*9Q)LSliXI6Z|E2tUvtP? ziaiRixDFEw$hcq#%|DXccA-}lsMmG~X$L`O+YQJr4g^m6!uztGLgB^TUtK+&>GOj^ z6+OSR>I)+*^j%Hq{6Z=Qji2uv-1XuUugJ_d5Ng}r0j0Ph?k13kG2m_SMxJN#43U>) z+wH-ZM_CFkf|wW9sWCoAn=6Sd5!^E@>`@ybv=eYvm@9dvA8Zyp5<)_Vg)iiMevz0znr9Cu)>rDk$GuJu4QNG2S$@XSy&mhN=CItG51-DNkbnR+itze1y%&UbaQ z$#ZHLSKV_5Y2U!uk*WC`-{;mB;;@pt1N2c@D zX01YHS?P2c`f{Hy5qnUbsXU4`{z@%;UK4NC?I8ZdGt?{MGdxAXXCk}w*>=vXeNM*U zgr5s0>R5ShZmE++qFK3L}Mg^50YOiB^o93mu z#HscQb85v?Jp!NL_yQWi?L&Jku zz3#RjNqqzd14;tV$Jf{V3`m1|&?_ft4M{*hk{ax4F&;!CVw?CG=!!=TzW(dsm_p`tL7;t!Pxv)^8H|cHT zVwiPzmN*$*4DQ2t*x{7ebMAM~3cM%(QX(Lr^gx0C=Qp|jxO0D;|KYtZ1?j&7{QU)! zKL~$2mjQzje|g>HSHiz%-v5ZMfx@G`cEtj=zqw<{+0aKRJ%XPjex56 z_Y3(o@$OfMUz08VgvbXb@BJ%a@R#T6ujGFZ)BQ;d0F(gJ|Nacu{A)G;9<=)v>+ivy zzhYJ4{}t=+p`Tw-evNtjiE~2m$AtbT0`e>I->ry0NdbUGS^(fbY>HpW|GusJD|s-( zuQT|4llLpYuUn%(Ap#lyeer+WDE&(Rt7`m{zK{9e^uH*|UlIPUA^xNX?p0a-vI76s Y7YfqgK#m6h5P+XVpwN6{|E>1_0J+wd5dZ)H literal 0 HcmV?d00001 diff --git a/easypoi-test/src/main/java/org/jeecgframework/poi/word/entity/Person.java b/easypoi-test/src/main/java/org/jeecgframework/poi/word/entity/Person.java new file mode 100644 index 0000000..bec1850 --- /dev/null +++ b/easypoi-test/src/main/java/org/jeecgframework/poi/word/entity/Person.java @@ -0,0 +1,43 @@ +package org.jeecgframework.poi.word.entity; + +import org.jeecgframework.poi.excel.annotation.Excel; + +/** + * 测试人员类 + * @author JueYue + * @date 2014年7月26日 下午10:51:30 + */ +public class Person { + + @Excel(name = "姓名") + private String name; + @Excel(name = "手机") + private String tel; + @Excel(name = "Email") + private String email; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTel() { + return tel; + } + + public void setTel(String tel) { + this.tel = tel; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + +} diff --git a/easypoi-web/pom.xml b/easypoi-web/pom.xml index 09ec6d2..2e1cea2 100644 --- a/easypoi-web/pom.xml +++ b/easypoi-web/pom.xml @@ -4,7 +4,7 @@ org.jeecgframework easypoi - 2.0.1 + 2.0.2 easypoi-web diff --git a/pom.xml b/pom.xml index c690dda..6146c2f 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.jeecgframework easypoi - 2.0.1 + 2.0.2 pom easypoi @@ -122,7 +122,7 @@ org.jeecgframework easypoi-base - 2.0.1 + 2.0.2