diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 3e3afa3b..80e2a87f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,9 @@
-
+
+
+
@@ -156,7 +158,7 @@
-
+
@@ -224,6 +226,21 @@
212
+
+ file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java
+ 249
+
+
+
+ file://$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java
+ 184
+
+
+
+ file://$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java
+ 205
+
+
diff --git a/src/main/java/com/lz/common/utils/ExcelUtil.java b/src/main/java/com/lz/common/utils/ExcelUtil.java
index f3556127..8d6c7583 100644
--- a/src/main/java/com/lz/common/utils/ExcelUtil.java
+++ b/src/main/java/com/lz/common/utils/ExcelUtil.java
@@ -564,60 +564,64 @@ public class ExcelUtil {
}
}
- // 遍历集合数据,产生数据行
- Iterator it = dataSet.iterator();
- int index = 0;
- while (it.hasNext()) {
- index++;
- row = sheet.createRow(index);
- //获取数据源一条数据
- T data = it.next();
- try {
- //若
- if (data instanceof Map) {
- @SuppressWarnings("unchecked")
- Map map = (Map) data;
- int cellNum = 0;
- //遍历列名
- Iterator it2 = keys.iterator();
- while (it2.hasNext()) {
- key = it2.next();
+ if (dataSet!=null) {
+ // 遍历集合数据,产生数据行
+ Iterator it = dataSet.iterator();
+ int index = 0;
+ while (it.hasNext()) {
+ index++;
+ row = sheet.createRow(index);
+ //获取数据源一条数据
+ T data = it.next();
+ try {
+ //若
+ if (data instanceof Map) {
+ @SuppressWarnings("unchecked")
+ Map map = (Map) data;
+ int cellNum = 0;
+ //遍历列名
+ Iterator it2 = keys.iterator();
+ while (it2.hasNext()) {
+ key = it2.next();
- //todo:这样并不会将当前项空出,而是所有值向前移动一位
- if (!headers.containsKey(key)) {
- logger.error("Map 中 不存在 key [" + key + "]");
- continue;
+ //todo:这样并不会将当前项空出,而是所有值向前移动一位
+ if (!headers.containsKey(key)) {
+ logger.error("Map 中 不存在 key [" + key + "]");
+ continue;
+ }
+ Object value = map.get(key);
+ HSSFCell cell = row.createCell(cellNum);
+
+ cellNum = setCellValue(cell, value, pattern, cellNum, null, row);
+
+ cellNum++;
}
- Object value = map.get(key);
- HSSFCell cell = row.createCell(cellNum);
+ } else {
- cellNum = setCellValue(cell, value, pattern, cellNum, null, row);
-
- cellNum++;
- }
- } else {
-
- //获取对应字段
+ //获取对应字段
// List fields = sortFieldByAnno(data.getClass());
- List fields = sortFieldNoAnnoCheck(data.getClass());
+ List fields = sortFieldNoAnnoCheck(data.getClass());
- int cellNum = 0;
- for (FieldForSortting field1 : fields) {
- HSSFCell cell = row.createCell(cellNum);
- //获取当前字段属性
- Field field = field1.getField();
- field.setAccessible(true);
- Object value = field.get(data);
+ int cellNum = 0;
+ for (FieldForSortting field1 : fields) {
+ HSSFCell cell = row.createCell(cellNum);
+ //获取当前字段属性
+ Field field = field1.getField();
+ field.setAccessible(true);
+ Object value = field.get(data);
- cellNum = setCellValue(cell, value, pattern, cellNum, field, row);
+ cellNum = setCellValue(cell, value, pattern, cellNum, field, row);
- cellNum++;
+ cellNum++;
+ }
}
+ } catch (Exception e) {
+ logger.error(e.toString(), e);
}
- } catch (Exception e) {
- logger.error(e.toString(), e);
}
}
+
+
// 设定自动宽度
for (int i = 0; i < headers.size(); i++) {
sheet.autoSizeColumn(i);
diff --git a/target/classes/com/lz/common/utils/ExcelUtil$1.class b/target/classes/com/lz/common/utils/ExcelUtil$1.class
index ceb81c4e..e5ad81de 100644
Binary files a/target/classes/com/lz/common/utils/ExcelUtil$1.class and b/target/classes/com/lz/common/utils/ExcelUtil$1.class differ
diff --git a/target/classes/com/lz/common/utils/ExcelUtil.class b/target/classes/com/lz/common/utils/ExcelUtil.class
index 5b19d908..3b29521a 100644
Binary files a/target/classes/com/lz/common/utils/ExcelUtil.class and b/target/classes/com/lz/common/utils/ExcelUtil.class differ
diff --git a/target/classes/com/lz/modules/app/controller/StaffController.class b/target/classes/com/lz/modules/app/controller/StaffController.class
index 294ff4ff..1df36fe5 100644
Binary files a/target/classes/com/lz/modules/app/controller/StaffController.class and b/target/classes/com/lz/modules/app/controller/StaffController.class differ
diff --git a/target/classes/com/lz/modules/sys/oauth2/OAuth2Filter.class b/target/classes/com/lz/modules/sys/oauth2/OAuth2Filter.class
index 64186ed4..3632a317 100644
Binary files a/target/classes/com/lz/modules/sys/oauth2/OAuth2Filter.class and b/target/classes/com/lz/modules/sys/oauth2/OAuth2Filter.class differ