refactor: 用户导入优化
This commit is contained in:
1 parent
3741f71bee
commit
07b7cd5651
7 files changed
+155
-66
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package com.youlai.system.common.util;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.youlai.system.framework.easyexcel.ExcelResult;
|
||||
import com.youlai.system.framework.easyexcel.MyAnalysisEventListener;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* Excel 工具类
|
||||
*
|
||||
* @author: haoxr
|
||||
* @date: 2023/03/01
|
||||
*/
|
||||
public class ExcelUtils {
|
||||
|
||||
public static <T> ExcelResult importExcel(InputStream is, Class clazz, MyAnalysisEventListener<T> listener) {
|
||||
EasyExcel.read(is, clazz, listener).sheet().doRead();
|
||||
ExcelResult excelResult = listener.getResult();
|
||||
return excelResult;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user