package com.meeno.framework.util.easyexcel.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @description:
* @author: Wzq
* @create: 2020-03-24 20:19
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AuthExcelModel {
private String code;
private String name;
private String categoryName;
private String categoryChildrenName;
private String parentCode;
private String parentName;
private Date createDate;
}
package com.meeno.framework.util.easyexcel.listener;
//import com.alibaba.excel.context.AnalysisContext;
//import com.alibaba.excel.event.AnalysisEventListener;
import com.meeno.framework.util.easyexcel.entity.AuthExcelModel;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* @description: Listener
* @author: Wzq
* @create: 2020-03-25 10:16
*/
@Data
public class AuthExcelModelListener extends AnalysisEventListener {
List list = new ArrayList();
@Override
public void invoke(AuthExcelModel authExcelModel, AnalysisContext analysisContext) {
list.add(authExcelModel);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
}*/
}
EasyExcel.read(file.getInputStream(), AuthExcelModel.class, authExcelModelListener).sheet().doRead();