|
|
|
@ -12,12 +12,6 @@
|
|
|
|
|
*/
|
|
|
|
|
package vip.xiaonuo;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
|
|
import com.alibaba.excel.read.listener.PageReadListener;
|
|
|
|
|
import vip.xiaonuo.common.exception.CommonException;
|
|
|
|
|
import vip.xiaonuo.sys.modular.user.param.SysUserImportParam;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* TestMain方法
|
|
|
|
|
*
|
|
|
|
@ -25,17 +19,7 @@ import vip.xiaonuo.sys.modular.user.param.SysUserImportParam;
|
|
|
|
|
* @date 2022/9/17 17:10
|
|
|
|
|
*/
|
|
|
|
|
public class Test {
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
|
|
try {
|
|
|
|
|
// TODO 导入
|
|
|
|
|
EasyExcel.read("D://import.xlsx", SysUserImportParam.class, new PageReadListener<SysUserImportParam>(dataList -> {
|
|
|
|
|
for (SysUserImportParam sysUserImportParam : dataList) {
|
|
|
|
|
System.out.println(JSONUtil.toJsonStr(sysUserImportParam));
|
|
|
|
|
}
|
|
|
|
|
})).sheet().headRowNumber(2).doRead();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
throw new CommonException("文件导入失败");
|
|
|
|
|
}
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|