@@ -71,6 +71,7 @@ public class ExcelExportServer extends ExcelExportBase { | |||||
*/ | */ | ||||
public int createHeaderRow(ExportParams entity, Sheet sheet, Workbook workbook, | public int createHeaderRow(ExportParams entity, Sheet sheet, Workbook workbook, | ||||
int feildWidth) { | int feildWidth) { | ||||
Row row = sheet.createRow(0); | Row row = sheet.createRow(0); | ||||
row.setHeight(entity.getTitleHeight()); | row.setHeight(entity.getTitleHeight()); | ||||
createStringCell(row, 0, entity.getTitle(), | createStringCell(row, 0, entity.getTitle(), | ||||
@@ -191,7 +191,7 @@ public abstract class ExcelExportBase extends ExportBase { | |||||
} | } | ||||
private int createIndexCell(Row row, int index, ExcelExportEntity excelExportEntity) { | private int createIndexCell(Row row, int index, ExcelExportEntity excelExportEntity) { | ||||
if (excelExportEntity.getName().equals("序号") && excelExportEntity.getFormat() != null | |||||
if (excelExportEntity.getName()!=null&&excelExportEntity.getName().equals("序号") && excelExportEntity.getFormat() != null | |||||
&& excelExportEntity.getFormat().equals(PoiBaseConstants.IS_ADD_INDEX)) { | && excelExportEntity.getFormat().equals(PoiBaseConstants.IS_ADD_INDEX)) { | ||||
createStringCell(row, 0, currentIndex + "", | createStringCell(row, 0, currentIndex + "", | ||||
index % 2 == 0 ? getStyles(false, null) : getStyles(true, null), null); | index % 2 == 0 ? getStyles(false, null) : getStyles(true, null), null); | ||||
@@ -359,6 +359,7 @@ public abstract class ExcelExportBase extends ExportBase { | |||||
} else if (type.equalsIgnoreCase("PNG")) { | } else if (type.equalsIgnoreCase("PNG")) { | ||||
return Workbook.PICTURE_TYPE_PNG; | return Workbook.PICTURE_TYPE_PNG; | ||||
} | } | ||||
return Workbook.PICTURE_TYPE_JPEG; | return Workbook.PICTURE_TYPE_JPEG; | ||||
} | } | ||||
@@ -120,7 +120,12 @@ public class ExportBase { | |||||
} | } | ||||
// 首先判断Excel 可能一下特殊数据用户回自定义处理 | // 首先判断Excel 可能一下特殊数据用户回自定义处理 | ||||
if (field.getAnnotation(Excel.class) != null) { | if (field.getAnnotation(Excel.class) != null) { | ||||
excelParams.add(createExcelExportEntity(field, targetId, pojoClass, getMethods)); | |||||
Excel excel = field.getAnnotation(Excel.class); | |||||
String name=PoiPublicUtil.getValueByTargetId(excel.name(), targetId, null); | |||||
if(StringUtils.isNotBlank(name)){ | |||||
excelParams.add(createExcelExportEntity(field, targetId, pojoClass, getMethods)); | |||||
} | |||||
} else if (PoiPublicUtil.isCollection(field.getType())) { | } else if (PoiPublicUtil.isCollection(field.getType())) { | ||||
ExcelCollection excel = field.getAnnotation(ExcelCollection.class); | ExcelCollection excel = field.getAnnotation(ExcelCollection.class); | ||||
ParameterizedType pt = (ParameterizedType) field.getGenericType(); | ParameterizedType pt = (ParameterizedType) field.getGenericType(); | ||||