Java Code Examples for org.jeecgframework.poi.excel.entity.params.ExcelExportEntity#getList()

The following examples show how to use org.jeecgframework.poi.excel.entity.params.ExcelExportEntity#getList() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExcelExportBase.java    From autopoi with Apache License 2.0 6 votes vote down vote up
private Map<Integer, int[]> getMergeDataMap(List<ExcelExportEntity> excelParams) {
	Map<Integer, int[]> mergeMap = new HashMap<Integer, int[]>();
	// 设置参数顺序,为之后合并单元格做准备
	int i = 0;
	for (ExcelExportEntity entity : excelParams) {
		if (entity.isMergeVertical()) {
			mergeMap.put(i, entity.getMergeRely());
		}
		if (entity.getList() != null) {
			for (ExcelExportEntity inner : entity.getList()) {
				if (inner.isMergeVertical()) {
					mergeMap.put(i, inner.getMergeRely());
				}
				i++;
			}
		} else {
			i++;
		}
	}
	return mergeMap;
}
 
Example 2
Source File: ExcelExportBase.java    From easypoi with Apache License 2.0 6 votes vote down vote up
private Map<Integer, int[]> getMergeDataMap(List<ExcelExportEntity> excelParams) {
    Map<Integer, int[]> mergeMap = new HashMap<Integer, int[]>();
    // 设置参数顺序,为之后合并单元格做准备
    int i = 0;
    for (ExcelExportEntity entity : excelParams) {
        if (entity.isMergeVertical()) {
            mergeMap.put(i, entity.getMergeRely());
        }
        if (entity.getList() != null) {
            for (ExcelExportEntity inner : entity.getList()) {
                if (inner.isMergeVertical()) {
                    mergeMap.put(i, inner.getMergeRely());
                }
                i++;
            }
        } else {
            i++;
        }
    }
    return mergeMap;
}
 
Example 3
Source File: ExcelExportOfTemplateUtil.java    From easypoi with Apache License 2.0 6 votes vote down vote up
/**
 * 获取单个对象的高度,主要是处理一堆多的情况
 * 
 * @param styles
 * @param rowHeight
 * @throws Exception
 */
public int getOneObjectSize(Object t, List<ExcelExportEntity> excelParams) throws Exception {
    ExcelExportEntity entity;
    int maxHeight = 1;
    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[] {});
            if (list != null && list.size() > maxHeight) {
                maxHeight = list.size();
            }
        }
    }
    return maxHeight;

}
 
Example 4
Source File: ExcelExportOfTemplateUtil.java    From jeasypoi with Apache License 2.0 6 votes vote down vote up
/**
 * 获取单个对象的高度,主要是处理一堆多的情况
 * 
 * @param styles
 * @param rowHeight
 * @throws Exception
 */
public int getOneObjectSize(Object t, List<ExcelExportEntity> excelParams) throws Exception {
	ExcelExportEntity entity;
	int maxHeight = 1;
	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[] {});
			if (list != null && list.size() > maxHeight) {
				maxHeight = list.size();
			}
		}
	}
	return maxHeight;

}
 
Example 5
Source File: ExcelExportOfTemplateUtil.java    From autopoi with Apache License 2.0 6 votes vote down vote up
/**
 * 获取单个对象的高度,主要是处理一堆多的情况
 * 
 * @param styles
 * @param rowHeight
 * @throws Exception
 */
public int getOneObjectSize(Object t, List<ExcelExportEntity> excelParams) throws Exception {
	ExcelExportEntity entity;
	int maxHeight = 1;
	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[] {});
			if (list != null && list.size() > maxHeight) {
				maxHeight = list.size();
			}
		}
	}
	return maxHeight;

}
 
Example 6
Source File: ExcelExportBase.java    From jeasypoi with Apache License 2.0 6 votes vote down vote up
private Map<Integer, int[]> getMergeDataMap(List<ExcelExportEntity> excelParams) {
	Map<Integer, int[]> mergeMap = new HashMap<Integer, int[]>();
	// 设置参数顺序,为之后合并单元格做准备
	int i = 0;
	for (ExcelExportEntity entity : excelParams) {
		if (entity.isMergeVertical()) {
			mergeMap.put(i, entity.getMergeRely());
		}
		if (entity.getList() != null) {
			for (ExcelExportEntity inner : entity.getList()) {
				if (inner.isMergeVertical()) {
					mergeMap.put(i, inner.getMergeRely());
				}
				i++;
			}
		} else {
			i++;
		}
	}
	return mergeMap;
}
 
