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
cfc49e03
Commit
cfc49e03
authored
Aug 19, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
特殊科室读取数据、核算
parent
db51957b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
13 deletions
+62
-13
performance/Performance.Services/AllotCompute/ResultComputeService.cs
+5
-5
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadSpecialUnit.cs
+57
-8
No files found.
performance/Performance.Services/AllotCompute/ResultComputeService.cs
View file @
cfc49e03
...
...
@@ -121,11 +121,11 @@ public void SpecialUnitCompute(PerExcel excel, per_allot allot, List<res_baiscno
var
groupSpeList
=
dataList
.
GroupBy
(
t
=>
t
.
AccountingUnit
).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
,
Number
=
t
.
Sum
(
p
=>
p
.
Number
),
ScoringAverage
=
t
.
Sum
(
p
=>
p
.
ScoringAverage
),
OtherPerfor
=
t
.
Sum
(
p
=>
p
.
OtherPerfor
),
Punishment
=
t
.
Sum
(
p
=>
p
.
Punishment
),
Adjust
=
t
.
Sum
(
p
=>
p
.
Adjust
),
Number
=
t
.
Max
(
p
=>
p
.
Number
),
ScoringAverage
=
t
.
Max
(
p
=>
p
.
ScoringAverage
),
OtherPerfor
=
t
.
Max
(
p
=>
p
.
OtherPerfor
),
Punishment
=
t
.
Max
(
p
=>
p
.
Punishment
),
Adjust
=
t
.
Max
(
p
=>
p
.
Adjust
),
});
foreach
(
var
group
in
groupSpeList
)
...
...
performance/Performance.Services/PerExcelService/SheetDataRead/PerSheetDataReadSpecialUnit.cs
View file @
cfc49e03
using
NPOI.SS.UserModel
;
using
NPOI.SS.Util
;
using
Performance.DtoModels
;
using
Performance.Infrastructure
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -28,27 +30,37 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
var
row
=
sheet
.
GetRow
(
r
);
if
(
row
==
null
)
continue
;
var
accountingUnit
=
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"科室"
).
PointCell
)?.
ToString
();
if
(
string
.
IsNullOrEmpty
(
accountingUnit
))
accountingUnit
=
lastAccount
;
PerDataSpecialUnit
specialUnit
=
new
PerDataSpecialUnit
{
RowNumber
=
r
,
AccountingUnit
=
accountingUnit
,
Department
=
accountingUnit
,
//
AccountingUnit = accountingUnit,
//
Department = accountingUnit,
QuantitativeIndicators
=
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"量化指标"
).
PointCell
)?.
ToString
(),
Quantity
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"数量"
).
PointCell
)?.
ToString
()),
QuantitativeIndicatorsValue
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"量化指标绩效分值"
).
PointCell
)?.
ToString
()),
};
//相同科室只取以下项目第一次出现的值
if
(
accountingUnit
!=
lastAccount
)
var
cell
=
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"科室"
).
PointCell
);
//?.ToString();
var
accountingUnit
=
cell
?.
ToString
();
if
(
cell
!=
null
&&
IsMergeCell
(
cell
,
out
Point
start
,
out
Point
end
)
&&
r
!=
start
.
X
)
{
row
=
sheet
.
GetRow
(
start
.
X
);
cell
=
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"科室"
).
PointCell
);
accountingUnit
=
cell
.
ToString
();
}
if
(
string
.
IsNullOrEmpty
(
accountingUnit
))
accountingUnit
=
lastAccount
;
//相同科室只取以下项目第一次出现的值
//if (accountingUnit != lastAccount)
//{
specialUnit
.
AccountingUnit
=
accountingUnit
;
specialUnit
.
Department
=
accountingUnit
;
specialUnit
.
Number
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"人数"
).
PointCell
)?.
ToString
());
specialUnit
.
ScoringAverage
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"考核得分率"
).
PointCell
)?.
ToString
());
specialUnit
.
OtherPerfor
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"其他绩效"
).
PointCell
)?.
ToString
());
specialUnit
.
Punishment
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"医院奖罚"
).
PointCell
)?.
ToString
());
specialUnit
.
Adjust
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"调节系数"
).
PointCell
)?.
ToString
());
}
//
}
if
(!
string
.
IsNullOrEmpty
(
specialUnit
.
QuantitativeIndicators
)
&&
specialUnit
.
QuantitativeIndicatorsValue
!=
null
)
dataList
.
Add
(
specialUnit
);
//合并单元格科室名称补全
...
...
@@ -57,5 +69,42 @@ public List<IPerData> ReadData(ISheet sheet, List<PerHeader> perHeader)
return
dataList
;
}
public
static
bool
IsMergeCell
(
ICell
cell
,
out
Point
start
,
out
Point
end
)
{
return
IsMergeCell
(
cell
.
Sheet
,
cell
.
RowIndex
,
cell
.
ColumnIndex
,
out
start
,
out
end
);
}
/// <summary>
/// 获取当前单元格所在的合并单元格的位置
/// </summary>
/// <param name="sheet">sheet表单</param>
/// <param name="rowIndex">行索引 0开始</param>
/// <param name="colIndex">列索引 0开始</param>
/// <param name="start">合并单元格左上角坐标</param>
/// <param name="end">合并单元格右下角坐标</param>
/// <returns>返回false表示非合并单元格</returns>
private
static
bool
IsMergeCell
(
ISheet
sheet
,
int
rowIndex
,
int
colIndex
,
out
Point
start
,
out
Point
end
)
{
bool
result
=
false
;
start
=
new
Point
(
0
,
0
);
end
=
new
Point
(
0
,
0
);
if
((
rowIndex
<
0
)
||
(
colIndex
<
0
))
return
result
;
int
regionsCount
=
sheet
.
NumMergedRegions
;
for
(
int
i
=
0
;
i
<
regionsCount
;
i
++)
{
CellRangeAddress
range
=
sheet
.
GetMergedRegion
(
i
);
//sheet.IsMergedRegion(range);
if
(
rowIndex
>=
range
.
FirstRow
&&
rowIndex
<=
range
.
LastRow
&&
colIndex
>=
range
.
FirstColumn
&&
colIndex
<=
range
.
LastColumn
)
{
start
=
new
Point
(
range
.
FirstRow
,
range
.
FirstColumn
);
end
=
new
Point
(
range
.
LastRow
,
range
.
LastColumn
);
result
=
true
;
break
;
}
}
return
result
;
}
}
}
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