ExcelUtil中补充实体与解析头对应关系,支持excel中重复的表头列信息导入(当前对于重复的表头会取最后的一个为准),如果导入的数据确认有重复字段。
例如:备注字段
输入图片说明

实体中对应

@Excel(name = "备注", type = Excel.Type.IMPORT)
private String remark;

@Excel(name = "备注2", type = Excel.Type.IMPORT)
private String remark2;

@Excel(name = "备注3", type = Excel.Type.IMPORT)
private String remark3;

多级表头情况简单处理了下,因为设计多级表头的第一行只有一个字段,其他字段其实都是空值,所以考虑可以增加顺序号来简单获取下值。
输入图片说明
实体:

@Excel(name = "第一级", type = Excel.Type.IMPORT)
private String remark;

@Excel(name = "1", type = Excel.Type.IMPORT)
private String remark2;

@Excel(name = "2", type = Excel.Type.IMPORT)
private String remark3;