Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
13d40beb
Commit
13d40beb
authored
Feb 15, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
f803f268
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
10 deletions
+25
-10
performance/Performance.Services/OnlineExcel/Model/ExcelSheetInfo.cs
+7
-1
performance/Performance.Services/OnlineExcel/OnlineExcelService.Read.cs
+18
-9
No files found.
performance/Performance.Services/OnlineExcel/Model/ExcelSheetInfo.cs
View file @
13d40beb
namespace
Performance.Services.OnlineExcel
using
Performance.DtoModels
;
namespace
Performance.Services.OnlineExcel
{
{
public
partial
class
OnlineExcelService
public
partial
class
OnlineExcelService
{
{
...
@@ -19,6 +21,9 @@ public string Message
...
@@ -19,6 +21,9 @@ public string Message
return
""
;
return
""
;
}
}
}
}
public
SheetType
SheetType
{
get
;
internal
set
;
}
public
string
ModuleName
{
get
;
internal
set
;
}
}
}
}
}
}
}
\ No newline at end of file
performance/Performance.Services/OnlineExcel/OnlineExcelService.Read.cs
View file @
13d40beb
...
@@ -35,10 +35,14 @@ public partial class OnlineExcelService : IAutoInjection
...
@@ -35,10 +35,14 @@ public partial class OnlineExcelService : IAutoInjection
public
static
TimeSpan
absoluteExpirationRelativeToNow
=
new
TimeSpan
(
0
,
5
,
0
);
public
static
TimeSpan
absoluteExpirationRelativeToNow
=
new
TimeSpan
(
0
,
5
,
0
);
private
readonly
IMemoryCache
_cache
;
private
readonly
IMemoryCache
_cache
;
private
readonly
PerSheetService
_sheetService
;
public
OnlineExcelService
(
IMemoryCache
cache
)
public
OnlineExcelService
(
IMemoryCache
cache
,
PerSheetService
sheetService
)
{
{
_cache
=
cache
;
_cache
=
cache
;
_sheetService
=
sheetService
;
}
}
/// <summary>
/// <summary>
/// 读取Sheet名称
/// 读取Sheet名称
...
@@ -61,13 +65,20 @@ public List<ExcelSheetInfo> GetExcelSheetName(per_allot allot)
...
@@ -61,13 +65,20 @@ public List<ExcelSheetInfo> GetExcelSheetName(per_allot allot)
{
{
foreach
(
var
sheet
in
package
.
Workbook
.
Worksheets
)
foreach
(
var
sheet
in
package
.
Workbook
.
Worksheets
)
{
{
sheetNames
.
Add
(
new
ExcelSheetInfo
SheetType
sheetType
=
_sheetService
.
GetSheetType
(
sheet
.
Name
);
if
(!
sheetNames
.
Exists
(
w
=>
w
.
Name
==
sheet
.
Name
))
{
{
Name
=
sheet
.
Name
,
sheetNames
.
Add
(
new
ExcelSheetInfo
Row
=
sheet
.
Dimension
.
End
.
Row
,
{
Column
=
sheet
.
Dimension
.
End
.
Column
,
Name
=
sheet
.
Name
,
Version
=
version
.
ToString
(),
Row
=
sheet
.
Dimension
.
End
.
Row
,
});
Column
=
sheet
.
Dimension
.
End
.
Column
,
SheetType
=
sheetType
,
ModuleName
=
EnumHelper
.
GetDescription
(
sheetType
),
Version
=
version
.
ToString
(),
});
}
}
}
}
}
_cache
.
Set
(
key
,
sheetNames
,
absoluteExpirationRelativeToNow
);
_cache
.
Set
(
key
,
sheetNames
,
absoluteExpirationRelativeToNow
);
...
@@ -135,8 +146,6 @@ public EpSheet ReadSheet(per_allot allot, string sheetName)
...
@@ -135,8 +146,6 @@ public EpSheet ReadSheet(per_allot allot, string sheetName)
return
epSheet
;
return
epSheet
;
}
}
package
.
Save
();
}
}
return
null
;
return
null
;
}
}
...
...
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