Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
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
zhangkb
indicators
Commits
36ccdb2c
Commit
36ccdb2c
authored
Aug 31, 2020
by
张祺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改easyexcel的版本,并修改导入excel数据的处理
parent
b4dcd4d2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
pom.xml
pom.xml
+1
-1
ExcelUtil.java
src/main/java/com/keymobile/indicators/utils/ExcelUtil.java
+3
-1
No files found.
pom.xml
View file @
36ccdb2c
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<spring-cloud.version>
Finchley.RELEASE
</spring-cloud.version>
<spring-cloud.version>
Finchley.RELEASE
</spring-cloud.version>
<akka.version>
2.6.0-M4
</akka.version>
<akka.version>
2.6.0-M4
</akka.version>
<poi.version>
4.1.1
</poi.version>
<poi.version>
4.1.1
</poi.version>
<easyExcel.version>
2.
1.1
</easyExcel.version>
<easyExcel.version>
2.
2.6
</easyExcel.version>
<fastjson.version>
1.2.70
</fastjson.version>
<fastjson.version>
1.2.70
</fastjson.version>
</properties>
</properties>
...
...
src/main/java/com/keymobile/indicators/utils/ExcelUtil.java
View file @
36ccdb2c
...
@@ -4,6 +4,7 @@ import org.apache.poi.ss.usermodel.CellType;
...
@@ -4,6 +4,7 @@ import org.apache.poi.ss.usermodel.CellType;
import
org.apache.poi.xssf.usermodel.XSSFCell
;
import
org.apache.poi.xssf.usermodel.XSSFCell
;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
import
java.text.NumberFormat
;
import
java.text.NumberFormat
;
/**
/**
...
@@ -12,6 +13,7 @@ import java.text.NumberFormat;
...
@@ -12,6 +13,7 @@ import java.text.NumberFormat;
public
class
ExcelUtil
{
public
class
ExcelUtil
{
private
static
NumberFormat
numberFormat
=
NumberFormat
.
getNumberInstance
();
private
static
NumberFormat
numberFormat
=
NumberFormat
.
getNumberInstance
();
private
static
DecimalFormat
df
=
new
DecimalFormat
(
"#.##########"
);
static
{
static
{
numberFormat
.
setRoundingMode
(
RoundingMode
.
HALF_UP
);
numberFormat
.
setRoundingMode
(
RoundingMode
.
HALF_UP
);
...
@@ -31,7 +33,7 @@ public class ExcelUtil {
...
@@ -31,7 +33,7 @@ public class ExcelUtil {
cellValue
=
xssfCell
.
getStringCellValue
();
cellValue
=
xssfCell
.
getStringCellValue
();
}
else
if
(
CellType
.
NUMERIC
.
equals
(
cellType
))
{
}
else
if
(
CellType
.
NUMERIC
.
equals
(
cellType
))
{
double
d
=
xssfCell
.
getNumericCellValue
();
double
d
=
xssfCell
.
getNumericCellValue
();
cellValue
=
String
.
valueOf
(
numberFormat
.
format
(
d
)
);
cellValue
=
df
.
format
(
d
);
}
else
if
(
CellType
.
BOOLEAN
.
equals
(
cellType
))
{
}
else
if
(
CellType
.
BOOLEAN
.
equals
(
cellType
))
{
cellValue
=
String
.
valueOf
(
xssfCell
.
getBooleanCellValue
());
cellValue
=
String
.
valueOf
(
xssfCell
.
getBooleanCellValue
());
}
else
if
(
CellType
.
FORMULA
.
equals
(
cellType
))
{
}
else
if
(
CellType
.
FORMULA
.
equals
(
cellType
))
{
...
...
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