Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fulixin
dsk-operate-sys-cscec
Commits
7f637f80
Commit
7f637f80
authored
Feb 06, 2024
by
lcl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
16242821
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
ExcelUtils.java
...common/src/main/java/com/dsk/common/excel/ExcelUtils.java
+6
-3
No files found.
dsk-common/src/main/java/com/dsk/common/excel/ExcelUtils.java
View file @
7f637f80
...
...
@@ -14,6 +14,7 @@ import com.dsk.common.utils.file.ImageUtils;
import
com.dsk.common.utils.poi.ExcelHandlerAdapter
;
import
com.dsk.common.utils.poi.ExcelUtil
;
import
com.dsk.common.utils.reflect.ReflectUtils
;
import
org.apache.commons.collections4.list.CursorableLinkedList
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.RegExUtils
;
import
org.apache.commons.lang3.reflect.FieldUtils
;
...
...
@@ -1397,7 +1398,7 @@ public class ExcelUtils<T> {
}
/**
* 对excel表单
指定表格索引名
转换成list
* 对excel表单
所有表格
转换成list
*
* @param titleNum 标题占用行数
* @param is 输入流
...
...
@@ -1406,7 +1407,7 @@ public class ExcelUtils<T> {
public
List
<
T
>
importExcelAllSheet
(
InputStream
is
,
int
titleNum
)
throws
Exception
{
this
.
type
=
Excel
.
Type
.
IMPORT
;
this
.
wb
=
WorkbookFactory
.
create
(
is
);
List
<
T
>
resList
=
new
ArrayList
<
T
>();
List
<
T
>
resList
=
new
ArrayList
<>();
int
sheetCount
=
wb
.
getNumberOfSheets
();
System
.
out
.
println
(
"工作表个数为:"
+
sheetCount
);
IntStream
.
rangeClosed
(
0
,
sheetCount
-
1
).
parallel
().
forEach
(
sheetNum
->
{
...
...
@@ -1523,9 +1524,11 @@ public class ExcelUtils<T> {
ReflectUtils
.
invokeSetter
(
entity
,
propertyName
,
val
);
}
}
synchronized
(
resList
){
resList
.
add
(
entity
);
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment