Commit 4ab049b6 authored by yanzg's avatar yanzg

Excel导出功能

parent 0f0d6ff2
...@@ -559,7 +559,7 @@ public class ObjectHelper { ...@@ -559,7 +559,7 @@ public class ObjectHelper {
public static <T> ArrayList<T> getList(Class<T> cls, Object froms) { public static <T> ArrayList<T> getList(Class<T> cls, Object froms) {
ArrayList<T> tos = new ArrayList<T>(); ArrayList<T> tos = new ArrayList<T>();
if (froms instanceof List) { if (froms instanceof List) {
List vCodeFrom = (List) ((froms instanceof List) ? froms : null); List vCodeFrom = (List) ((froms instanceof List) ? froms : new ArrayList<>());
for (Object from : vCodeFrom) { for (Object from : vCodeFrom) {
if (StringHelper.isEmpty(from)) { if (StringHelper.isEmpty(from)) {
continue; continue;
......
...@@ -37,7 +37,10 @@ public class ZipHelper { ...@@ -37,7 +37,10 @@ public class ZipHelper {
* @Title: zipDirectory * @Title: zipDirectory
*/ */
public static void zipDirectory(File dirFile, File zipFile) throws IOException { public static void zipDirectory(File dirFile, File zipFile) throws IOException {
if (dirFile == null || !dirFile.isDirectory()) { if (dirFile == null) {
throw new CodeException("压缩时文件夹对象不能为空。");
}
if (!dirFile.isDirectory()) {
throw new CodeException("[" + dirFile.getName() + "]不是一个文件夹,或者不存在。"); throw new CodeException("[" + dirFile.getName() + "]不是一个文件夹,或者不存在。");
} }
if (zipFile == null) { if (zipFile == null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment