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
18c77ade
Commit
18c77ade
authored
Aug 18, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
行政科室测算
parent
a1c512cc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
118 additions
and
4 deletions
+118
-4
performance/Performance.Api/Controllers/ComputeController.cs
+16
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+7
-0
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
+2
-2
performance/Performance.Services/AllotCompute/ProcessComputService.cs
+68
-1
performance/Performance.Services/AllotService.cs
+3
-0
performance/Performance.Services/ComputeService.cs
+15
-0
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDirector.cs
+7
-1
No files found.
performance/Performance.Api/Controllers/ComputeController.cs
View file @
18c77ade
...
...
@@ -111,6 +111,22 @@ public ApiResponse<List<DeptResponse>> GetOther([FromBody] ComputerRequest reque
}
/// <summary>
/// 行政科室绩效列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"getofficedata"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
DeptResponse
>>
GetOffice
([
FromBody
]
ComputerRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_computeService
.
GetOfficePerformance
(
request
.
AllotId
);
return
new
ApiResponse
<
List
<
DeptResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
/// <summary>
/// 返回院领导、中层、工勤组绩效
/// </summary>
/// <param name="request"></param>
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
18c77ade
...
...
@@ -319,6 +319,13 @@
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GetOffice(Performance.DtoModels.ComputerRequest)"
>
<summary>
行政科室绩效列表
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.ComputeController.GetAdminPerformance(Performance.DtoModels.ComputerRequest)"
>
<summary>
返回院领导、中层、工勤组绩效
...
...
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
View file @
18c77ade
...
...
@@ -148,9 +148,9 @@ public AutoMapperConfigs()
//CreateMap<PerDataAccountNurse, res_accountnurse>();
//CreateMap<res_accountdoctor, PerDataAccountBaisc>();
CreateMap
<
res_account
,
PerDataAccountBaisc
>()
.
ForMember
(
dest
=>
dest
.
UnitType
,
opt
=>
opt
.
MapFrom
(
src
=>
((
UnitType
)
src
.
UnitType
).
ToString
()
));
.
ForMember
(
dest
=>
dest
.
UnitType
,
opt
=>
opt
.
MapFrom
(
src
=>
src
.
UnitType
.
HasValue
?
((
UnitType
)
src
.
UnitType
).
ToString
()
:
""
));
CreateMap
<
PerDataAccountBaisc
,
res_account
>()
.
ForMember
(
dest
=>
dest
.
UnitType
,
opt
=>
opt
.
MapFrom
(
src
=>
EnumHelper
.
GetItems
<
UnitType
>().
First
(
t
=>
t
.
Name
==
src
.
UnitType
).
Value
));
.
ForMember
(
dest
=>
dest
.
UnitType
,
opt
=>
opt
.
MapFrom
(
src
=>
string
.
IsNullOrEmpty
(
src
.
UnitType
)
?
-
1
:
EnumHelper
.
GetItems
<
UnitType
>().
First
(
t
=>
t
.
Name
==
src
.
UnitType
).
Value
));
//CreateMap<PerDataAccountBaisc, res_accountnurse>();
//CreateMap<res_accountdoctor, ComputeSource>();
...
...
performance/Performance.Services/AllotCompute/ProcessComputService.cs
View file @
18c77ade
...
...
@@ -27,6 +27,7 @@ public class ProcessComputService : IAutoInjection
private
PerforCofdrugtypeRepository
perforCofdrugtypeRepository
;
private
PerforCofworkitemRepository
perforCofworkitemRepository
;
private
PerforCofcmiRepository
perforCofcmiRepository
;
private
readonly
PerforRescomputeRepository
perforRescomputeRepository
;
private
readonly
LogManageService
logManageService
;
private
readonly
GuaranteeService
guaranteeService
;
...
...
@@ -41,6 +42,7 @@ public class ProcessComputService : IAutoInjection
PerforCofdrugtypeRepository
perforCofdrugtypeRepository
,
PerforCofworkitemRepository
perforCofworkitemRepository
,
PerforCofcmiRepository
perforCofcmiRepository
,
PerforRescomputeRepository
perforRescomputeRepository
,
LogManageService
logManageService
,
GuaranteeService
guaranteeService
)
{
...
...
@@ -55,6 +57,7 @@ public class ProcessComputService : IAutoInjection
this
.
perforCofdrugtypeRepository
=
perforCofdrugtypeRepository
;
this
.
perforCofworkitemRepository
=
perforCofworkitemRepository
;
this
.
perforCofcmiRepository
=
perforCofcmiRepository
;
this
.
perforRescomputeRepository
=
perforRescomputeRepository
;
this
.
logManageService
=
logManageService
;
this
.
guaranteeService
=
guaranteeService
;
}
...
...
@@ -285,7 +288,7 @@ public void Save(List<PerSheet> perSheets, int allotId)
workDoctor
=
info
.
Data
.
FirstOrDefault
(
t
=>
t
.
UnitType
==
UnitType
.
医生组
.
ToString
()
&&
t
.
AccountingUnit
==
dept
.
AccountingUnit
);
dept
.
MedicineFactor
=
workDoctor
?.
MedicineFactor
;
dept
.
ScoringAverage
=
dept
.
ScoringAverage
==
0
m
?
1
:
dept
.
ScoringAverage
;
dept
.
ScoringAverage
=
dept
.
ScoringAverage
==
0
m
?
0
:
dept
.
ScoringAverage
;
dept
.
AdjustFactor
=
dept
.
AdjustFactor
==
0
m
?
1
:
dept
.
AdjustFactor
;
dept
.
Income
=
econDoctor
?.
CellValue
??
0
;
dept
.
WorkloadFee
=
workDoctor
?.
CellValue
??
0
;
...
...
@@ -306,6 +309,70 @@ public void Save(List<PerSheet> perSheets, int allotId)
}
/// <summary>
/// 计算行政科室绩效
/// </summary>
/// <param name="allot"></param>
/// <param name="excel"></param>
/// <param name="extras"></param>
/// <param name="drugExtras"></param>
/// <param name="materialsExtras"></param>
public
void
ComputeOffice
(
per_allot
allot
,
PerExcel
excel
,
IEnumerable
<
AccountUnitTotal
>
extras
,
IEnumerable
<
AccountUnitTotal
>
drugExtras
,
IEnumerable
<
AccountUnitTotal
>
materialsExtras
)
{
//取出科室
var
accountList
=
excel
.
PerSheet
.
FirstOrDefault
(
t
=>
t
.
SheetType
==
SheetType
.
AccountBasic
)?.
PerData
?.
Select
(
t
=>
(
PerDataAccountBaisc
)
t
);
List
<
string
>
involves
=
new
List
<
string
>
{
AccountUnitType
.
行政高层
.
ToString
(),
AccountUnitType
.
行政中层
.
ToString
(),
AccountUnitType
.
行政工勤
.
ToString
()
};
var
empolyeeList
=
perforRescomputeRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allot
.
ID
&&
involves
.
Contains
(
w
.
AccountType
));
if
(
empolyeeList
==
null
||
empolyeeList
.
Count
()
==
0
)
return
;
List
<
PerDataAccountBaisc
>
perDatas
=
new
List
<
PerDataAccountBaisc
>();
// 取出科室
var
dataList
=
empolyeeList
.
Select
(
w
=>
new
{
w
.
AccountType
,
w
.
AccountingUnit
}).
Distinct
();
foreach
(
var
account
in
dataList
)
{
var
resAccount
=
accountList
.
FirstOrDefault
(
t
=>
t
.
UnitType
==
account
.
AccountType
&&
t
.
AccountingUnit
==
account
.
AccountingUnit
);
var
empolyees
=
empolyeeList
.
Where
(
w
=>
w
.
AccountingUnit
==
account
.
AccountingUnit
&&
w
.
AccountType
==
account
.
AccountType
);
if
(!
empolyees
.
Any
())
continue
;
//科室奖罚汇总结果
var
extra
=
extras
.
FirstOrDefault
(
w
=>
w
.
UnitType
==
account
.
AccountType
.
ToString
()
&&
w
.
AccountingUnit
==
resAccount
.
AccountingUnit
)?.
TotelValue
;
var
drugExtra
=
drugExtras
.
FirstOrDefault
(
w
=>
w
.
UnitType
==
account
.
AccountType
.
ToString
()
&&
w
.
AccountingUnit
==
resAccount
.
AccountingUnit
)?.
TotelValue
;
var
materialsExtra
=
materialsExtras
.
FirstOrDefault
(
w
=>
w
.
UnitType
==
account
.
AccountType
.
ToString
()
&&
w
.
AccountingUnit
==
resAccount
.
AccountingUnit
)?.
TotelValue
;
var
dept
=
new
PerDataAccountBaisc
();
dept
.
AccountingUnit
=
account
.
AccountingUnit
;
//dept.UnitType = account.AccountType;
dept
.
ScoringAverage
=
resAccount
?.
ScoringAverage
==
null
?
0
:
resAccount
.
ScoringAverage
;
dept
.
AdjustFactor
=
resAccount
?.
AdjustFactor
==
null
?
1
:
resAccount
.
AdjustFactor
;
dept
.
Income
=
empolyees
.
Sum
(
w
=>
w
.
PerforTotal
??
0
);
dept
.
Extra
=
(
extra
??
0
);
dept
.
MedicineExtra
=
(
drugExtra
??
0
);
dept
.
MaterialsExtra
=
(
materialsExtra
??
0
);
dept
.
PerforFee
=
empolyees
.
Sum
(
w
=>
w
.
PerforTotal
??
0
);
dept
.
PerforTotal
=
Math
.
Round
((
dept
.
PerforFee
+
(
dept
?.
OtherPerfor1
??
0
))
??
0
);
dept
.
RealGiveFee
=
Math
.
Round
(((
dept
.
PerforTotal
*
dept
.
ScoringAverage
+
dept
.
MedicineExtra
+
dept
.
MaterialsExtra
+
dept
.
OtherPerfor2
+
(
extra
??
0
))
*
dept
.
AdjustFactor
)
??
0
);
dept
.
Avg
=
dept
.
ManagerNumber
+
dept
.
Number
==
0
?
0
:
dept
.
PerforTotal
/
(
dept
.
ManagerNumber
+
dept
.
Number
);
perDatas
.
Add
(
dept
);
}
List
<
res_account
>
addList
=
new
List
<
res_account
>();
foreach
(
var
data
in
perDatas
)
{
var
imdata
=
Mapper
.
Map
<
res_account
>(
data
);
imdata
.
AllotID
=
allot
.
ID
;
addList
.
Add
(
imdata
);
}
perforResaccountRepository
.
AddRange
(
addList
.
ToArray
());
}
/// <summary>
/// 获取科室奖罚汇总结果
/// </summary>
/// <param name="excel"></param>
...
...
performance/Performance.Services/AllotService.cs
View file @
18c77ade
...
...
@@ -375,6 +375,9 @@ public void Generate(per_allot allot, string mail)
logManageService
.
WriteMsg
(
"正在生成绩效"
,
"计算最终绩效数据"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
var
baiscnormList
=
resultComputeService
.
Compute
(
allot
,
excel
,
sheetLast
,
employeeExtra
);
// 计算行政科室绩效
processComputService
.
ComputeOffice
(
allot
,
excel
,
accountExtras
,
drugExtras
,
materialsExtras
);
// 计算特殊科室
logManageService
.
WriteMsg
(
"正在生成绩效"
,
"计算最终特殊科室绩效数据"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
resultComputeService
.
SpecialUnitCompute
(
excel
,
allot
,
sheetLast
,
baiscnormList
,
accountExtras
,
drugExtras
,
materialsExtras
,
employeeExtra
);
...
...
performance/Performance.Services/ComputeService.cs
View file @
18c77ade
...
...
@@ -253,6 +253,21 @@ public List<DeptResponse> GetOtherPerformance(int allotId)
}
/// <summary>
/// 返回行政科室绩效列表
/// </summary>
/// <param name="allotId">绩效ID</param>
/// <returns></returns>
public
List
<
DeptResponse
>
GetOfficePerformance
(
int
allotId
)
{
var
list
=
perforResaccountRepository
.
GetEntities
(
t
=>
t
.
UnitType
==
-
1
&&
t
.
AllotID
==
allotId
)
?.
OrderBy
(
t
=>
t
.
UnitType
)
.
ThenByDescending
(
t
=>
t
.
AccountingUnit
);
List
<
DeptResponse
>
other
=
Mapper
.
Map
<
List
<
DeptResponse
>>(
list
);
other
?.
ForEach
(
t
=>
t
.
UnitName
=
((
UnitType
)
t
.
UnitType
).
ToString
());
return
other
;
}
/// <summary>
/// 返回院领导、中层、工勤组绩效
/// </summary>
/// <param name="allotId">绩效ID</param>
...
...
performance/Performance.Services/PerExcelService/ComputeEmpolyee/ComputeDirector.cs
View file @
18c77ade
...
...
@@ -19,6 +19,7 @@ public class ComputeDirector : IAutoInjection
private
readonly
PerforCofdirectorRepository
perforCofdirectorRepository
;
private
readonly
PerforCofworkyearRepository
perforCofworkyearRepository
;
private
readonly
PerforResaccountRepository
perforResaccountRepository
;
private
readonly
PerforRescomputeRepository
perforRescomputeRepository
;
private
readonly
BudgetService
budgetService
;
//private readonly PerforResaccountdoctorRepository perforResAccountdoctorRepository;
...
...
@@ -26,12 +27,14 @@ public class ComputeDirector : IAutoInjection
PerforCofdirectorRepository
perforCofdirectorRepository
,
PerforCofworkyearRepository
perforCofworkyearRepository
,
PerforResaccountRepository
perforResaccountRepository
,
PerforRescomputeRepository
perforRescomputeRepository
,
BudgetService
budgetService
)
{
this
.
baiscNormService
=
baiscNormService
;
this
.
perforCofdirectorRepository
=
perforCofdirectorRepository
;
this
.
perforCofworkyearRepository
=
perforCofworkyearRepository
;
this
.
perforResaccountRepository
=
perforResaccountRepository
;
this
.
perforRescomputeRepository
=
perforRescomputeRepository
;
this
.
budgetService
=
budgetService
;
}
...
...
@@ -321,7 +324,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, List<PerS
unitType
=
unit
.
FirstOrDefault
(
t
=>
t
.
UnitType
.
ToString
()
==
empolyee
.
UnitType
)?.
NewUnitType
;
}
var
resAccount
=
dataList
.
FirstOrDefault
(
t
=>
((
UnitType
)
t
.
UnitType
).
ToString
()
==
empolyee
.
UnitType
&&
t
.
AccountingUnit
==
empolyee
.
AccountingUnit
)
??
dataList
.
FirstOrDefault
(
t
=>
((
UnitType
)
t
.
UnitType
).
ToString
()
==
unitType
&&
t
.
AccountingUnit
==
empolyee
.
AccountingUnit
);
var
resAccount
=
dataList
.
FirstOrDefault
(
t
=>
((
UnitType
)
t
.
UnitType
).
ToString
()
==
empolyee
.
UnitType
&&
t
.
AccountingUnit
==
empolyee
.
AccountingUnit
)
??
dataList
.
FirstOrDefault
(
t
=>
((
UnitType
)
t
.
UnitType
).
ToString
()
==
unitType
&&
t
.
AccountingUnit
==
empolyee
.
AccountingUnit
);
if
(
resAccount
==
null
&&
empolyees
.
Count
()
>
1
)
{
// 如果没有找到科室,则找相同用户的其他核算单元类型
...
...
@@ -475,6 +479,8 @@ public List<ComputeResult> Compute(List<ComputeEmployee> empolyeeList, per_allot
}
//添加参数计算
compute
.
BaiscNormValue
=
baiscnorm
*
(
item
.
FitPeopleRatio
??
0
);
//绩效合计
compute
.
PerforTotal
=
compute
.
BaiscNormValue
*
compute
.
PostCoefficient
*
compute
.
Attendance
;
//应发绩效
compute
.
GiveFee
=
compute
.
BaiscNormValue
*
compute
.
PostCoefficient
*
compute
.
Attendance
+
compute
.
Punishment
;
...
...
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