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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
performance/Performance.Services/OnlineExcel/Model/ExcelSheetInfo.cs
+7
-1
performance/Performance.Services/OnlineExcel/OnlineExcelService.Read.cs
+12
-3
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
{
...
...
@@ -19,6 +21,9 @@ public string Message
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
public
static
TimeSpan
absoluteExpirationRelativeToNow
=
new
TimeSpan
(
0
,
5
,
0
);
private
readonly
IMemoryCache
_cache
;
private
readonly
PerSheetService
_sheetService
;
public
OnlineExcelService
(
IMemoryCache
cache
)
public
OnlineExcelService
(
IMemoryCache
cache
,
PerSheetService
sheetService
)
{
_cache
=
cache
;
_sheetService
=
sheetService
;
}
/// <summary>
/// 读取Sheet名称
...
...
@@ -61,15 +65,22 @@ public List<ExcelSheetInfo> GetExcelSheetName(per_allot allot)
{
foreach
(
var
sheet
in
package
.
Workbook
.
Worksheets
)
{
SheetType
sheetType
=
_sheetService
.
GetSheetType
(
sheet
.
Name
);
if
(!
sheetNames
.
Exists
(
w
=>
w
.
Name
==
sheet
.
Name
))
{
sheetNames
.
Add
(
new
ExcelSheetInfo
{
Name
=
sheet
.
Name
,
Row
=
sheet
.
Dimension
.
End
.
Row
,
Column
=
sheet
.
Dimension
.
End
.
Column
,
SheetType
=
sheetType
,
ModuleName
=
EnumHelper
.
GetDescription
(
sheetType
),
Version
=
version
.
ToString
(),
});
}
}
}
_cache
.
Set
(
key
,
sheetNames
,
absoluteExpirationRelativeToNow
);
return
sheetNames
;
...
...
@@ -135,8 +146,6 @@ public EpSheet ReadSheet(per_allot allot, string sheetName)
return
epSheet
;
}
package
.
Save
();
}
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