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
5de67c14
Commit
5de67c14
authored
Apr 22, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抽取修改
parent
3a4266e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
performance/Performance.Services/DFExtractService.cs
+11
-11
No files found.
performance/Performance.Services/DFExtractService.cs
View file @
5de67c14
...
...
@@ -577,7 +577,7 @@ private void WriteSpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<sy
var
dictionary
=
new
Dictionary
<
string
,
Func
<
mod_special
,
List
<
im_specialunit
>,
object
>>
{
{
"科室"
,
(
special
,
lastallot
)
=>
special
.
Department
},
{
"人数"
,
(
special
,
lastallot
)
=>
lastallot
.
Where
(
t
=>
special
.
Department
==
t
.
Department
).
Sum
(
t
=>
t
.
Number
)
},
{
"人数"
,
(
special
,
lastallot
)
=>
lastallot
.
Where
(
t
=>
special
.
Department
==
t
.
Department
).
Max
(
t
=>
t
.
Number
)
},
{
"量化指标"
,
(
special
,
lastallot
)
=>
special
.
Target
},
{
"量化指标绩效分值"
,(
special
,
lastallot
)
=>
special
.
TargetFactor
},
{
"调节系数"
,
(
special
,
lastallot
)
=>
special
.
AdjustFactor
},
...
...
@@ -725,7 +725,7 @@ private void WriteHeaderAndFactor(ISheet sheet, IPerSheetDataRead sheetRead, Lis
if
(
cellItems
==
null
||
!
cellItems
.
Any
())
return
;
#
region
新增模板中不存在的列头
var
lastcellIndex
=
head
.
LastCellNum
;
var
lastcellIndex
=
isNewTemp
?
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
4
:
head
.
LastCellNum
;
foreach
(
var
item
in
cellItems
)
{
var
headcell
=
GetOrCreate
(
head
,
lastcellIndex
);
...
...
@@ -774,13 +774,13 @@ private void WriteSheetData(ISheet sheet, IPerSheetDataRead sheetRead, List<Acco
var
row
=
sheet
.
GetRow
(
i
);
if
(
row
!=
null
)
{
var
department
=
row
.
GetCell
(
3
)?.
ToString
();
var
department
=
row
.
GetCell
(
3
)?.
ToString
();
// 科室名称
if
(
string
.
IsNullOrEmpty
(
department
))
continue
;
var
deptData
=
allExtract
.
Where
(
t
=>
t
.
Department
==
department
);
if
(
deptData
==
null
||
!
deptData
.
Any
())
continue
;
for
(
int
j
=
rowIndex
;
j
<
head
.
LastCellNum
;
j
++)
for
(
int
j
=
4
;
j
<
head
.
LastCellNum
;
j
++)
{
var
headName
=
head
.
GetCell
(
j
).
StringCellValue
;
var
newCell
=
GetOrCreate
(
row
,
j
);
...
...
@@ -810,7 +810,7 @@ private void WriteSheetData(ISheet sheet, IPerSheetDataRead sheetRead, List<Acco
if
(
allExtract
==
null
||
!
allExtract
.
Any
())
return
;
#
region
补充新的科室及数据
var
lastrowIndex
=
sheet
.
LastRowNum
+
1
;
var
lastrowIndex
=
isNewTemp
?
rowIndex
:
sheet
.
LastRowNum
+
1
;
foreach
(
var
department
in
allExtract
.
Select
(
t
=>
t
.
Department
).
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
)).
Distinct
())
{
var
row
=
sheet
.
CreateRow
(
lastrowIndex
);
...
...
@@ -880,7 +880,7 @@ private void WriteWorkHeader(ISheet sheet, IPerSheetDataRead sheetRead, List<mod
{
#
region
过滤历史模板中已有的列头
//写入列头信息
int
cellStartIndex
=
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
4
;
int
cellStartIndex
=
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
2
;
for
(
int
i
=
cellStartIndex
;
i
<
head
.
LastCellNum
;
i
++)
{
var
cellvalue
=
head
.
GetCell
(
i
)?.
ToString
();
...
...
@@ -893,7 +893,7 @@ private void WriteWorkHeader(ISheet sheet, IPerSheetDataRead sheetRead, List<mod
if
(
cellItems
==
null
||
!
cellItems
.
Any
())
return
;
#
region
新增模板中不存在的列头
var
lastcellIndex
=
head
.
LastCellNum
;
var
lastcellIndex
=
isNewTemp
?
sheetRead
.
Point
.
HeaderFirstCellNum
.
Value
+
2
:
head
.
LastCellNum
;
foreach
(
var
item
in
cellItems
)
{
var
headcell
=
GetOrCreate
(
head
,
lastcellIndex
);
...
...
@@ -930,13 +930,13 @@ private void WriteWorkData(ISheet sheet, IPerSheetDataRead sheetRead, List<Accou
var
row
=
sheet
.
GetRow
(
i
);
if
(
row
!=
null
)
{
var
department
=
row
.
GetCell
(
1
)?.
ToString
();
var
department
=
row
.
GetCell
(
1
)?.
ToString
();
// 科室名称
if
(
string
.
IsNullOrEmpty
(
department
))
continue
;
var
deptData
=
allExtract
.
Where
(
t
=>
t
.
Department
==
department
);
if
(
deptData
==
null
||
!
deptData
.
Any
())
continue
;
for
(
int
j
=
rowIndex
;
j
<
head
.
LastCellNum
;
j
++)
for
(
int
j
=
2
;
j
<
head
.
LastCellNum
;
j
++)
{
var
headName
=
head
.
GetCell
(
j
).
StringCellValue
;
var
newCell
=
GetOrCreate
(
row
,
j
);
...
...
@@ -960,7 +960,7 @@ private void WriteWorkData(ISheet sheet, IPerSheetDataRead sheetRead, List<Accou
if
(
allExtract
==
null
||
!
allExtract
.
Any
())
return
;
#
region
补充新的科室及数据
var
lastrowIndex
=
sheet
.
LastRowNum
+
1
;
var
lastrowIndex
=
isNewTemp
?
rowIndex
:
sheet
.
LastRowNum
+
1
;
foreach
(
var
department
in
allExtract
.
Select
(
t
=>
t
.
Department
).
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
)).
Distinct
())
{
var
row
=
sheet
.
CreateRow
(
lastrowIndex
);
...
...
@@ -1136,7 +1136,7 @@ public void OutToExcelCell(ICell cell, object obj)
string
value
=
obj
?.
ToString
()
??
""
;
try
{
var
type
=
obj
.
GetType
(
);
var
type
=
obj
?.
GetType
()
??
typeof
(
string
);
switch
(
type
.
ToString
())
{
case
"System.String"
:
//字符串类型
...
...
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