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
fa80f4ee
Commit
fa80f4ee
authored
Apr 02, 2019
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绩效初次计算完成
parent
96cec430
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
591 additions
and
30 deletions
+591
-30
performance/Performance.Api/Controllers/AgainAllotController.cs
+8
-18
performance/Performance.DtoModels/PerExcelAgain/PerAgainData.cs
+70
-0
performance/Performance.DtoModels/PerExcelAgain/PerAgainEmployee.cs
+80
-0
performance/Performance.DtoModels/PerExcelAgain/PerAgainExcel.cs
+13
-0
performance/Performance.DtoModels/PerExcelAgain/PerAgainSituation.cs
+64
-0
performance/Performance.DtoModels/Performance.DtoModels.csproj
+1
-0
performance/Performance.DtoModels/Request/AgainAllotRequest.cs
+1
-1
performance/Performance.DtoModels/Response/SheetExportResponse.cs
+29
-3
performance/Performance.DtoModels/Response/UserIdentity.cs
+10
-0
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+8
-0
performance/Performance.Services/AgainAllot/AgainService.cs
+129
-0
performance/Performance.Services/AgainAllotService.cs
+178
-8
No files found.
performance/Performance.Api/Controllers/AgainAllotController.cs
View file @
fa80f4ee
...
@@ -27,24 +27,16 @@ namespace Performance.Api.Controllers
...
@@ -27,24 +27,16 @@ namespace Performance.Api.Controllers
public
class
AgainAllotController
:
Controller
public
class
AgainAllotController
:
Controller
{
{
private
AgainAllotService
againAllotService
;
private
AgainAllotService
againAllotService
;
public
AgainAllotController
(
AgainAllotService
againAllotService
)
private
ClaimService
claimService
;
public
AgainAllotController
(
AgainAllotService
againAllotService
,
ClaimService
claimService
)
{
{
this
.
againAllotService
=
againAllotService
;
this
.
againAllotService
=
againAllotService
;
this
.
claimService
=
claimService
;
}
}
/// <summary>
/// <summary>
/// 返回二次分配绩效列表
/// 返回当前用户医院下绩效列表
/// </summary>
/// <returns></returns>
[
Route
(
"list"
)]
[
HttpPost
]
public
ApiResponse
List
()
{
throw
new
NotImplementedException
();
}
/// <summary>
/// 返回当前用户医院下绩效下拉列表
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
Route
(
"allotlist"
)]
[
Route
(
"allotlist"
)]
...
@@ -70,11 +62,9 @@ public ApiResponse Import([FromForm] IFormCollection form)
...
@@ -70,11 +62,9 @@ public ApiResponse Import([FromForm] IFormCollection form)
[
HttpPost
]
[
HttpPost
]
public
ApiResponse
Generate
([
CustomizeValidator
(
RuleSet
=
"Generate"
),
FromBody
]
AgainAllotRequest
request
)
public
ApiResponse
Generate
([
CustomizeValidator
(
RuleSet
=
"Generate"
),
FromBody
]
AgainAllotRequest
request
)
{
{
var
user
=
claimService
.
At
(
request
);
againAllotService
.
Generate
(
request
);
var
result
=
againAllotService
.
Generate
(
request
,
user
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
throw
new
NotImplementedException
();
}
}
}
}
}
}
performance/Performance.DtoModels/PerExcelAgain/PerAgainData.cs
0 → 100644
View file @
fa80f4ee
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
PerAgainData
{
/// <summary>
/// 行号
/// </summary>
public
Nullable
<
int
>
RowNumber
{
get
;
set
;
}
/// <summary>
/// 列头类型名称
/// </summary>
public
string
TypeName
{
get
;
set
;
}
/// <summary>
/// 单元格value
/// </summary>
public
Nullable
<
decimal
>
CellValue
{
get
;
set
;
}
/// <summary>
/// 1 汇总 2原始数据
/// </summary>
public
Nullable
<
int
>
IsTotal
{
get
;
set
;
}
/// <summary>
/// 是否带入系数计算 1 带入 2 不带入
/// </summary>
public
Nullable
<
int
>
IsFactor
{
get
;
set
;
}
/// <summary>
/// 系数值
/// </summary>
public
Nullable
<
decimal
>
FactorValue
{
get
;
set
;
}
/// <summary>
/// 单元格注释
/// </summary>
public
string
Annotation
{
get
;
set
;
}
/// <summary>
/// 单元格备注
/// </summary>
public
string
Remark
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
SignID
{
get
;
set
;
}
public
PerAgainData
()
{
}
public
PerAgainData
(
int
rowNumber
,
string
typeName
,
decimal
?
cellValue
,
int
isTotal
,
int
isFactor
,
decimal
?
factorValue
,
string
annotation
,
string
remark
,
string
signID
)
{
this
.
RowNumber
=
rowNumber
;
this
.
TypeName
=
typeName
;
this
.
CellValue
=
cellValue
;
this
.
IsTotal
=
isTotal
;
this
.
IsFactor
=
isFactor
;
this
.
FactorValue
=
factorValue
;
this
.
Annotation
=
annotation
;
this
.
Remark
=
remark
;
this
.
SignID
=
signID
;
}
}
}
performance/Performance.DtoModels/PerExcelAgain/PerAgainEmployee.cs
0 → 100644
View file @
fa80f4ee
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
PerAgainEmployee
{
/// <summary>
/// 姓名
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 职务
/// </summary>
public
string
JobTitle
{
get
;
set
;
}
/// <summary>
/// 职称系数
/// </summary>
public
Nullable
<
decimal
>
JobFactor
{
get
;
set
;
}
/// <summary>
/// 出勤
/// </summary>
public
Nullable
<
decimal
>
Attendance
{
get
;
set
;
}
/// <summary>
/// 年资
/// </summary>
public
Nullable
<
decimal
>
YearFactor
{
get
;
set
;
}
/// <summary>
/// 重点奖励
/// </summary>
public
Nullable
<
decimal
>
Award
{
get
;
set
;
}
/// <summary>
/// 管理津贴
/// </summary>
public
Nullable
<
decimal
>
Allowance
{
get
;
set
;
}
/// <summary>
/// 单独核算人员绩效
/// </summary>
public
Nullable
<
decimal
>
AlonePerfor
{
get
;
set
;
}
/// <summary>
/// 夜班费
/// </summary>
public
Nullable
<
decimal
>
NightShift
{
get
;
set
;
}
/// <summary>
/// 职称出勤系数(需计算)
/// </summary>
public
Nullable
<
decimal
>
JobAttendanceFactor
{
get
;
set
;
}
/// <summary>
/// 年资出勤系数(需计算)
/// </summary>
public
Nullable
<
decimal
>
YearAttendanceFactor
{
get
;
set
;
}
/// <summary>
/// 职称出勤绩效(需计算)
/// </summary>
public
Nullable
<
decimal
>
JobAttendancePerfor
{
get
;
set
;
}
/// <summary>
/// 应发绩效(需计算)
/// </summary>
public
Nullable
<
decimal
>
GiveFee
{
get
;
set
;
}
/// <summary>
/// 实发绩效(需计算)
/// </summary>
public
Nullable
<
decimal
>
RealGiveFee
{
get
;
set
;
}
public
int
RowNumber
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/PerExcelAgain/PerAgainExcel.cs
0 → 100644
View file @
fa80f4ee
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
PerAgainExcel
{
public
PerHeader
Header
{
get
;
set
;
}
public
List
<
PerAgainData
>
AgainData
{
get
;
set
;
}
public
List
<
PerAgainEmployee
>
AgainEmployee
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/PerExcelAgain/PerAgainSituation.cs
0 → 100644
View file @
fa80f4ee
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Performance.DtoModels
{
public
class
PerAgainSituation
{
/// <summary>
/// 夜班费
/// </summary>
public
Nullable
<
decimal
>
NightShift
{
get
;
set
;
}
/// <summary>
/// 科室总绩效
/// </summary>
public
Nullable
<
decimal
>
DepartmentTotal
{
get
;
set
;
}
/// <summary>
/// 护士长或科主任基础绩效
/// </summary>
public
Nullable
<
decimal
>
BossPerfor
{
get
;
set
;
}
/// <summary>
/// 重点奖励
/// </summary>
public
Nullable
<
decimal
>
Award
{
get
;
set
;
}
/// <summary>
/// 管理津贴
/// </summary>
public
Nullable
<
decimal
>
Allowance
{
get
;
set
;
}
/// <summary>
/// 业绩分配绩效
/// </summary>
public
Nullable
<
decimal
>
AllotPerfor
{
get
;
set
;
}
/// <summary>
/// 职称绩效
/// </summary>
public
Nullable
<
decimal
>
JobPerfor
{
get
;
set
;
}
/// <summary>
/// 工作量绩效
/// </summary>
public
Nullable
<
decimal
>
WorkloadPerfor
{
get
;
set
;
}
/// <summary>
/// 单独核算人员绩效
/// </summary>
public
Nullable
<
decimal
>
AlonePerfor
{
get
;
set
;
}
/// <summary>
/// 出勤
/// </summary>
public
Nullable
<
decimal
>
Attendance
{
get
;
set
;
}
/// <summary>
/// 科室系数人均
/// </summary>
public
Nullable
<
decimal
>
DepartmentFactorAvg
{
get
;
set
;
}
}
}
performance/Performance.DtoModels/Performance.DtoModels.csproj
View file @
fa80f4ee
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
<ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Performance.EntityModels\Performance.EntityModels.csproj" />
<ProjectReference Include="..\Performance.EntityModels\Performance.EntityModels.csproj" />
<ProjectReference Include="..\Performance.Infrastructure\Performance.Infrastructure.csproj" />
</ItemGroup>
</ItemGroup>
</Project>
</Project>
performance/Performance.DtoModels/Request/AgainAllotRequest.cs
View file @
fa80f4ee
...
@@ -8,7 +8,7 @@ namespace Performance.DtoModels
...
@@ -8,7 +8,7 @@ namespace Performance.DtoModels
/// <summary>
/// <summary>
/// 二次分配请求
/// 二次分配请求
/// </summary>
/// </summary>
public
class
AgainAllotRequest
public
class
AgainAllotRequest
:
ApiRequest
{
{
/// <summary>
/// <summary>
/// 二次分配ID
/// 二次分配ID
...
...
performance/Performance.DtoModels/Response/SheetExportResponse.cs
View file @
fa80f4ee
using
System
;
using
Performance.Infrastructure
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Text
;
...
@@ -29,7 +30,17 @@ public class SheetExportResponse
...
@@ -29,7 +30,17 @@ public class SheetExportResponse
/// </summary>
/// </summary>
public
List
<
Row
>
Row
{
get
;
set
;
}
public
List
<
Row
>
Row
{
get
;
set
;
}
public
SheetExportResponse
()
{
}
public
SheetExportResponse
()
{
Header
=
new
List
<
Row
>();
Row
=
new
List
<
Row
>();
}
public
SheetExportResponse
(
string
sheetName
)
{
SheetName
=
sheetName
;
Header
=
new
List
<
Row
>();
Row
=
new
List
<
Row
>();
}
public
SheetExportResponse
(
int
sheetID
,
string
sheetName
,
int
sheetType
)
public
SheetExportResponse
(
int
sheetID
,
string
sheetName
,
int
sheetType
)
{
{
...
@@ -57,7 +68,22 @@ public Row(int rownumber)
...
@@ -57,7 +68,22 @@ public Row(int rownumber)
public
class
Cell
public
class
Cell
{
{
public
int
PointCell
{
get
;
set
;
}
public
int
PointCell
{
get
;
set
;
}
public
object
CellValue
{
get
;
set
;
}
private
object
cellValue
;
public
object
CellValue
{
get
{
var
value
=
ConvertHelper
.
To
<
decimal
?>(
cellValue
);
if
(
value
.
HasValue
&&
value
.
Value
>
0
)
return
Math
.
Round
(
value
.
Value
,
2
);
return
cellValue
;
}
set
{
cellValue
=
value
;
}
}
public
int
MergeRow
{
get
;
set
;
}
public
int
MergeRow
{
get
;
set
;
}
public
int
MergeCell
{
get
;
set
;
}
public
int
MergeCell
{
get
;
set
;
}
public
bool
IsTotal
{
get
;
set
;
}
public
bool
IsTotal
{
get
;
set
;
}
...
...
performance/Performance.DtoModels/Response/UserIdentity.cs
View file @
fa80f4ee
...
@@ -16,7 +16,17 @@ public class UserIdentity
...
@@ -16,7 +16,17 @@ public class UserIdentity
public
string
Mobile
{
get
;
set
;
}
public
string
Mobile
{
get
;
set
;
}
public
int
States
{
get
;
set
;
}
public
int
States
{
get
;
set
;
}
public
bool
IsHome
{
get
;
set
;
}
public
bool
IsHome
{
get
;
set
;
}
/// <summary>
/// 用户科室
/// </summary>
public
string
Department
{
get
;
set
;
}
public
List
<
HospitalResponse
>
Hospital
{
get
;
set
;
}
public
List
<
HospitalResponse
>
Hospital
{
get
;
set
;
}
public
List
<
RoleResponse
>
Role
{
get
;
set
;
}
public
List
<
RoleResponse
>
Role
{
get
;
set
;
}
public
UserIdentity
()
{
Hospital
=
new
List
<
HospitalResponse
>();
Role
=
new
List
<
RoleResponse
>();
}
}
}
}
}
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
fa80f4ee
...
@@ -12,6 +12,14 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
...
@@ -12,6 +12,14 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
{
{
}
}
/// <summary> 二次分配不固定数据 <summary>
public
virtual
DbSet
<
ag_data
>
ag_data
{
get
;
set
;
}
/// <summary> 二次分配人员名单 <summary>
public
virtual
DbSet
<
ag_employee
>
ag_employee
{
get
;
set
;
}
/// <summary> 二次分配不固定列头数据 <summary>
public
virtual
DbSet
<
ag_header
>
ag_header
{
get
;
set
;
}
/// <summary> <summary>
public
virtual
DbSet
<
cof_again
>
cof_again
{
get
;
set
;
}
/// <summary> 规模绩效、效率绩效计算系数配置 <summary>
/// <summary> 规模绩效、效率绩效计算系数配置 <summary>
public
virtual
DbSet
<
cof_director
>
cof_director
{
get
;
set
;
}
public
virtual
DbSet
<
cof_director
>
cof_director
{
get
;
set
;
}
/// <summary> 工作量门诊药占比系数 <summary>
/// <summary> 工作量门诊药占比系数 <summary>
...
...
performance/Performance.Services/AgainAllot/AgainService.cs
0 → 100644
View file @
fa80f4ee
using
NPOI.HSSF.UserModel
;
using
NPOI.SS.UserModel
;
using
NPOI.XSSF.UserModel
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
namespace
Performance.Services
{
public
class
AgainService
:
IAutoInjection
{
private
PerHeaderService
perHeaderService
;
private
int
DataFirstRowNum
=
4
;
//数据起始行
private
int
FactorRow
=
3
;
//系数行
public
AgainService
(
PerHeaderService
perHeaderService
)
{
this
.
perHeaderService
=
perHeaderService
;
}
/// <summary>
/// 导入excel数据
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public
PerAgainExcel
ReadData
(
per_againallot
again
)
{
using
(
FileStream
fs
=
new
FileStream
(
again
.
Path
,
FileMode
.
Open
))
{
var
excelVersion
=
FileHelper
.
GetExtension
(
again
.
Path
)
==
".xlsx"
?
ExcelVersion
.
xlsx
:
ExcelVersion
.
xls
;
IWorkbook
workbook
=
(
excelVersion
==
ExcelVersion
.
xlsx
)
?
(
IWorkbook
)(
new
XSSFWorkbook
(
fs
))
:
(
IWorkbook
)(
new
HSSFWorkbook
(
fs
));
for
(
int
i
=
0
;
i
<
workbook
.
NumberOfSheets
;
i
++)
{
var
sheet
=
workbook
.
GetSheetAt
(
i
);
if
(
sheet
.
SheetName
==
"二次分配表"
)
{
var
point
=
new
PerSheetPoint
{
DataFirstRowNum
=
2
,
HeaderFirstCellNum
=
0
,
HeaderFirstRowNum
=
1
,
HeaderLastRowNum
=
2
};
var
perHeader
=
perHeaderService
.
GetPerHeader
(
sheet
,
point
);
var
results
=
ReadData
(
sheet
,
perHeader
);
return
new
PerAgainExcel
{
Header
=
results
.
Header
,
AgainData
=
results
.
AgainData
,
AgainEmployee
=
results
.
AgainEmployee
};
}
}
}
return
null
;
}
private
(
PerHeader
Header
,
List
<
PerAgainData
>
AgainData
,
List
<
PerAgainEmployee
>
AgainEmployee
)
ReadData
(
ISheet
sheet
,
List
<
PerHeader
>
perHeader
)
{
List
<
PerAgainData
>
slideDataList
=
new
List
<
PerAgainData
>();
List
<
PerAgainEmployee
>
fixatDataList
=
new
List
<
PerAgainEmployee
>();
var
header
=
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"工作量绩效工资"
);
if
(
header
!=
null
&&
header
.
Children
!=
null
)
{
for
(
int
r
=
DataFirstRowNum
;
r
<
sheet
.
LastRowNum
+
1
;
r
++)
{
var
row
=
sheet
.
GetRow
(
r
);
if
(
row
==
null
)
continue
;
fixatDataList
.
Add
(
FixatRowRead
(
perHeader
,
r
,
row
));
slideDataList
.
AddRange
(
SlideRowRead
(
sheet
,
header
,
r
,
row
));
}
}
return
(
header
,
slideDataList
,
fixatDataList
);
}
/// <summary>
/// 可扩展列读取
/// </summary>
/// <param name="sheet"></param>
/// <param name="header"></param>
/// <param name="r"></param>
/// <param name="row"></param>
/// <returns></returns>
private
List
<
PerAgainData
>
SlideRowRead
(
ISheet
sheet
,
PerHeader
header
,
int
r
,
IRow
row
)
{
List
<
PerAgainData
>
slideDataList
=
new
List
<
PerAgainData
>();
for
(
int
c
=
0
;
c
<
header
.
Children
.
Count
();
c
++)
{
var
athead
=
header
.
Children
.
ElementAt
(
c
);
var
cellValue
=
NopiSevice
.
GetCellValue
(
row
.
GetCell
(
athead
.
PointCell
));
if
(!
cellValue
.
HasValue
||
cellValue
.
Value
==
0
)
continue
;
var
factorValue
=
ConvertHelper
.
To
<
decimal
?>(
sheet
.
GetRow
(
FactorRow
).
GetCell
(
athead
.
PointCell
)?.
ToString
());
PerAgainData
data
=
new
PerAgainData
{
RowNumber
=
r
,
TypeName
=
athead
?.
CellValue
,
CellValue
=
cellValue
,
IsTotal
=
2
,
IsFactor
=
factorValue
.
HasValue
?
1
:
2
,
FactorValue
=
factorValue
,
Annotation
=
row
.
GetCell
(
athead
.
PointCell
)?.
CellComment
?.
String
?.
String
,
SignID
=
athead
.
SignID
,
};
slideDataList
.
Add
(
data
);
}
return
slideDataList
;
}
/// <summary>
/// 固定列读取
/// </summary>
/// <param name="perHeader"></param>
/// <param name="r"></param>
/// <param name="row"></param>
/// <returns></returns>
private
static
PerAgainEmployee
FixatRowRead
(
List
<
PerHeader
>
perHeader
,
int
r
,
IRow
row
)
{
return
new
PerAgainEmployee
{
RowNumber
=
r
,
Name
=
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"姓名"
).
PointCell
)?.
ToString
(),
JobTitle
=
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"职务"
).
PointCell
)?.
ToString
(),
JobFactor
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"职称系数"
).
PointCell
)?.
ToString
()),
Attendance
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"出勤"
).
PointCell
)?.
ToString
()),
YearFactor
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"年资"
).
PointCell
)?.
ToString
()),
Award
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"重点奖励"
).
PointCell
)?.
ToString
()),
Allowance
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"管理津贴"
).
PointCell
)?.
ToString
()),
AlonePerfor
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"单独核算人员绩效"
).
PointCell
)?.
ToString
()),
NightShift
=
ConvertHelper
.
To
<
decimal
?>(
row
.
GetCell
(
perHeader
.
FirstOrDefault
(
p
=>
p
.
CellValue
==
"夜班费"
).
PointCell
)?.
ToString
()),
};
}
}
}
performance/Performance.Services/AgainAllotService.cs
View file @
fa80f4ee
using
Performance.DtoModels
;
using
Microsoft.Extensions.Options
;
using
Performance.DtoModels
;
using
Performance.DtoModels.AppSettings
;
using
Performance.Repository
;
using
Performance.Repository
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
namespace
Performance.Services
namespace
Performance.Services
{
{
public
class
AgainAllotService
:
IAutoInjection
public
class
AgainAllotService
:
IAutoInjection
{
{
private
Application
application
;
private
AgainService
againService
;
private
PerforCofagainRepository
perforCofagainRepository
;
private
PerforPeragainallotRepository
perforPeragainallotRepository
;
private
PerforPeragainallotRepository
perforPeragainallotRepository
;
public
AgainAllotService
(
PerforPeragainallotRepository
perforPeragainallotRepository
)
private
PerforResaccountdoctorRepository
perforResaccountdoctorRepository
;
private
PerforResaccountnurseRepository
perforResaccountnurseRepository
;
public
AgainAllotService
(
IOptions
<
Application
>
options
,
AgainService
againService
,
PerforCofagainRepository
perforCofagainRepository
,
PerforPeragainallotRepository
perforPeragainallotRepository
,
PerforResaccountdoctorRepository
perforResaccountdoctorRepository
,
PerforResaccountnurseRepository
perforResaccountnurseRepository
)
{
{
this
.
application
=
options
.
Value
;
this
.
againService
=
againService
;
this
.
perforCofagainRepository
=
perforCofagainRepository
;
this
.
perforPeragainallotRepository
=
perforPeragainallotRepository
;
this
.
perforPeragainallotRepository
=
perforPeragainallotRepository
;
this
.
perforResaccountdoctorRepository
=
perforResaccountdoctorRepository
;
this
.
perforResaccountnurseRepository
=
perforResaccountnurseRepository
;
}
}
/// <summary>
/// <summary>
/// 生成二次绩效
/// 生成二次绩效
/// </summary>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
public
void
Generate
(
AgainAllotRequest
request
)
public
SheetExportResponse
Generate
(
AgainAllotRequest
request
,
UserIdentity
user
)
{
{
var
againAllot
=
perforPeragainallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
AgainAllotID
);
var
againAllot
=
perforPeragainallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
AgainAllotID
);
if
(
againAllot
==
null
||
againAllot
.
ID
==
0
)
if
(
againAllot
==
null
||
againAllot
.
ID
==
0
)
throw
new
PerformanceException
(
"绩效二次分配不存在"
);
throw
new
PerformanceException
(
"绩效二次分配不存在"
);
//获取基础配置信息
var
config
=
perforCofagainRepository
.
GetEntities
(
t
=>
t
.
AgainAllotID
==
againAllot
.
ID
);
var
jobfactor
=
config
.
FirstOrDefault
(
t
=>
t
.
Type
==
1
)?.
Value
;
var
workfactor
=
config
.
FirstOrDefault
(
t
=>
t
.
Type
==
2
)?.
Value
;
var
days
=
config
.
FirstOrDefault
(
t
=>
t
.
Type
==
3
)?.
Value
;
decimal
?
basicnumber
=
0
m
;
//获取科室实发绩效
//获取科室实发绩效
if
(
user
.
Role
!=
null
)
{
var
role
=
user
.
Role
.
FirstOrDefault
();
if
(
role
!=
null
)
{
basicnumber
=
application
.
NurseRole
==
role
.
RoleID
?
perforResaccountnurseRepository
.
GetEntity
(
t
=>
t
.
AllotID
==
againAllot
.
AllotID
&&
t
.
AccountingUnit
==
user
.
Department
)?.
RealGiveFee
:
perforResaccountdoctorRepository
.
GetEntity
(
t
=>
t
.
AllotID
==
againAllot
.
AllotID
&&
t
.
AccountingUnit
==
user
.
Department
)?.
RealGiveFee
;
}
}
//读取二次计算excel数据
var
perAgainExcel
=
againService
.
ReadData
(
againAllot
);
//护士长或科主任出勤
var
bossAttendance
=
perAgainExcel
.
AgainEmployee
.
FirstOrDefault
(
t
=>
t
.
JobTitle
==
"护士长"
)?.
Attendance
;
//计算职称出勤系数、年资出勤系数
foreach
(
var
item
in
perAgainExcel
.
AgainEmployee
)
{
item
.
JobAttendanceFactor
=
item
.
JobFactor
*
item
.
Attendance
/
days
;
item
.
YearAttendanceFactor
=
item
.
Attendance
*
item
.
YearFactor
/
days
;
}
//计算 科室系数人均
var
departmentFactorAvg
=
basicnumber
/
perAgainExcel
.
AgainEmployee
.
Sum
(
t
=>
t
.
YearAttendanceFactor
);
//二次分配科室概览
PerAgainSituation
situation
=
new
PerAgainSituation
{
NightShift
=
perAgainExcel
.
AgainEmployee
.
Sum
(
t
=>
t
.
NightShift
),
DepartmentTotal
=
basicnumber
,
BossPerfor
=
departmentFactorAvg
*
bossAttendance
/
days
,
Award
=
perAgainExcel
.
AgainEmployee
.
Sum
(
t
=>
t
.
Award
),
Allowance
=
perAgainExcel
.
AgainEmployee
.
Sum
(
t
=>
t
.
Allowance
),
AlonePerfor
=
perAgainExcel
.
AgainEmployee
.
Sum
(
t
=>
t
.
AlonePerfor
),
Attendance
=
days
,
DepartmentFactorAvg
=
departmentFactorAvg
};
//业绩二次分配科室概览:业绩分配绩效、职称绩效、工作量绩效
situation
.
AllotPerfor
=
situation
.
DepartmentTotal
-
situation
.
BossPerfor
-
situation
.
Award
-
situation
.
Allowance
-
situation
.
AlonePerfor
;
situation
.
JobPerfor
=
situation
.
AllotPerfor
*
jobfactor
;
situation
.
WorkloadPerfor
=
situation
.
AllotPerfor
*
workfactor
;
var
rowList
=
perAgainExcel
.
AgainData
.
Select
(
t
=>
t
.
RowNumber
).
Distinct
().
ToList
();
//业绩二次分配科室动态数据:工作量得分
foreach
(
var
rowNumber
in
rowList
)
{
var
againEmployee
=
perAgainExcel
.
AgainEmployee
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
rowNumber
);
var
atRowList
=
perAgainExcel
.
AgainData
.
Where
(
t
=>
t
.
RowNumber
==
rowNumber
);
decimal
?
sumValue
=
0
m
;
foreach
(
var
atRow
in
atRowList
)
sumValue
+=
atRow
.
IsFactor
==
1
?
atRow
.
IsFactor
*
atRow
.
CellValue
:
atRow
.
CellValue
;
sumValue
=
sumValue
*
againEmployee
?.
YearFactor
;
var
head
=
perAgainExcel
.
Header
.
Children
.
FirstOrDefault
(
t
=>
t
.
CellValue
==
"工作量得分"
);
if
(
head
==
null
)
{
perAgainExcel
.
Header
.
MergeCell
++;
var
pointrow
=
perAgainExcel
.
Header
.
Children
.
Max
(
t
=>
t
.
PointRow
);
var
pointcell
=
perAgainExcel
.
Header
.
Children
.
Max
(
t
=>
t
.
PointCell
);
head
=
new
PerHeader
(
pointrow
,
pointcell
,
"工作量得分"
,
1
,
1
,
1
,
null
,
1
);
perAgainExcel
.
Header
.
Children
.
Add
(
head
);
}
perAgainExcel
.
AgainData
.
Add
(
new
PerAgainData
(
rowNumber
.
Value
,
"工作量得分"
,
sumValue
,
1
,
2
,
null
,
""
,
""
,
head
.
SignID
));
}
//业绩二次分配科室动态数据:绩效工资
foreach
(
var
rowNumber
in
rowList
)
{
var
workvalue
=
perAgainExcel
.
AgainData
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
rowNumber
&&
t
.
TypeName
==
"工作量得分"
)?.
CellValue
;
var
sumvalue
=
perAgainExcel
.
AgainData
.
Where
(
t
=>
t
.
TypeName
==
"工作量得分"
).
Sum
(
t
=>
t
.
CellValue
);
//计算二次分配汇总信息
var
perforValue
=
workvalue
/
sumvalue
*
situation
.
WorkloadPerfor
;
//对二次分配分别开计算
var
head
=
perAgainExcel
.
Header
.
Children
.
FirstOrDefault
(
t
=>
t
.
CellValue
==
"绩效工资"
);
if
(
head
==
null
)
{
perAgainExcel
.
Header
.
MergeCell
++;
var
pointrow
=
perAgainExcel
.
Header
.
Children
.
Max
(
t
=>
t
.
PointRow
);
var
pointcell
=
perAgainExcel
.
Header
.
Children
.
Max
(
t
=>
t
.
PointCell
);
head
=
new
PerHeader
(
pointrow
,
pointcell
,
"绩效工资"
,
1
,
1
,
1
,
null
,
1
);
perAgainExcel
.
Header
.
Children
.
Add
(
head
);
}
perAgainExcel
.
AgainData
.
Add
(
new
PerAgainData
(
rowNumber
.
Value
,
"绩效工资"
,
perforValue
,
1
,
2
,
null
,
""
,
""
,
head
.
SignID
));
}
//业绩二次分配科室:应发绩效、实发绩效
string
[]
jobArray
=
new
string
[]
{
"护士长"
,
"科主任"
};
foreach
(
var
employee
in
perAgainExcel
.
AgainEmployee
)
{
if
(
jobArray
.
Contains
(
employee
.
JobTitle
))
{
employee
.
GiveFee
=
situation
.
BossPerfor
;
employee
.
RealGiveFee
=
situation
.
BossPerfor
;
}
else
{
employee
.
JobAttendancePerfor
=
situation
.
JobPerfor
*
employee
.
JobAttendanceFactor
/
perAgainExcel
.
AgainEmployee
.
Sum
(
t
=>
t
.
JobAttendanceFactor
);
var
value
=
perAgainExcel
.
AgainData
.
FirstOrDefault
(
t
=>
t
.
RowNumber
==
employee
.
RowNumber
&&
t
.
TypeName
==
"绩效工资"
)?.
CellValue
;
employee
.
GiveFee
=
(
employee
.
JobAttendancePerfor
??
0
)
+
(
value
??
0
)
+
(
employee
.
Award
??
0
)
+
(
employee
.
Allowance
??
0
)
+
(
employee
.
AlonePerfor
??
0
);
employee
.
RealGiveFee
=
(
employee
.
GiveFee
??
0
)
+
(
employee
.
NightShift
??
0
);
}
}
SheetExportResponse
response
=
new
SheetExportResponse
(
"二次绩效分配表"
);
//返回表格展示数据结构
var
row
=
new
Row
(
0
);
row
.
Data
.
Add
(
new
Cell
(
1
,
"姓名"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
2
,
"职务"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
3
,
"职称系数"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
4
,
"出勤"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
5
,
"职称出勤系数"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
6
,
"年资"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
7
,
"年资出勤系数"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
8
,
"职称出勤绩效"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
9
,
perAgainExcel
.
Header
.
CellValue
,
1
,
perAgainExcel
.
Header
.
Children
.
Count
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
9
+
perAgainExcel
.
Header
.
Children
.
Count
,
"重点奖励"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
10
+
perAgainExcel
.
Header
.
Children
.
Count
,
"管理津贴"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
11
+
perAgainExcel
.
Header
.
Children
.
Count
,
"单独核算人员绩效"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
12
+
perAgainExcel
.
Header
.
Children
.
Count
,
"应发绩效工资金额"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
13
+
perAgainExcel
.
Header
.
Children
.
Count
,
"夜班费"
,
2
,
1
,
false
,
false
));
row
.
Data
.
Add
(
new
Cell
(
14
+
perAgainExcel
.
Header
.
Children
.
Count
,
"实发工资合计"
,
2
,
1
,
false
,
false
));
//固定数据计算
var
rowTwo
=
new
Row
(
1
);
int
startpoint
=
9
;
perAgainExcel
.
Header
.
Children
.
ForEach
(
t
=>
{
rowTwo
.
Data
.
Add
(
new
Cell
(
startpoint
,
t
.
CellValue
,
1
,
1
,
false
,
false
));
startpoint
++;
});
response
.
Header
.
Add
(
row
);
response
.
Header
.
Add
(
rowTwo
);
//动态数据计算
for
(
int
i
=
0
;
i
<
perAgainExcel
.
AgainEmployee
.
Count
();
i
++)
{
var
item
=
perAgainExcel
.
AgainEmployee
.
ElementAt
(
i
);
var
rowbody
=
new
Row
(
i
);
rowbody
.
Data
.
Add
(
new
Cell
(
1
,
item
.
Name
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
2
,
item
.
JobTitle
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
3
,
item
.
JobFactor
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
4
,
item
.
Attendance
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
5
,
item
.
JobAttendanceFactor
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
6
,
item
.
YearFactor
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
7
,
item
.
YearAttendanceFactor
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
8
,
item
.
JobAttendancePerfor
,
1
,
1
,
false
,
false
));
var
againList
=
perAgainExcel
.
AgainData
.
Where
(
t
=>
t
.
RowNumber
==
item
.
RowNumber
);
startpoint
=
9
;
perAgainExcel
.
Header
.
Children
.
ForEach
(
t
=>
{
var
cellValue
=
againList
.
FirstOrDefault
(
s
=>
t
.
SignID
==
s
.
SignID
)?.
CellValue
;
rowbody
.
Data
.
Add
(
new
Cell
(
startpoint
,
cellValue
,
1
,
1
,
false
,
false
));
startpoint
++;
});
rowbody
.
Data
.
Add
(
new
Cell
(
9
+
perAgainExcel
.
Header
.
Children
.
Count
,
item
.
Award
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
10
+
perAgainExcel
.
Header
.
Children
.
Count
,
item
.
Allowance
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
11
+
perAgainExcel
.
Header
.
Children
.
Count
,
item
.
AlonePerfor
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
12
+
perAgainExcel
.
Header
.
Children
.
Count
,
item
.
GiveFee
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
13
+
perAgainExcel
.
Header
.
Children
.
Count
,
item
.
NightShift
,
1
,
1
,
false
,
false
));
rowbody
.
Data
.
Add
(
new
Cell
(
14
+
perAgainExcel
.
Header
.
Children
.
Count
,
item
.
RealGiveFee
,
1
,
1
,
false
,
false
));
response
.
Row
.
Add
(
rowbody
);
}
throw
new
NotImplementedException
()
;
return
response
;
}
}
}
}
}
}
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