Example 7
Source File: ExcelExportBase.java    From jeasypoi with Apache License 2.0 5 votes vote down vote up
/**
 * 获取导出报表的字段总长度
 * 
 * @param excelParams
 * @return
 */
public int getFieldWidth(List<ExcelExportEntity> excelParams) {
	int length = -1;// 从0开始计算单元格的
	for (ExcelExportEntity entity : excelParams) {
		length += entity.getList() != null ? entity.getList().size() : 1;
	}
	return length;
}
 
Example 8
Source File: ExportBase.java    From easypoi with Apache License 2.0 5 votes vote down vote up
/**
 * 对字段根据用户设置排序
 */
public void sortAllParams(List<ExcelExportEntity> excelParams) {
    Collections.sort(excelParams);
    for (ExcelExportEntity entity : excelParams) {
        if (entity.getList() != null) {
            Collections.sort(entity.getList());
        }
    }
}
 
Example 9
Source File: ExcelEntityParse.java    From jeasypoi with Apache License 2.0 5 votes vote down vote up
private int createCells(int index, Object t, List<ExcelExportEntity> 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;
}
 
Example 10
Source File: ExcelExportServer.java    From jeasypoi with Apache License 2.0 5 votes vote down vote up
/**
 * 创建表头
 * 
 * @param title
 * @param index
 */
private int createTitleRow(ExportParams title, Sheet sheet, Workbook workbook, int index, List<ExcelExportEntity> excelParams) {
	Row row = sheet.createRow(index);
	int rows = getRowNums(excelParams);
	row.setHeight((short) 450);
	Row listRow = null;
	if (rows == 2) {
		listRow = sheet.createRow(index + 1);
		listRow.setHeight((short) 450);
	}
	int cellIndex = 0;
	CellStyle titleStyle = getExcelExportStyler().getTitleStyle(title.getColor());
	for (int i = 0, exportFieldTitleSize = excelParams.size(); i < exportFieldTitleSize; i++) {
		ExcelExportEntity entity = excelParams.get(i);
		if (StringUtils.isNotBlank(entity.getName())) {
			createStringCell(row, cellIndex, entity.getName(), titleStyle, entity);
		}
		if (entity.getList() != null) {
			List<ExcelExportEntity> sTitel = entity.getList();
			if (StringUtils.isNotBlank(entity.getName())) {
				sheet.addMergedRegion(new CellRangeAddress(index, index, cellIndex, cellIndex + sTitel.size() - 1));
			}
			for (int j = 0, size = sTitel.size(); j < size; j++) {
				createStringCell(rows == 2 ? listRow : row, cellIndex, sTitel.get(j).getName(), titleStyle, entity);
				cellIndex++;
			}
			cellIndex--;
		} else if (rows == 2) {
			createStringCell(listRow, cellIndex, "", titleStyle, entity);
			sheet.addMergedRegion(new CellRangeAddress(index, index + 1, cellIndex, cellIndex));
		}
		cellIndex++;
	}
	return rows;

}
 
Example 11
Source File: ExportBase.java    From jeasypoi with Apache License 2.0 5 votes vote down vote up
/**
 * 对字段根据用户设置排序
 */
public void sortAllParams(List<ExcelExportEntity> excelParams) {
	Collections.sort(excelParams);
	for (ExcelExportEntity entity : excelParams) {
		if (entity.getList() != null) {
			Collections.sort(entity.getList());
		}
	}
}
 
Example 12
Source File: ExcelEntityParse.java    From autopoi with Apache License 2.0 5 votes vote down vote up
private int createCells(int index, Object t, List<ExcelExportEntity> 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;
}
 
Example 13
Source File: ExcelEntityParse.java    From easypoi with Apache License 2.0 5 votes vote down vote up
private int createCells(int index, Object t, List<ExcelExportEntity> 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;
}
 
Example 14
Source File: ExportBase.java    From autopoi with Apache License 2.0 5 votes vote down vote up
/**
 * 对字段根据用户设置排序
 */
public void sortAllParams(List<ExcelExportEntity> excelParams) {
	Collections.sort(excelParams);
	for (ExcelExportEntity entity : excelParams) {
		if (entity.getList() != null) {
			Collections.sort(entity.getList());
		}
	}
}
 
Example 15
Source File: ExcelExportBase.java    From autopoi with Apache License 2.0 5 votes vote down vote up
/**
 * 获取导出报表的字段总长度
 * 
 * @param excelParams
 * @return
 */
