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
3e285b7a
Commit
3e285b7a
authored
Aug 20, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二次分配小数位
parent
8b9aafc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
16 deletions
+23
-16
performance/Performance.Services/RedistributionService.cs
+23
-16
No files found.
performance/Performance.Services/RedistributionService.cs
View file @
3e285b7a
...
@@ -884,8 +884,8 @@ private void deptRewardCalculate(List<Dictionary<string, object>> rows)
...
@@ -884,8 +884,8 @@ private void deptRewardCalculate(List<Dictionary<string, object>> rows)
{
{
foreach
(
var
row
in
rows
)
foreach
(
var
row
in
rows
)
{
{
decimal
total_deptReward
=
row
.
Where
(
w
=>
w
.
Key
.
StartsWithIgnoreCase
(
"SingleAwards_"
)).
Sum
(
r
=>
GetDecimal
2
(
row
,
r
.
Key
));
decimal
total_deptReward
=
row
.
Where
(
w
=>
w
.
Key
.
StartsWithIgnoreCase
(
"SingleAwards_"
)).
Sum
(
r
=>
GetDecimal
(
row
,
r
.
Key
));
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
DeptReward
),
total_deptReward
);
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
DeptReward
),
GetDecimal2
(
total_deptReward
)
);
}
}
}
}
/// <summary>
/// <summary>
...
@@ -960,10 +960,10 @@ private void basisPerformanceCalculate(Dictionary<string, object> head, List<Dic
...
@@ -960,10 +960,10 @@ private void basisPerformanceCalculate(Dictionary<string, object> head, List<Dic
var
post
=
row
.
GetString
(
nameof
(
ag_bodysource
.
Post
));
var
post
=
row
.
GetString
(
nameof
(
ag_bodysource
.
Post
));
if
(
specialPostName
.
Contains
(
post
))
if
(
specialPostName
.
Contains
(
post
))
{
{
var
daysFullAttendance
=
GetDecimal
2
(
head
,
nameof
(
ag_headsource
.
DaysFullAttendance
));
var
daysFullAttendance
=
GetDecimal
(
head
,
nameof
(
ag_headsource
.
DaysFullAttendance
));
var
departmentsPerCapita
=
GetDecimal2
(
head
,
nameof
(
ag_headsource
.
DepartmentsPerCapita
));
var
departmentsPerCapita
=
GetDecimal2
(
head
,
nameof
(
ag_headsource
.
DepartmentsPerCapita
));
var
staffCoefficient
=
GetDecimal
2
(
row
,
nameof
(
ag_bodysource
.
StaffCoefficient
));
var
staffCoefficient
=
GetDecimal
(
row
,
nameof
(
ag_bodysource
.
StaffCoefficient
));
var
actualAttendance
=
GetDecimal
2
(
row
,
nameof
(
ag_bodysource
.
ActualAttendance
));
var
actualAttendance
=
GetDecimal
(
row
,
nameof
(
ag_bodysource
.
ActualAttendance
));
var
basisPerformance
=
daysFullAttendance
==
0
?
0
:
departmentsPerCapita
*
staffCoefficient
*
actualAttendance
/
daysFullAttendance
;
var
basisPerformance
=
daysFullAttendance
==
0
?
0
:
departmentsPerCapita
*
staffCoefficient
*
actualAttendance
/
daysFullAttendance
;
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
BasisPerformance
),
basisPerformance
);
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
BasisPerformance
),
basisPerformance
);
...
@@ -988,10 +988,10 @@ private void titleCoefficientCalculate(Dictionary<string, object> head, List<Dic
...
@@ -988,10 +988,10 @@ private void titleCoefficientCalculate(Dictionary<string, object> head, List<Dic
{
{
var
post
=
row
.
GetString
(
nameof
(
ag_bodysource
.
Post
));
var
post
=
row
.
GetString
(
nameof
(
ag_bodysource
.
Post
));
if
(!
specialPostName
.
Contains
(
post
))
if
(!
specialPostName
.
Contains
(
post
))
total_titleCoefficient
+=
GetDecimal
2
(
row
,
nameof
(
ag_bodysource
.
ActualAttendance
))
*
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
TitleCoefficient
));
total_titleCoefficient
+=
GetDecimal
(
row
,
nameof
(
ag_bodysource
.
ActualAttendance
))
*
GetDecimal
(
row
,
nameof
(
ag_bodysource
.
TitleCoefficient
));
}
}
var
seniorityTitlesPerformance
=
GetDecimal
2
(
head
,
nameof
(
ag_headsource
.
SeniorityTitlesPerformance
));
var
seniorityTitlesPerformance
=
GetDecimal
(
head
,
nameof
(
ag_headsource
.
SeniorityTitlesPerformance
));
foreach
(
var
row
in
rows
)
foreach
(
var
row
in
rows
)
{
{
var
post
=
row
.
GetString
(
nameof
(
ag_bodysource
.
Post
));
var
post
=
row
.
GetString
(
nameof
(
ag_bodysource
.
Post
));
...
@@ -999,8 +999,8 @@ private void titleCoefficientCalculate(Dictionary<string, object> head, List<Dic
...
@@ -999,8 +999,8 @@ private void titleCoefficientCalculate(Dictionary<string, object> head, List<Dic
if
(
specialPostName
.
Contains
(
post
))
if
(
specialPostName
.
Contains
(
post
))
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
TitleCoefficient
),
0
m
);
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
TitleCoefficient
),
0
m
);
// 职称得分 = 当前行实际出勤 * 当前行职称系数
// 职称得分 = 当前行实际出勤 * 当前行职称系数
var
titlePerformanceScore
=
GetDecimal
2
(
row
,
nameof
(
ag_bodysource
.
ActualAttendance
))
*
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
TitleCoefficient
));
var
titlePerformanceScore
=
GetDecimal
(
row
,
nameof
(
ag_bodysource
.
ActualAttendance
))
*
GetDecimal
(
row
,
nameof
(
ag_bodysource
.
TitleCoefficient
));
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
TitlePerformanceScore
),
GetDecimal2
(
titlePerformanceScore
)
);
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
TitlePerformanceScore
),
titlePerformanceScore
);
//个人职称绩效 = ( 当前行实际出勤 * 当前行职称系数 ) / 职称系数总和* 年资职称绩效总和
//个人职称绩效 = ( 当前行实际出勤 * 当前行职称系数 ) / 职称系数总和* 年资职称绩效总和
var
titlePerformance
=
total_titleCoefficient
==
0
?
0
:
titlePerformanceScore
/
total_titleCoefficient
*
seniorityTitlesPerformance
;
var
titlePerformance
=
total_titleCoefficient
==
0
?
0
:
titlePerformanceScore
/
total_titleCoefficient
*
seniorityTitlesPerformance
;
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
TitlePerformance
),
GetDecimal2
(
titlePerformance
));
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
TitlePerformance
),
GetDecimal2
(
titlePerformance
));
...
@@ -1036,14 +1036,14 @@ private void titleCoefficientCalculate(Dictionary<string, object> head, List<Dic
...
@@ -1036,14 +1036,14 @@ private void titleCoefficientCalculate(Dictionary<string, object> head, List<Dic
break
;
break
;
}
}
// 工作量得分
// 工作量得分
row
.
AddOrUpdate
(
gp
.
WorkloadScore
,
GetDecimal2
(
workload_score
)
);
row
.
AddOrUpdate
(
gp
.
WorkloadScore
,
workload_score
);
}
}
}
}
// 工作量每分价格计算
// 工作量每分价格计算
foreach
(
var
gp
in
workloadGroups
)
foreach
(
var
gp
in
workloadGroups
)
{
{
// 汇总行内工作量总得分
// 汇总行内工作量总得分
var
total_score
=
rows
.
Sum
(
row
=>
GetDecimal
2
(
row
,
gp
.
WorkloadScore
)
*
GetDecimal2
(
row
,
gp
.
AssessmentScore
));
var
total_score
=
rows
.
Sum
(
row
=>
GetDecimal
(
row
,
gp
.
WorkloadScore
)
*
GetDecimal
(
row
,
gp
.
AssessmentScore
));
// 计算每分价格
// 计算每分价格
gp
.
Unit_Price
=
total_score
==
0
?
0
:
head
.
GetDecimal
(
$"Workload_Amount_
{
gp
.
Name
}
"
)
/
total_score
;
gp
.
Unit_Price
=
total_score
==
0
?
0
:
head
.
GetDecimal
(
$"Workload_Amount_
{
gp
.
Name
}
"
)
/
total_score
;
}
}
...
@@ -1061,12 +1061,12 @@ private void titleCoefficientCalculate(Dictionary<string, object> head, List<Dic
...
@@ -1061,12 +1061,12 @@ private void titleCoefficientCalculate(Dictionary<string, object> head, List<Dic
row
.
AddOrUpdate
(
gp
.
AssessmentScore
,
0
m
);
row
.
AddOrUpdate
(
gp
.
AssessmentScore
,
0
m
);
}
}
// 工作量绩效 = 工作量得分 * 每分价格 * 考核得分
// 工作量绩效 = 工作量得分 * 每分价格 * 考核得分
var
workload_fee
=
GetDecimal2
(
row
.
GetDecimal
(
gp
.
WorkloadScore
)
*
gp
.
Unit_Price
*
row
.
GetDecimal
(
gp
.
AssessmentScore
)
);
var
workload_fee
=
row
.
GetDecimal
(
gp
.
WorkloadScore
)
*
gp
.
Unit_Price
*
row
.
GetDecimal
(
gp
.
AssessmentScore
);
row
.
AddOrUpdate
(
gp
.
WorkPerformance
,
workload_fee
);
row
.
AddOrUpdate
(
gp
.
WorkPerformance
,
GetDecimal2
(
workload_fee
)
);
workPerformance
+=
workload_fee
;
workPerformance
+=
workload_fee
;
}
}
// 行内工作量汇总到一起
// 行内工作量汇总到一起
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
WorkPerformance
),
workPerformance
);
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
WorkPerformance
),
GetDecimal2
(
workPerformance
)
);
}
}
}
}
...
@@ -1095,7 +1095,7 @@ decimal ComputeMode_3(Dictionary<string, object> row, List<TitleValue<string, de
...
@@ -1095,7 +1095,7 @@ decimal ComputeMode_3(Dictionary<string, object> row, List<TitleValue<string, de
// 科主任/护士长 不参与工作量考核
// 科主任/护士长 不参与工作量考核
if
(
specialPostName
.
Contains
(
post
))
if
(
specialPostName
.
Contains
(
post
))
row
.
AddOrUpdate
(
item
.
ToLower
(),
0
);
row
.
AddOrUpdate
(
item
.
ToLower
(),
0
);
return
GetDecimal2
(
row
.
GetDecimal
(
item
.
ToLower
())
*
getFactorValue
(
loads
,
item
)
);
return
row
.
GetDecimal
(
item
.
ToLower
())
*
getFactorValue
(
loads
,
item
);
});
});
return
workload_score
;
return
workload_score
;
}
}
...
@@ -1122,7 +1122,7 @@ decimal ComputeMode_2(Dictionary<string, object> row, SecondWorkLoadDto gp, stri
...
@@ -1122,7 +1122,7 @@ decimal ComputeMode_2(Dictionary<string, object> row, SecondWorkLoadDto gp, stri
row
.
AddOrUpdate
(
gp
.
Items
[
i
+
1
],
0
m
);
row
.
AddOrUpdate
(
gp
.
Items
[
i
+
1
],
0
m
);
}
}
var
amount
=
row
.
GetDecimal
(
gp
.
Items
[
i
])
*
row
.
GetDecimal
(
gp
.
Items
[
i
+
1
]);
var
amount
=
row
.
GetDecimal
(
gp
.
Items
[
i
])
*
row
.
GetDecimal
(
gp
.
Items
[
i
+
1
]);
workload_score
+=
GetDecimal2
(
amount
)
;
workload_score
+=
amount
;
}
}
}
}
return
workload_score
;
return
workload_score
;
...
@@ -1205,6 +1205,13 @@ private void realAmountCalculate(List<Dictionary<string, object>> rows)
...
@@ -1205,6 +1205,13 @@ private void realAmountCalculate(List<Dictionary<string, object>> rows)
/// <param name="key"></param>
/// <param name="key"></param>
/// <returns></returns>
/// <returns></returns>
private
decimal
GetDecimal2
(
Dictionary
<
string
,
object
>
pairs
,
string
key
)
=>
GetDecimal2
(
pairs
.
GetDecimal
(
key
));
private
decimal
GetDecimal2
(
Dictionary
<
string
,
object
>
pairs
,
string
key
)
=>
GetDecimal2
(
pairs
.
GetDecimal
(
key
));
/// <summary>
/// 从键值对中获取decimal,默认:0,返回原始值
/// </summary>
/// <param name="pairs"></param>
/// <param name="key"></param>
/// <returns></returns>
private
decimal
GetDecimal
(
Dictionary
<
string
,
object
>
pairs
,
string
key
)
=>
pairs
.
GetDecimal
(
key
);
/// <summary>
/// <summary>
/// decimal?类型转换decimal 默认:0,保留2位小数
/// decimal?类型转换decimal 默认:0,保留2位小数
...
...
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