This commit is contained in:
fumeiai 2020-05-21 18:30:21 +08:00
parent e50cc47591
commit ac7902edde
6 changed files with 66 additions and 45 deletions

21
.idea/workspace.xml generated
View File

@ -4,7 +4,9 @@
<list default="true" id="e4baaf01-a2c2-445d-98a1-9f4c50c148cf" name="Default Changelist" comment=""> <list default="true" id="e4baaf01-a2c2-445d-98a1-9f4c50c148cf" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/target/classes/com/lz/common/utils/ExcelUtil$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/common/utils/ExcelUtil$1.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/common/utils/ExcelUtil.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/common/utils/ExcelUtil.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/lz/modules/app/controller/StaffController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/lz/modules/app/controller/StaffController.class" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -156,7 +158,7 @@
<workItem from="1588161274115" duration="1691000" /> <workItem from="1588161274115" duration="1691000" />
<workItem from="1588163384182" duration="74761000" /> <workItem from="1588163384182" duration="74761000" />
<workItem from="1588936950753" duration="95758000" /> <workItem from="1588936950753" duration="95758000" />
<workItem from="1590038091791" duration="10294000" /> <workItem from="1590038091791" duration="10974000" />
</task> </task>
<servers /> <servers />
</component> </component>
@ -224,6 +226,21 @@
<line>212</line> <line>212</line>
<option name="timeStamp" value="74" /> <option name="timeStamp" value="74" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/com/lz/modules/app/controller/StaffController.java</url>
<line>249</line>
<option name="timeStamp" value="78" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java</url>
<line>184</line>
<option name="timeStamp" value="80" />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/com/lz/common/utils/ExcelUtil.java</url>
<line>205</line>
<option name="timeStamp" value="81" />
</line-breakpoint>
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>
</component> </component>

View File

@ -564,6 +564,7 @@ public class ExcelUtil {
} }
} }
if (dataSet!=null) {
// 遍历集合数据产生数据行 // 遍历集合数据产生数据行
Iterator<T> it = dataSet.iterator(); Iterator<T> it = dataSet.iterator();
int index = 0; int index = 0;
@ -618,6 +619,9 @@ public class ExcelUtil {
logger.error(e.toString(), e); logger.error(e.toString(), e);
} }
} }
}
// 设定自动宽度 // 设定自动宽度
for (int i = 0; i < headers.size(); i++) { for (int i = 0; i < headers.size(); i++) {
sheet.autoSizeColumn(i); sheet.autoSizeColumn(i);