Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Y
YX_IDENT_beijing_auxiliary_YD
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
zhangyusheng
YX_IDENT_beijing_auxiliary_YD
Commits
b8190823
Commit
b8190823
authored
Jan 08, 2021
by
liuxinben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入excel,批量取消邮寄
parent
cf4059ae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
ExportExcel.java
src/main/java/com/yxproject/start/utils/ExportExcel.java
+8
-4
No files found.
src/main/java/com/yxproject/start/utils/ExportExcel.java
View file @
b8190823
...
...
@@ -384,19 +384,22 @@ public class ExportExcel {
String
[]
s
=
new
String
[
headerNum
];
for
(
int
o
=
0
;
o
<
headerNum
;
o
++){
Cell
headerCell
=
sheet
.
getRow
(
0
).
getCell
(
o
);
headerCell
.
setCellType
(
CellType
.
STRING
);
Cell
headerCell
=
sheet
.
getRow
(
2
).
getCell
(
o
);
//
headerCell.setCellType(CellType.STRING);
s
[
o
]
=
headerCell
.
getStringCellValue
();
}
// sheet.getRows()返回该页的总行数
for
(
int
nowRowNum
=
3
;
nowRowNum
<
rowNum
-
2
;
nowRowNum
++)
{
for
(
int
nowRowNum
=
3
;
nowRowNum
<
=
rowNum
;
nowRowNum
++)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Row
row
=
sheet
.
getRow
(
nowRowNum
);
// sheet.getColumns()返回该页的总列数
int
columnNum
=
row
.
getLastCellNum
();
for
(
int
nowColumnNum
=
0
;
nowColumnNum
<
columnNum
;
nowColumnNum
++)
{
Cell
columnCell
=
sheet
.
getRow
(
nowRowNum
).
getCell
(
nowColumnNum
);
columnCell
.
setCellType
(
CellType
.
STRING
);
// columnCell.setCellType(CellType.STRING);
if
(
ObjectUtils
.
isEmpty
(
columnCell
)){
continue
;
}
else
{
String
cellinfo
=
columnCell
.
getStringCellValue
();
if
(
cellinfo
.
isEmpty
()
||
cellinfo
.
equals
(
""
)){
continue
;
...
...
@@ -404,6 +407,7 @@ public class ExportExcel {
map
.
put
(
s
[
nowColumnNum
],
cellinfo
);
}
}
}
if
(!
ObjectUtils
.
isEmpty
(
map
)){
outerList
.
add
(
map
);
}
...
...
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