Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
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
bltdc
DataCenter_Core2.1_20190520
Commits
512e36b5
Commit
512e36b5
authored
Aug 11, 2021
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整excel字段解析方法,优化解析速度
parent
41e1b1a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
NpolHelper.cs
Bailun.DC.Web/Base/NpolHelper.cs
+19
-10
No files found.
Bailun.DC.Web/Base/NpolHelper.cs
View file @
512e36b5
...
@@ -191,21 +191,15 @@ namespace Bailun.DC.Web.Base
...
@@ -191,21 +191,15 @@ namespace Bailun.DC.Web.Base
return
string
.
Empty
;
return
string
.
Empty
;
switch
(
cell
.
CellType
)
switch
(
cell
.
CellType
)
{
{
case
CellType
.
String
:
return
cell
.
StringCellValue
;
case
CellType
.
Blank
:
case
CellType
.
Blank
:
return
string
.
Empty
;
return
string
.
Empty
;
case
CellType
.
Boolean
:
return
cell
.
BooleanCellValue
.
ToString
();
case
CellType
.
Error
:
return
cell
.
ErrorCellValue
.
ToString
();
case
CellType
.
Numeric
:
case
CellType
.
Numeric
:
short
format
=
cell
.
CellStyle
.
DataFormat
;
short
format
=
cell
.
CellStyle
.
DataFormat
;
if
(
format
==
14
||
format
==
31
||
format
==
57
||
format
==
58
||
HSSFDateUtil
.
IsCellDateFormatted
(
cell
))
return
cell
.
DateCellValue
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
if
(
format
==
14
||
format
==
31
||
format
==
57
||
format
==
58
||
HSSFDateUtil
.
IsCellDateFormatted
(
cell
))
return
cell
.
DateCellValue
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
return
cell
.
NumericCellValue
.
ToString
();
return
cell
.
NumericCellValue
.
ToString
();
case
CellType
.
Unknown
:
default
:
return
cell
.
ToString
();
case
CellType
.
String
:
return
cell
.
StringCellValue
;
case
CellType
.
Formula
:
case
CellType
.
Formula
:
try
try
{
{
...
@@ -215,8 +209,23 @@ namespace Bailun.DC.Web.Base
...
@@ -215,8 +209,23 @@ namespace Bailun.DC.Web.Base
}
}
catch
catch
{
{
return
cell
.
NumericCellValue
.
ToString
();
try
{
return
cell
.
NumericCellValue
.
ToString
();
}
catch
(
Exception
ex
)
{
return
"0"
;
}
}
}
case
CellType
.
Boolean
:
return
cell
.
BooleanCellValue
.
ToString
();
case
CellType
.
Error
:
return
cell
.
ErrorCellValue
.
ToString
();
case
CellType
.
Unknown
:
default
:
return
cell
.
ToString
();
}
}
}
}
...
...
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