Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
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
liyang
sts网站
Commits
6a742e1d
Commit
6a742e1d
authored
Aug 19, 2023
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Excel导入数据临时文件无法删除问题(I7KIXX)
parent
5b61aea0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
ExcelUtil.java
...n/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
+16
-3
No files found.
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
View file @
6a742e1d
...
@@ -288,9 +288,23 @@ public class ExcelUtil<T>
...
@@ -288,9 +288,23 @@ public class ExcelUtil<T>
* @param is 输入流
* @param is 输入流
* @return 转换后集合
* @return 转换后集合
*/
*/
public
List
<
T
>
importExcel
(
InputStream
is
)
throws
Exception
public
List
<
T
>
importExcel
(
InputStream
is
)
{
{
return
importExcel
(
is
,
0
);
List
<
T
>
list
=
null
;
try
{
list
=
importExcel
(
is
,
0
);
}
catch
(
Exception
e
)
{
log
.
error
(
"导入Excel异常{}"
,
e
.
getMessage
());
throw
new
UtilException
(
e
.
getMessage
());
}
finally
{
IOUtils
.
closeQuietly
(
is
);
}
return
list
;
}
}
/**
/**
...
@@ -336,7 +350,6 @@ public class ExcelUtil<T>
...
@@ -336,7 +350,6 @@ public class ExcelUtil<T>
}
}
// 获取最后一个非空行的行下标,比如总行数为n,则返回的为n-1
// 获取最后一个非空行的行下标,比如总行数为n,则返回的为n-1
int
rows
=
sheet
.
getLastRowNum
();
int
rows
=
sheet
.
getLastRowNum
();
if
(
rows
>
0
)
if
(
rows
>
0
)
{
{
// 定义一个map用于存放excel列的序号和field.
// 定义一个map用于存放excel列的序号和field.
...
...
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