public int getFieldWidth(List<ExcelExportEntity> excelParams) {
	int length = -1;// 从0开始计算单元格的
	for (ExcelExportEntity entity : excelParams) {
		length += entity.getList() != null ? entity.getList().size() : 1;
	}
	return length;
}
 
Example 16
Source File: ExcelExportBase.java    From autopoi with Apache License 2.0 4 votes vote down vote up
/**
 * 创建 最主要的 Cells
 * 
 * @param styles
 * @param rowHeight
 * @throws Exception
 */
public int createCells(Drawing patriarch, int index, Object t, List<ExcelExportEntity> excelParams, Sheet sheet, Workbook workbook, short rowHeight) throws Exception {
	ExcelExportEntity entity;
	Row row = sheet.createRow(index);
	row.setHeight(rowHeight);
	int maxHeight = 1, cellNum = 0;
	int indexKey = createIndexCell(row, index, excelParams.get(0));
	cellNum += indexKey;
	for (int k = indexKey, paramSize = excelParams.size(); k < paramSize; k++) {
		entity = excelParams.get(k);
		//update-begin-author:taoyan date:20200319 for:建议autoPoi升级,优化数据返回List Map格式下的复合表头导出excel的体验 #873
		if(entity.isSubColumn()){
			continue;
		}
		if(entity.isMergeColumn()){
			Map<String,Object> subColumnMap = new HashMap<>();
			List<String> mapKeys = entity.getSubColumnList();
			for (String subKey : mapKeys) {
				Object subKeyValue = null;
				if (t instanceof Map) {
					subKeyValue = ((Map<?, ?>) t).get(subKey);
				}else{
					subKeyValue = PoiPublicUtil.getParamsValue(subKey,t);
				}
				subColumnMap.put(subKey,subKeyValue);
			}
			createListCells(patriarch, index, cellNum, subColumnMap, entity.getList(), sheet, workbook);
			cellNum += entity.getSubColumnList().size();
		//update-end-author:taoyan date:20200319 for:建议autoPoi升级,优化数据返回List Map格式下的复合表头导出excel的体验 #873
		} else if (entity.getList() != null) {
			Collection<?> list = getListCellValue(entity, t);
			int listC = 0;
			for (Object obj : list) {
				createListCells(patriarch, index + listC, cellNum, obj, entity.getList(), sheet, workbook);
				listC++;
			}
			cellNum += entity.getList().size();
			if (list != null && list.size() > maxHeight) {
				maxHeight = list.size();
			}
		} else {
			Object value = getCellValue(entity, t);
			//update-begin--Author:xuelin  Date:20171018 for:TASK #2372 【excel】easypoi 导出类型,type增加数字类型--------------------
			if (entity.getType() == 1) {
				createStringCell(row, cellNum++, value == null ? "" : value.toString(), index % 2 == 0 ? getStyles(false, entity) : getStyles(true, entity), entity);
			} else if (entity.getType() == 4){
				createNumericCell(row, cellNum++, value == null ? "" : value.toString(), index % 2 == 0 ? getStyles(false, entity) : getStyles(true, entity), entity);
			} else {
				createImageCell(patriarch, entity, row, cellNum++, value == null ? "" : value.toString(), t);
			}
			//update-end--Author:xuelin  Date:20171018 for:TASK #2372 【excel】easypoi 导出类型,type增加数字类型--------------------
		}
	}
	// 合并需要合并的单元格
	cellNum = 0;
	for (int k = indexKey, paramSize = excelParams.size(); k < paramSize; k++) {
		entity = excelParams.get(k);
		if (entity.getList() != null) {
			cellNum += entity.getList().size();
		} else if (entity.isNeedMerge()) {
			for (int i = index + 1; i < index + maxHeight; i++) {
				sheet.getRow(i).createCell(cellNum);
				sheet.getRow(i).getCell(cellNum).setCellStyle(getStyles(false, entity));
			}
			sheet.addMergedRegion(new CellRangeAddress(index, index + maxHeight - 1, cellNum, cellNum));
			cellNum++;
		}
	}
	return maxHeight;

}
 
Example 17
Source File: ExcelExportBase.java    From jeasypoi with Apache License 2.0 4 votes vote down vote up
/**
 * 创建 最主要的 Cells
 * 
 * @param styles
 * @param rowHeight
 * @throws Exception
 */
public int createCells(Drawing patriarch, int index, Object t, List<ExcelExportEntity> excelParams, Sheet sheet, Workbook workbook, short rowHeight) throws Exception {
	ExcelExportEntity entity;
	Row row = sheet.createRow(index);
	row.setHeight(rowHeight);
	int maxHeight = 1, cellNum = 0;
	int indexKey = createIndexCell(row, index, excelParams.get(0));
	cellNum += indexKey;
	for (int k = indexKey, paramSize = excelParams.size(); k < paramSize; k++) {
		entity = excelParams.get(k);
		if (entity.getList() != null) {
			Collection<?> list = getListCellValue(entity, t);
			int listC = 0;
			for (Object obj : list) {
				createListCells(patriarch, index + listC, cellNum, obj, entity.getList(), sheet, workbook);
				listC++;
			}
			cellNum += entity.getList().size();
			if (list != null && list.size() > maxHeight) {
				maxHeight = list.size();
			}
		} else {
			Object value = getCellValue(entity, t);
			if (entity.getType() == 1) {
				createStringCell(row, cellNum++, value == null ? "" : value.toString(), index % 2 == 0 ? getStyles(false, entity) : getStyles(true, entity), entity);
			} else if (entity.getType() == 4){
				createNumericCell(row, cellNum++, value == null ? "" : value.toString(), index % 2 == 0 ? getStyles(false, entity) : getStyles(true, entity), entity);
			} else {
				createImageCell(patriarch, entity, row, cellNum++, value == null ? "" : value.toString(), t);
			}
		}
	}
	// 合并需要合并的单元格
	cellNum = 0;
	for (int k = indexKey, paramSize = excelParams.size(); k < paramSize; k++) {
		entity = excelParams.get(k);
		if (entity.getList() != null) {
			cellNum += entity.getList().size();
		} else if (entity.isNeedMerge()) {
			for (int i = index + 1; i < index + maxHeight; i++) {
				sheet.getRow(i).createCell(cellNum);
				sheet.getRow(i).getCell(cellNum).setCellStyle(getStyles(false, entity));
			}
			sheet.addMergedRegion(new CellRangeAddress(index, index + maxHeight - 1, cellNum, cellNum));
			cellNum++;
		}
	}
	return maxHeight;

}
 
Example 18
Source File: ExcelExportServer.java    From autopoi with Apache License 2.0 4 votes vote down vote up
/**
 * 创建表头
 * 
 * @param title
 * @param index
 */
private int createTitleRow(ExportParams title, Sheet sheet, Workbook workbook, int index, List<ExcelExportEntity> excelParams) {
	Row row = sheet.createRow(index);
	int rows = getRowNums(excelParams);
	row.setHeight((short) 450);
	Row listRow = null;
	if (rows == 2) {
		listRow = sheet.createRow(index + 1);
		listRow.setHeight((short) 450);
	}
	int cellIndex = 0;
	CellStyle titleStyle = getExcelExportStyler().getTitleStyle(title.getColor());
	for (int i = 0, exportFieldTitleSize = excelParams.size(); i < exportFieldTitleSize; i++) {
		ExcelExportEntity entity = excelParams.get(i);
		//update-begin-author:taoyan date:20200319 for:建议autoPoi升级,优化数据返回List Map格式下的复合表头导出excel的体验 #873
		if(entity.isColspan()){
			List<String> subList = entity.getSubColumnList();
			if(subList==null || subList.size()==0){
				continue;
			}else{
				entity.initSubExportEntity(excelParams);
			}
		}
		//update-end-author:taoyan date:20200319 for:建议autoPoi升级,优化数据返回List Map格式下的复合表头导出excel的体验 #873
		if (StringUtils.isNotBlank(entity.getName())) {
			createStringCell(row, cellIndex, entity.getName(), titleStyle, entity);
		}
		if (entity.getList() != null) {
			List<ExcelExportEntity> sTitel = entity.getList();
			if (StringUtils.isNotBlank(entity.getName())) {
				sheet.addMergedRegion(new CellRangeAddress(index, index, cellIndex, cellIndex + sTitel.size() - 1));
			}
			for (int j = 0, size = sTitel.size(); j < size; j++) {
				createStringCell(rows == 2 ? listRow : row, cellIndex, sTitel.get(j).getName(), titleStyle, entity);
				cellIndex++;
			}
			cellIndex--;
		} else if (rows == 2) {
			createStringCell(listRow, cellIndex, "", titleStyle, entity);
			sheet.addMergedRegion(new CellRangeAddress(index, index + 1, cellIndex, cellIndex));
		}
		cellIndex++;
	}
	return rows;

}
 
