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
52915361
Commit
52915361
authored
Jul 01, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自定义抽取添加列头写入
parent
8939901e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
performance/Performance.Services/ExtractExcelService/SheetDataWrite/CustomDataWrite.cs
+17
-0
No files found.
performance/Performance.Services/ExtractExcelService/SheetDataWrite/CustomDataWrite.cs
View file @
52915361
...
...
@@ -34,6 +34,8 @@ CustomExtractService customExtractService
public
PerSheetPoint
Point
=>
new
PerSheetPoint
{
HeaderFirstRowNum
=
1
,
HeaderFirstCellNum
=
6
,
DataFirstRowNum
=
2
,
DataFirstCellNum
=
6
,
};
...
...
@@ -50,6 +52,7 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
if
(
configs
==
null
||
!
configs
.
Any
())
throw
new
Exception
(
"医院未配置绩效抽取信息"
);
var
parameters
=
customExtractService
.
GetParameters
(
allot
);
var
headerStyle
=
style
.
SetBgkColorAndFormat
(
style
.
GetCellStyle
(),
StyleType
.
列头
);
var
cellStyle
=
style
.
SetBgkColorAndFormat
(
style
.
GetCellStyle
(),
StyleType
.
数据
);
foreach
(
var
module
in
modules
)
...
...
@@ -76,6 +79,20 @@ public void WriteDataToCustom(IWorkbook workbook, per_allot allot, ExcelStyle st
if
(
dynamics
==
null
||
dynamics
.
Count
()
==
0
)
continue
;
var
first
=
(
IDictionary
<
string
,
object
>)
dynamics
.
ElementAt
(
0
);
var
header
=
sheet
.
GetOrCreate
(
Point
.
HeaderFirstRowNum
.
Value
);
if
(
header
!=
null
)
{
var
cellindex
=
Point
.
HeaderFirstCellNum
.
Value
;
foreach
(
var
item
in
first
)
{
var
cell
=
header
.
GetOrCreate
(
cellindex
);
cell
.
SetCellOValue
(
item
.
Key
);
cell
.
CellStyle
=
headerStyle
;
cellindex
++;
}
}
var
rowindex
=
Point
.
DataFirstRowNum
.
Value
;
for
(
int
r
=
0
;
r
<
dynamics
.
Count
();
r
++)
{
...
...
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