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
6a0b80a3
Commit
6a0b80a3
authored
Sep 23, 2020
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增数据未和历史数据连接在一起
parent
4d39a83c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
17 deletions
+23
-17
performance/Performance.Services/DFExtractService.cs
+23
-17
No files found.
performance/Performance.Services/DFExtractService.cs
View file @
6a0b80a3
...
...
@@ -1377,9 +1377,9 @@ private void SupplySpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<e
var
dictionary
=
new
Dictionary
<
string
,
Func
<
ex_special
,
List
<
im_specialunit
>,
object
>>
{
{
"科室"
,
(
special
,
lastallot
)
=>
special
.
Department
},
{
"科室"
,
(
special
,
lastallot
)
=>
special
.
Department
?.
Trim
()
},
{
"人数"
,
(
special
,
lastallot
)
=>
lastallot
.
Where
(
t
=>
special
.
Department
==
t
.
Department
).
Max
(
t
=>
t
.
Number
)
},
{
"量化指标"
,
(
special
,
lastallot
)
=>
special
.
Target
},
{
"量化指标"
,
(
special
,
lastallot
)
=>
special
.
Target
?.
Trim
()
},
{
"量化指标绩效分值"
,(
special
,
lastallot
)
=>
special
.
TargetFactor
},
{
"调节系数"
,
(
special
,
lastallot
)
=>
special
.
AdjustFactor
},
};
...
...
@@ -1412,6 +1412,7 @@ private void SupplySpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<e
merges
=
merges
.
OrderBy
(
t
=>
t
.
FirstRow
).
ToList
();
int
startRowIndex
=
sheetRead
.
Point
.
DataFirstRowNum
??
2
;
int
lastrownumber
=
startRowIndex
;
foreach
(
var
merge
in
merges
)
{
var
deptSpecials
=
speaialList
.
Where
(
t
=>
t
.
Department
==
merge
.
Value
)?.
ToList
();
...
...
@@ -1420,7 +1421,7 @@ private void SupplySpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<e
for
(
int
i
=
merge
.
FirstRow
;
i
<
merge
.
LastRow
+
1
;
i
++)
{
var
row
=
GetOrCreate
(
sheet
,
i
);
string
target
=
NopiSevice
.
GetValue
(
GetOrCreate
(
row
,
headerDict
[
"量化指标"
]));
string
target
=
NopiSevice
.
GetValue
(
GetOrCreate
(
row
,
headerDict
[
"量化指标"
]))
?.
Trim
()
;
var
config
=
deptSpecials
.
FirstOrDefault
(
t
=>
t
.
Target
==
target
);
if
(
config
!=
null
)
...
...
@@ -1457,16 +1458,16 @@ private void SupplySpecialUnit(ISheet sheet, IPerSheetDataRead sheetRead, List<e
speaialList
.
RemoveAll
(
t
=>
t
.
Department
==
merge
.
Value
);
}
if
(
speaialList
!=
null
&&
speaialList
.
Any
())
{
var
index
=
sheet
.
LastRowNum
+
1
;
foreach
(
var
item
in
speaialList
)
{
var
newrow
=
sheet
.
CreateRow
(
index
);
newrow
.
CreateCell
(
0
).
SetCellValue
(
""
);
index
++;
}
}
//
if (speaialList != null && speaialList.Any())
//
{
//
var index = sheet.LastRowNum + 1;
//
foreach (var item in speaialList)
//
{
//
var newrow = sheet.CreateRow(index);
//
newrow.CreateCell(0).SetCellValue("");
//
index++;
//
}
//
}
//取消合并单元格
int
mergedCount
=
sheet
.
NumMergedRegions
;
...
...
@@ -1536,7 +1537,7 @@ private void WriteSpecialCellValue(Dictionary<string, Func<ex_special, List<im_s
if
(
firstrow
!=
null
&&
firstrow
.
GetCell
(
range
.
FirstColumn
)
is
ICell
firstcell
&&
firstcell
!=
null
)
{
firstcell
.
SetCellType
(
CellType
.
String
);
value
=
firstcell
.
StringCellValue
;
value
=
firstcell
.
StringCellValue
?.
Trim
()
;
}
merge
.
Value
=
value
;
merges
.
Add
(
merge
);
...
...
@@ -1554,7 +1555,7 @@ private void WriteSpecialCellValue(Dictionary<string, Func<ex_special, List<im_s
if
(
firstrow
!=
null
&&
firstrow
.
GetCell
(
merges
.
First
().
FirstColumn
)
is
ICell
firstcell
&&
firstcell
!=
null
)
{
firstcell
.
SetCellType
(
CellType
.
String
);
value
=
firstcell
.
StringCellValue
;
value
=
firstcell
.
StringCellValue
?.
Trim
()
;
}
merges
.
Add
(
new
CellRangeAddressAndValue
(
i
,
i
,
merges
.
First
().
FirstColumn
,
merges
.
First
().
LastColumn
,
value
,
false
));
}
...
...
@@ -1640,6 +1641,7 @@ private void WriteSheetData(ISheet sheet, IPerSheetDataRead sheetRead, List<NewE
var
head
=
GetOrCreate
(
sheet
,
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
);
var
rowIndex
=
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
1
;
int
lastrownumber
=
rowIndex
;
if
(!
isNewTemp
&&
!
isIncom
)
{
#
region
给历史模板已有科室补充数据
...
...
@@ -1651,6 +1653,7 @@ private void WriteSheetData(ISheet sheet, IPerSheetDataRead sheetRead, List<NewE
var
department
=
row
.
GetCell
(
6
)?.
ToString
();
// 科室名称
if
(
string
.
IsNullOrEmpty
(
department
))
continue
;
lastrownumber
=
rowIndex
;
var
deptData
=
allExtract
.
Where
(
t
=>
t
.
Department
==
department
);
if
(
deptData
==
null
||
!
deptData
.
Any
())
continue
;
...
...
@@ -1684,7 +1687,7 @@ private void WriteSheetData(ISheet sheet, IPerSheetDataRead sheetRead, List<NewE
if
(
allExtract
==
null
||
!
allExtract
.
Any
())
return
;
#
region
补充新的科室及数据
var
lastrowIndex
=
(
isNewTemp
||
isIncom
)
?
rowIndex
:
sheet
.
LastRowNum
+
1
;
var
lastrowIndex
=
(
isNewTemp
||
isIncom
)
?
rowIndex
:
lastrownumber
+
1
;
foreach
(
var
department
in
allExtract
.
Select
(
t
=>
t
.
Department
).
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
)).
Distinct
())
{
var
row
=
GetOrCreate
(
sheet
,
lastrowIndex
);
...
...
@@ -1806,6 +1809,8 @@ private void WriteWorkData(ISheet sheet, IPerSheetDataRead sheetRead, List<NewEx
{
var
head
=
GetOrCreate
(
sheet
,
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
0
);
var
rowIndex
=
sheetRead
.
Point
.
HeaderFirstRowNum
.
Value
+
2
;
int
lastrownumber
=
rowIndex
;
if
(!
isNewTemp
)
{
#
region
给历史模板已有科室补充数据
...
...
@@ -1817,6 +1822,7 @@ private void WriteWorkData(ISheet sheet, IPerSheetDataRead sheetRead, List<NewEx
var
department
=
row
.
GetCell
(
2
)?.
ToString
();
// 科室名称
if
(
string
.
IsNullOrEmpty
(
department
))
continue
;
lastrownumber
++;
var
deptData
=
allExtract
.
Where
(
t
=>
t
.
Department
==
department
);
if
(
deptData
==
null
||
!
deptData
.
Any
())
continue
;
...
...
@@ -1846,7 +1852,7 @@ private void WriteWorkData(ISheet sheet, IPerSheetDataRead sheetRead, List<NewEx
//var unit = sheet.SheetName.IndexOf("医生") > -1 ? new int[] { (int)UnitType.医生组, (int)UnitType.医技组 } : new int[] { (int)UnitType.护理组 };
#
region
补充新的科室及数据
var
lastrowIndex
=
isNewTemp
?
rowIndex
:
sheet
.
LastRowNum
+
1
;
var
lastrowIndex
=
isNewTemp
?
rowIndex
:
lastrownumber
+
1
;
foreach
(
var
department
in
allExtract
.
Select
(
t
=>
t
.
Department
).
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
)).
Distinct
())
{
var
row
=
sheet
.
CreateRow
(
lastrowIndex
);
...
...
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