Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
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
yaru
fgqyxxlr
Commits
b1f4952c
Commit
b1f4952c
authored
Jun 01, 2019
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入Excel根据表头与注解名匹配
parent
999cd996
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
ruoyi-admin/pom.xml
+1
-1
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
+9
-6
No files found.
ruoyi-admin/pom.xml
View file @
b1f4952c
...
...
@@ -8,7 +8,7 @@
<version>
3.3
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
w
ar
</packaging>
<packaging>
j
ar
</packaging>
<artifactId>
ruoyi-admin
</artifactId>
<description>
...
...
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
View file @
b1f4952c
...
...
@@ -136,17 +136,20 @@ public class ExcelUtil<T>
if
(
rows
>
0
)
{
// 定义一个map用于存放excel列的序号和field.
Map
<
String
,
Integer
>
cellMap
=
new
HashMap
<
String
,
Integer
>();
//获取表头
//
获取表头
Row
heard
=
sheet
.
getRow
(
0
);
for
(
int
i
=
0
;
i
<
heard
.
getPhysicalNumberOfCells
();
i
++)
{
for
(
int
i
=
0
;
i
<
heard
.
getPhysicalNumberOfCells
();
i
++)
{
Cell
cell
=
heard
.
getCell
(
i
);
if
(
StringUtils
.
isNotNull
(
cell
!=
null
))
{
String
value
=
this
.
getCellValue
(
heard
,
i
).
toString
();
if
(
StringUtils
.
isNotNull
(
cell
!=
null
))
{
String
value
=
this
.
getCellValue
(
heard
,
i
).
toString
();
cellMap
.
put
(
value
,
i
);
}
else
{
}
else
{
cellMap
.
put
(
null
,
i
);
}
}
...
...
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