Example 19
Source File: ExcelExportBase.java    From easypoi with Apache License 2.0 4 votes vote down vote up
/**
 * 创建 最主要的 Cells
 * 
 * @param styles
 * @param rowHeight
 * @throws Exception
 */
public int createCells(Drawing patriarch, int index, Object t,
                       List<ExcelExportEntity> excelParams, Sheet sheet, Workbook workbook,
                       short rowHeight) throws Exception {
    ExcelExportEntity entity;
    Row row = sheet.createRow(index);
    row.setHeight(rowHeight);
    int maxHeight = 1, cellNum = 0;
    int indexKey = createIndexCell(row, index, excelParams.get(0));
    cellNum += indexKey;
    for (int k = indexKey, paramSize = excelParams.size(); k < paramSize; k++) {
        entity = excelParams.get(k);
        if (entity.getList() != null) {
            Collection<?> list = getListCellValue(entity, t);
            int listC = 0;
            for (Object obj : list) {
                createListCells(patriarch, index + listC, cellNum, obj, entity.getList(),
                    sheet, workbook);
                listC++;
            }
            cellNum += entity.getList().size();
            if (list != null && list.size() > maxHeight) {
                maxHeight = list.size();
            }
        } else {
            Object value = getCellValue(entity, t);
            if (entity.getType() == 1) {
                createStringCell(row, cellNum++, value == null ? "" : value.toString(),
                    index % 2 == 0 ? getStyles(false, entity) : getStyles(true, entity), entity);
            } else {
                createImageCell(patriarch, entity, row, cellNum++,
                    value == null ? "" : value.toString(), t);
            }
        }
    }
    // 合并需要合并的单元格
    cellNum = 0;
    for (int k = indexKey, paramSize = excelParams.size(); k < paramSize; k++) {
        entity = excelParams.get(k);
        if (entity.getList() != null) {
            cellNum += entity.getList().size();
        } else if (entity.isNeedMerge()) {
            for (int i = index + 1; i < index + maxHeight; i++) {
                sheet.getRow(i).createCell(cellNum);
                sheet.getRow(i).getCell(cellNum).setCellStyle(getStyles(false, entity));
            }
            sheet.addMergedRegion(new CellRangeAddress(index, index + maxHeight - 1, cellNum,
                cellNum));
            cellNum++;
        }
    }
    return maxHeight;

}
 
Example 20
Source File: ExportBase.java    From autopoi with Apache License 2.0 4 votes vote down vote up
/**
 * 循环ExcelExportEntity集合 附加配置信息<br>
 * 1.列排序<br>
 * 2.读取图片根路径设置(如果有字段是图片类型 并且存储在本地 则设置磁盘路径获取全地址导出)<br>
 * 3.多表头配置(仅限于单表 会走这个逻辑处理)
 */
public void reConfigExcelExportParams(List<ExcelExportEntity> excelParams, ExportParams exportParams) {
	Set<String> NameSet = new HashSet<String>();
	Map<String,List<String>> groupAndColumnList = new HashMap<String,List<String>>();
	Map<String,Integer> groupOrder = new HashMap<>();
	int index = -99;
	for (ExcelExportEntity entity : excelParams) {
		if(entity.getOrderNum()==0){
			entity.setOrderNum(index++);
		}
		if(entity.getExportImageType()==3){
			entity.setImageBasePath(exportParams.getImageBasePath());
		}
		if (entity.getList() != null) {
			Collections.sort(entity.getList());
		}
		String groupName = entity.getGroupName();
		if(StringUtils.isNotEmpty(groupName)){
			List<String> ls = groupAndColumnList.get(groupName);
			if(ls==null){
				ls = new ArrayList<String>();
				groupAndColumnList.put(groupName,ls);
			}
			ls.add(entity.getKey().toString());

			Integer order = groupOrder.get(groupName);
			if(order==null || entity.getOrderNum()<order){
				order = entity.getOrderNum();
			}
			groupOrder.put(groupName,order);
		}
	}

	for(String key: groupAndColumnList.keySet()){
		ExcelExportEntity temp = new ExcelExportEntity(key);
		temp.setColspan(true);
		temp.setSubColumnList(groupAndColumnList.get(key));
		temp.setOrderNum(groupOrder.get(key));
		excelParams.add(temp);
	}
	Collections.sort(excelParams);
}