|
@@ -148,9 +148,11 @@ public class ExcelUtils {
|
|
|
list = ExcelImportUtil.importExcel(new File(filePath), pojoClass, params);
|
|
|
} catch (NoSuchElementException e) {
|
|
|
// throw new NormalException("模板不能为空");
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "模板不能为空");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
// throw new NormalException(e.getMessage());
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "导入Excel异常");
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
@@ -168,9 +170,11 @@ public class ExcelUtils {
|
|
|
list = ExcelImportUtil.importExcel(file.getInputStream(), pojoClass, params);
|
|
|
} catch (NoSuchElementException e) {
|
|
|
// throw new NormalException("excel文件不能为空");
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "excel文件不能为空");
|
|
|
} catch (Exception e) {
|
|
|
// throw new NormalException(e.getMessage());
|
|
|
System.out.println(e.getMessage());
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "导入Excel异常");
|
|
|
}
|
|
|
return list;
|
|
|
}
|