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
f981c990
Commit
f981c990
authored
Jun 24, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG修复及其他功能完善
parent
e28d60e9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
30 deletions
+74
-30
performance/Performance.Api/Controllers/SecondAllotController.cs
+4
-4
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+5
-0
performance/Performance.EntityModels/Entity/ag_bodysource.cs
+5
-0
performance/Performance.Services/RedistributionService.cs
+59
-25
performance/Performance.Services/SecondAllotService.cs
+1
-1
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
f981c990
...
@@ -678,7 +678,7 @@ public ApiResponse RedistributionCompute([FromBody] SecondComputeDto request)
...
@@ -678,7 +678,7 @@ public ApiResponse RedistributionCompute([FromBody] SecondComputeDto request)
// 重算部分数据
// 重算部分数据
_redistributionService
.
RedistributionCompute
((
ComputeMode
)
request
.
ComputeMode
,
request
.
Head
,
cleanDatas
);
_redistributionService
.
RedistributionCompute
((
ComputeMode
)
request
.
ComputeMode
,
request
.
Head
,
cleanDatas
);
var
dic
=
_redistributionService
.
GetTableHeaderDictionary
((
ComputeMode
)
request
.
ComputeMode
,
second
,
loads
,
workloadGroups
);
var
dic
=
_redistributionService
.
GetTableHeaderDictionary
((
ComputeMode
)
request
.
ComputeMode
,
allot
,
second
,
loads
,
workloadGroups
);
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
Head
=
request
.
Head
,
Body
=
cleanDatas
,
Dic
=
dic
});
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
Head
=
request
.
Head
,
Body
=
cleanDatas
,
Dic
=
dic
});
}
}
catch
(
PerformanceException
ex
)
catch
(
PerformanceException
ex
)
...
@@ -717,7 +717,7 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
...
@@ -717,7 +717,7 @@ public ApiResponse RedistributionSave([FromBody] SecondComputeDto request)
// 清理无效数据 没有Tab标签的数据才是要计算的数据
// 清理无效数据 没有Tab标签的数据才是要计算的数据
var
cleanDatas
=
request
.
Body
.
Where
(
w
=>
w
.
Count
>
0
&&
w
.
GetValue
(
nameof
(
ResponseType
),
""
)
==
ResponseType
.
OK
.
ToString
()).
ToList
();
var
cleanDatas
=
request
.
Body
.
Where
(
w
=>
w
.
Count
>
0
&&
w
.
GetValue
(
nameof
(
ResponseType
),
""
)
==
ResponseType
.
OK
.
ToString
()).
ToList
();
if
(
cleanDatas
==
null
||
cleanDatas
.
Count
==
0
)
if
(
cleanDatas
==
null
||
cleanDatas
.
Count
==
0
)
throw
new
PerformanceException
(
"提交参数都是无效数据,请重新填写数据后
查看计算结果
!"
);
throw
new
PerformanceException
(
"提交参数都是无效数据,请重新填写数据后
保存
!"
);
var
result
=
secondAllotService
.
RedistributionSave
(
allot
,
second
,
request
.
Head
,
cleanDatas
);
var
result
=
secondAllotService
.
RedistributionSave
(
allot
,
second
,
request
.
Head
,
cleanDatas
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"保存失败"
);
return
result
?
new
ApiResponse
(
ResponseType
.
OK
)
:
new
ApiResponse
(
ResponseType
.
Fail
,
"保存失败"
);
...
@@ -821,9 +821,9 @@ public ApiResponse RedistributionDetail([FromBody] SecondBaseDto request)
...
@@ -821,9 +821,9 @@ public ApiResponse RedistributionDetail([FromBody] SecondBaseDto request)
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
var
workloadGroups
=
_redistributionService
.
GetTopWorkloadBodyGroups
(
loads
);
// 返回信息
// 返回信息
var
(
head
,
rows
)
=
_redistributionService
.
RedistributionDetail
((
ComputeMode
)
request
.
ComputeMode
,
allot
,
second
);
var
(
head
,
rows
)
=
_redistributionService
.
RedistributionDetail
((
ComputeMode
)
request
.
ComputeMode
,
allot
,
second
,
workloadGroups
);
var
dic
=
_redistributionService
.
GetTableHeaderDictionary
((
ComputeMode
)
request
.
ComputeMode
,
second
,
loads
,
workloadGroups
);
var
dic
=
_redistributionService
.
GetTableHeaderDictionary
((
ComputeMode
)
request
.
ComputeMode
,
allot
,
second
,
loads
,
workloadGroups
);
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
Head
=
head
,
Body
=
rows
,
Dic
=
dic
});
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
Head
=
head
,
Body
=
rows
,
Dic
=
dic
});
}
}
#
endregion
#
endregion
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
f981c990
...
@@ -469,6 +469,11 @@
...
@@ -469,6 +469,11 @@
职称系数
职称系数
</summary>
</summary>
</member>
</member>
<member
name=
"P:Performance.EntityModels.ag_bodysource.TitlePerformanceScore"
>
<summary>
职称绩效得分
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_bodysource.TitlePerformance"
>
<member
name=
"P:Performance.EntityModels.ag_bodysource.TitlePerformance"
>
<summary>
<summary>
职称绩效
职称绩效
...
...
performance/Performance.EntityModels/Entity/ag_bodysource.cs
View file @
f981c990
...
@@ -72,6 +72,11 @@ public class ag_bodysource
...
@@ -72,6 +72,11 @@ public class ag_bodysource
public
Nullable
<
decimal
>
TitleCoefficient
{
get
;
set
;
}
public
Nullable
<
decimal
>
TitleCoefficient
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 职称绩效得分
/// </summary>
public
Nullable
<
decimal
>
TitlePerformanceScore
{
get
;
set
;
}
/// <summary>
/// 职称绩效
/// 职称绩效
/// </summary>
/// </summary>
public
Nullable
<
decimal
>
TitlePerformance
{
get
;
set
;
}
public
Nullable
<
decimal
>
TitlePerformance
{
get
;
set
;
}
...
...
performance/Performance.Services/RedistributionService.cs
View file @
f981c990
...
@@ -35,6 +35,7 @@ public class RedistributionService : IAutoInjection
...
@@ -35,6 +35,7 @@ public class RedistributionService : IAutoInjection
private
readonly
PerforAgworktypesourceRepository
_agworktypesourceRepository
;
private
readonly
PerforAgworktypesourceRepository
_agworktypesourceRepository
;
private
readonly
PerforAgworkloadRepository
_agworkloadRepository
;
private
readonly
PerforAgworkloadRepository
_agworkloadRepository
;
private
readonly
PerforAgworkloadsourceRepository
_agworkloadsourceRepository
;
private
readonly
PerforAgworkloadsourceRepository
_agworkloadsourceRepository
;
private
readonly
PerforAgworkloadtypeRepository
_agworkloadtypeRepository
;
private
readonly
PerforImemployeelogisticsRepository
_imemployeelogisticsRepository
;
private
readonly
PerforImemployeelogisticsRepository
_imemployeelogisticsRepository
;
public
RedistributionService
(
public
RedistributionService
(
...
@@ -52,6 +53,7 @@ public class RedistributionService : IAutoInjection
...
@@ -52,6 +53,7 @@ public class RedistributionService : IAutoInjection
PerforAgworktypesourceRepository
agworktypesourceRepository
,
PerforAgworktypesourceRepository
agworktypesourceRepository
,
PerforAgworkloadRepository
agworkloadRepository
,
PerforAgworkloadRepository
agworkloadRepository
,
PerforAgworkloadsourceRepository
agworkloadsourceRepository
,
PerforAgworkloadsourceRepository
agworkloadsourceRepository
,
PerforAgworkloadtypeRepository
agworkloadtypeRepository
,
PerforImemployeelogisticsRepository
imemployeelogisticsRepository
)
PerforImemployeelogisticsRepository
imemployeelogisticsRepository
)
{
{
_logger
=
logger
;
_logger
=
logger
;
...
@@ -68,6 +70,7 @@ public class RedistributionService : IAutoInjection
...
@@ -68,6 +70,7 @@ public class RedistributionService : IAutoInjection
_agworktypesourceRepository
=
agworktypesourceRepository
;
_agworktypesourceRepository
=
agworktypesourceRepository
;
_agworkloadRepository
=
agworkloadRepository
;
_agworkloadRepository
=
agworkloadRepository
;
_agworkloadsourceRepository
=
agworkloadsourceRepository
;
_agworkloadsourceRepository
=
agworkloadsourceRepository
;
_agworkloadtypeRepository
=
agworkloadtypeRepository
;
_imemployeelogisticsRepository
=
imemployeelogisticsRepository
;
_imemployeelogisticsRepository
=
imemployeelogisticsRepository
;
}
}
#
endregion
#
endregion
...
@@ -129,7 +132,7 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
...
@@ -129,7 +132,7 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
}
}
var
head
=
LoadHead
(
computeMode
,
allot
,
second
);
var
head
=
LoadHead
(
computeMode
,
allot
,
second
);
var
dic
=
GetTableHeaderDictionary
(
computeMode
,
second
,
loads
);
var
dic
=
GetTableHeaderDictionary
(
computeMode
,
allot
,
second
,
loads
);
return
new
SecondDetailDto
{
Head
=
head
,
Body
=
handson
,
Dic
=
dic
};
return
new
SecondDetailDto
{
Head
=
head
,
Body
=
handson
,
Dic
=
dic
};
}
}
...
@@ -140,26 +143,27 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
...
@@ -140,26 +143,27 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
/// <param name="second"></param>
/// <param name="second"></param>
/// <param name="loads"></param>
/// <param name="loads"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
SecondColumnDictionary
>
GetTableHeaderDictionary
(
ComputeMode
computeMode
,
ag_secondallot
second
,
List
<
TitleValue
<
string
,
decimal
?>>
loads
,
List
<
SecondWorkLoadDto
>
workloadGroups
=
null
)
public
List
<
SecondColumnDictionary
>
GetTableHeaderDictionary
(
ComputeMode
computeMode
,
per_allot
allot
,
ag_secondallot
second
,
List
<
TitleValue
<
string
,
decimal
?>>
loads
,
List
<
SecondWorkLoadDto
>
workloadGroups
=
null
)
{
{
var
maps
=
new
List
<
SecondColumnDictionary
>()
var
maps
=
new
List
<
SecondColumnDictionary
>()
{
{
new
SecondColumnDictionary
(
"人员工号"
,
nameof
(
ag_bodysource
.
WorkNumber
),
true
,
100
,
fix
:
"Left"
),
new
SecondColumnDictionary
(
"人员工号"
,
nameof
(
ag_bodysource
.
WorkNumber
),
true
,
100
,
fix
:
"Left"
),
new
SecondColumnDictionary
(
"姓名"
,
nameof
(
ag_bodysource
.
Name
),
true
,
100
,
fix
:
"Left"
),
new
SecondColumnDictionary
(
"姓名"
,
nameof
(
ag_bodysource
.
Name
),
true
,
100
,
fix
:
"Left"
),
new
SecondColumnDictionary
(
"科室"
,
nameof
(
ag_bodysource
.
Department
),
true
,
100
,
fix
:
"Left"
),
new
SecondColumnDictionary
(
"科室"
,
nameof
(
ag_bodysource
.
Department
),
true
,
100
,
fix
:
"Left"
),
new
SecondColumnDictionary
(
"
主管
"
,
nameof
(
ag_bodysource
.
Post
),
true
,
100
),
new
SecondColumnDictionary
(
"
领取平均绩效
"
,
nameof
(
ag_bodysource
.
Post
),
true
,
100
),
new
SecondColumnDictionary
(
"人员系数"
,
nameof
(
ag_bodysource
.
StaffCoefficient
),
false
,
200
,
color
:
"title_color"
),
new
SecondColumnDictionary
(
"人员系数"
,
nameof
(
ag_bodysource
.
StaffCoefficient
),
false
,
200
,
color
:
"title_color"
),
new
SecondColumnDictionary
(
"出勤"
,
nameof
(
ag_bodysource
.
ActualAttendance
),
false
,
201
,
color
:
"title_color"
),
new
SecondColumnDictionary
(
"出勤"
,
nameof
(
ag_bodysource
.
ActualAttendance
),
false
,
201
,
color
:
"title_color"
),
new
SecondColumnDictionary
(
"职称"
,
nameof
(
ag_bodysource
.
JobTitle
),
false
,
202
,
color
:
"title_color"
),
new
SecondColumnDictionary
(
"职称"
,
nameof
(
ag_bodysource
.
JobTitle
),
false
,
202
,
color
:
"title_color"
),
new
SecondColumnDictionary
(
"职称系数"
,
nameof
(
ag_bodysource
.
TitleCoefficient
),
false
,
203
,
color
:
"title_color"
),
new
SecondColumnDictionary
(
"职称系数"
,
nameof
(
ag_bodysource
.
TitleCoefficient
),
false
,
203
,
color
:
"title_color"
),
new
SecondColumnDictionary
(
"职称绩效得分"
,
nameof
(
ag_bodysource
.
TitlePerformanceScore
),
false
,
204
,
color
:
"title_color"
),
new
SecondColumnDictionary
(
"职称绩效"
,
nameof
(
ag_bodysource
.
TitlePerformance
),
true
,
299
),
new
SecondColumnDictionary
(
"职称绩效"
,
nameof
(
ag_bodysource
.
TitlePerformance
),
true
,
299
),
new
SecondColumnDictionary
(
"工作量绩效合计"
,
nameof
(
ag_bodysource
.
WorkPerformance
),
true
,
399
),
new
SecondColumnDictionary
(
"工作量绩效合计"
,
nameof
(
ag_bodysource
.
WorkPerformance
),
true
,
399
),
new
SecondColumnDictionary
(
"单项奖励合计"
,
nameof
(
ag_bodysource
.
DeptReward
),
true
,
499
),
new
SecondColumnDictionary
(
"单项奖励合计"
,
nameof
(
ag_bodysource
.
DeptReward
),
true
,
499
),
new
SecondColumnDictionary
(
"可分配绩效"
,
nameof
(
ag_bodysource
.
DistPerformance
),
true
,
500
),
new
SecondColumnDictionary
(
"可分配绩效"
,
nameof
(
ag_bodysource
.
DistPerformance
),
true
,
500
),
new
SecondColumnDictionary
(
"医院其他绩效"
,
nameof
(
ag_bodysource
.
OtherPerformance
),
true
,
501
),
new
SecondColumnDictionary
(
"医院其他绩效
(参考)
"
,
nameof
(
ag_bodysource
.
OtherPerformance
),
true
,
501
),
new
SecondColumnDictionary
(
"夜班工作量绩效"
,
nameof
(
ag_bodysource
.
NightWorkPerformance
),
true
,
502
),
new
SecondColumnDictionary
(
"夜班工作量绩效"
,
nameof
(
ag_bodysource
.
NightWorkPerformance
),
true
,
502
),
//new SecondColumnDictionary("预留比例",nameof(ag_bodysource.ReservedRatio),false,601 ),
//new SecondColumnDictionary("预留比例",nameof(ag_bodysource.ReservedRatio),false,601 ),
...
@@ -175,22 +179,21 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
...
@@ -175,22 +179,21 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
workloadGroups
=
GetTopWorkloadBodyGroups
(
loads
);
workloadGroups
=
GetTopWorkloadBodyGroups
(
loads
);
int
workloadSort
=
300
;
int
workloadSort
=
300
;
var
index
=
0
;
foreach
(
var
item
in
loads
.
Where
(
w
=>
!
w
.
Title
.
StartsWithIgnoreCase
(
"SingleAwards_"
)))
foreach
(
var
item
in
loads
.
Where
(
w
=>
!
w
.
Title
.
StartsWithIgnoreCase
(
"SingleAwards_"
)))
{
{
var
index
=
workloadGroups
.
FindIndex
(
w
=>
w
.
Items
!=
null
&&
w
.
Items
.
Any
(
im
=>
im
.
EqualsIgnoreCase
(
item
.
Title
)));
if
(
workloadGroups
.
Any
(
w
=>
w
.
Items
!=
null
&&
w
.
Items
.
Any
(
im
=>
im
.
EqualsIgnoreCase
(
item
.
Title
))))
index
=
workloadGroups
.
FindIndex
(
w
=>
w
.
Items
!=
null
&&
w
.
Items
.
Any
(
im
=>
im
.
EqualsIgnoreCase
(
item
.
Title
)));
maps
.
Add
(
new
SecondColumnDictionary
(
item
.
Value
,
item
.
Title
,
false
,
++
workloadSort
,
type
:
"Workload"
,
color
:
$"workload_color
{
index
}
"
));
maps
.
Add
(
new
SecondColumnDictionary
(
item
.
Value
,
item
.
Title
,
false
,
++
workloadSort
,
type
:
"Workload"
,
color
:
$"workload_color
{
index
}
"
));
}
}
// 多工作量加载
// 多工作量加载
var
headDynamic
=
_agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
second
.
Id
);
var
headDynamic
=
_agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
second
.
Id
)
??
new
List
<
ag_worktype_source
>();
if
(
headDynamic
!=
null
&&
headDynamic
.
Any
())
{
foreach
(
var
item
in
headDynamic
.
OrderBy
(
t
=>
t
.
Id
))
foreach
(
var
item
in
headDynamic
.
OrderBy
(
t
=>
t
.
Id
))
{
{
maps
.
Add
(
new
SecondColumnDictionary
(
item
.
FieldName
,
item
.
FieldId
,
true
,
1
,
"Top"
));
maps
.
Add
(
new
SecondColumnDictionary
(
item
.
FieldName
,
item
.
FieldId
,
true
,
1
,
"Top"
));
}
}
}
}
}
// 单项奖励
// 单项奖励
int
singleAwardsSort
=
400
;
int
singleAwardsSort
=
400
;
foreach
(
var
item
in
loads
.
Where
(
w
=>
w
.
Title
.
StartsWithIgnoreCase
(
"SingleAwards_"
)))
foreach
(
var
item
in
loads
.
Where
(
w
=>
w
.
Title
.
StartsWithIgnoreCase
(
"SingleAwards_"
)))
...
@@ -272,7 +275,8 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
...
@@ -272,7 +275,8 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
PaymentOfTheMonth
),
$"
{
allot
.
Year
}
年
{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
月"
);
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
PaymentOfTheMonth
),
$"
{
allot
.
Year
}
年
{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
月"
);
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
TotalDistPerformance
),
(
allot
.
States
==
(
int
)
AllotStates
.
GenerateSucceed
)
?
(
second
.
RealGiveFee
??
0
)
:
1000
);
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
TotalDistPerformance
),
(
allot
.
States
==
(
int
)
AllotStates
.
GenerateSucceed
)
?
(
second
.
RealGiveFee
??
0
)
:
1000
);
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
NightShiftWorkPerforTotal
),
(
allot
.
States
==
(
int
)
AllotStates
.
GenerateSucceed
)
?
(
second
.
NightShiftWorkPerforFee
??
0
)
:
0
);
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
NightShiftWorkPerforTotal
),
(
allot
.
States
==
(
int
)
AllotStates
.
GenerateSucceed
)
?
(
second
.
NightShiftWorkPerforFee
??
0
)
:
0
);
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
TotalPerformance
),
(
second
.
RealGiveFee
??
0
)
-
(
second
.
NightShiftWorkPerforFee
??
0
));
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
TotalPerformance
),
head
.
GetDecimal
(
nameof
(
ag_headsource
.
TotalDistPerformance
))
-
head
.
GetDecimal
(
nameof
(
ag_headsource
.
NightShiftWorkPerforTotal
)));
head
.
AddOrUpdate
(
"Remark"
,
(
allot
.
States
==
(
int
)
AllotStates
.
GenerateSucceed
)
?
""
:
"(非正式)"
);
// 横向 纵向 特有顶部信息
// 横向 纵向 特有顶部信息
if
(
computeMode
!=
ComputeMode
.
NotCalculate
)
if
(
computeMode
!=
ComputeMode
.
NotCalculate
)
{
{
...
@@ -283,14 +287,34 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
...
@@ -283,14 +287,34 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
DaysFullAttendance
),
history
?.
DaysFullAttendance
??
DateTime
.
DaysInMonth
(
allot
.
Year
,
allot
.
Month
));
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
DaysFullAttendance
),
history
?.
DaysFullAttendance
??
DateTime
.
DaysInMonth
(
allot
.
Year
,
allot
.
Month
));
// 多工作量加载
// 多工作量加载
var
headDynamic
=
_agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
second
.
Id
);
var
status
=
(
new
int
[]
{
(
int
)
SecondAllotStatus
.
WaitReview
,
(
int
)
SecondAllotStatus
.
PassAudit
});
if
(
headDynamic
!=
null
&&
headDynamic
.
Any
())
var
headDynamic
=
_agworktypesourceRepository
.
GetEntities
(
t
=>
t
.
SecondId
==
second
.
Id
)
??
new
List
<
ag_worktype_source
>();
// 已提交
if
(
second
.
Status
.
HasValue
&&
status
.
Contains
(
second
.
Status
.
Value
))
{
{
foreach
(
var
item
in
headDynamic
.
Where
(
w
=>
w
.
FieldId
.
StartsWithIgnoreCase
(
"Workload_Ratio_"
)).
OrderBy
(
t
=>
t
.
Id
))
foreach
(
var
item
in
headDynamic
.
Where
(
w
=>
w
.
FieldId
.
StartsWithIgnoreCase
(
"Workload_Ratio_"
)).
OrderBy
(
t
=>
t
.
Id
))
{
{
head
.
AddOrUpdate
(
item
.
FieldId
,
item
.
Value
??
0
);
head
.
AddOrUpdate
(
item
.
FieldId
,
item
.
Value
??
0
);
}
}
}
}
// 未提交
else
{
List
<
decimal
>
ratios
=
new
List
<
decimal
>();
var
workloadTypes
=
_agworkloadtypeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
&&
t
.
Department
==
second
.
Department
&&
t
.
UnitType
==
second
.
UnitType
)
??
new
List
<
ag_workload_type
>();
foreach
(
var
workitem
in
workloadTypes
)
{
var
name
=
$"Workload_Ratio_
{
workitem
.
Id
}
"
;
var
ratio
=
headDynamic
.
FirstOrDefault
(
w
=>
w
.
FieldId
.
EqualsIgnoreCase
(
name
))?.
Value
??
0
m
;
ratios
.
Add
(
ratio
);
head
.
AddOrUpdate
(
name
,
ratio
);
}
// 强制年资系数及工作量系数合计 等于 1
var
seniorityTitlesAccountedPerformance
=
head
.
GetDecimal
(
nameof
(
ag_headsource
.
SeniorityTitlesAccountedPerformance
));
var
defaultWorkload
=
1
-
seniorityTitlesAccountedPerformance
-
ratios
.
Sum
();
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
Workload_Ratio_Default
),
defaultWorkload
);
}
}
}
return
head
;
return
head
;
}
}
...
@@ -494,7 +518,7 @@ private List<string> LoadEmployees_OfficeExcel(ag_secondallot second)
...
@@ -494,7 +518,7 @@ private List<string> LoadEmployees_OfficeExcel(ag_secondallot second)
private
HandsonTableBase
ComputeMode_Format1
(
List
<
string
>
colHeaders
,
List
<
HandsonColumn
>
columns
)
private
HandsonTableBase
ComputeMode_Format1
(
List
<
string
>
colHeaders
,
List
<
HandsonColumn
>
columns
)
{
{
HandsonTableBase
handson
=
new
HandsonTableBase
();
HandsonTableBase
handson
=
new
HandsonTableBase
();
handson
.
ColHeaders
.
AddRange
(
new
string
[]
{
"工号"
,
"姓名"
,
/* "核算单元", "
主管
",*/
"职称绩效"
,
"工作量绩效工资"
,
});
handson
.
ColHeaders
.
AddRange
(
new
string
[]
{
"工号"
,
"姓名"
,
/* "核算单元", "
领取平均绩效
",*/
"职称绩效"
,
"工作量绩效工资"
,
});
handson
.
Columns
.
AddRange
(
handson
.
Columns
.
AddRange
(
new
HandsonColumn
[]
new
HandsonColumn
[]
{
{
...
@@ -522,7 +546,7 @@ private HandsonTableBase ComputeMode_Format1(List<string> colHeaders, List<Hands
...
@@ -522,7 +546,7 @@ private HandsonTableBase ComputeMode_Format1(List<string> colHeaders, List<Hands
private
HandsonTableBase
ComputeMode_Format2
(
List
<
string
>
colHeaders
,
List
<
HandsonColumn
>
columns
)
private
HandsonTableBase
ComputeMode_Format2
(
List
<
string
>
colHeaders
,
List
<
HandsonColumn
>
columns
)
{
{
HandsonTableBase
handson
=
new
HandsonTableBase
();
HandsonTableBase
handson
=
new
HandsonTableBase
();
handson
.
ColHeaders
.
AddRange
(
new
string
[]
{
"工号"
,
"姓名"
,
/*"核算单元",*/
"
主管
"
,
"人员系数"
,
"出勤"
,
"职称"
,
"职称系数"
,
});
handson
.
ColHeaders
.
AddRange
(
new
string
[]
{
"工号"
,
"姓名"
,
/*"核算单元",*/
"
领取平均绩效
"
,
"人员系数"
,
"出勤"
,
"职称"
,
"职称系数"
,
});
handson
.
Columns
.
AddRange
(
handson
.
Columns
.
AddRange
(
new
HandsonColumn
[]
new
HandsonColumn
[]
{
{
...
@@ -642,7 +666,7 @@ private void otherPerformance(Dictionary<string, object> head, List<Dictionary<s
...
@@ -642,7 +666,7 @@ private void otherPerformance(Dictionary<string, object> head, List<Dictionary<s
/// <param name="workloadGroups"></param>
/// <param name="workloadGroups"></param>
public
void
ResultCompute
(
ComputeMode
computeMode
,
Dictionary
<
string
,
object
>
head
,
List
<
Dictionary
<
string
,
object
>>
rows
,
List
<
TitleValue
<
string
,
decimal
?>>
loads
,
List
<
SecondWorkLoadDto
>
workloadGroups
)
public
void
ResultCompute
(
ComputeMode
computeMode
,
Dictionary
<
string
,
object
>
head
,
List
<
Dictionary
<
string
,
object
>>
rows
,
List
<
TitleValue
<
string
,
decimal
?>>
loads
,
List
<
SecondWorkLoadDto
>
workloadGroups
)
{
{
var
specialPostName
=
new
string
[]
{
"科主任/护士长"
,
"主任"
,
"
主管"
,
"
是"
,
};
var
specialPostName
=
new
string
[]
{
"科主任/护士长"
,
"主任"
,
"是"
,
};
if
(
computeMode
==
ComputeMode
.
NotCalculate
)
if
(
computeMode
==
ComputeMode
.
NotCalculate
)
{
{
...
@@ -737,7 +761,7 @@ private void topWorkloadCalculate(Dictionary<string, object> head, List<SecondWo
...
@@ -737,7 +761,7 @@ private void topWorkloadCalculate(Dictionary<string, object> head, List<SecondWo
{
{
foreach
(
var
workload
in
workloadGroups
)
foreach
(
var
workload
in
workloadGroups
)
{
{
var
amount
=
GetDecimal2
(
head
,
nameof
(
ag_headsource
.
TheTotalAllocationOfPerformanceResults
))
*
GetDecimal2
(
head
,
$"Workload_Ratio_
{
workload
.
Name
}
"
);
var
amount
=
GetDecimal2
(
head
.
GetDecimal
(
nameof
(
ag_headsource
.
TheTotalAllocationOfPerformanceResults
))
*
head
.
GetDecimal
(
$"Workload_Ratio_
{
workload
.
Name
}
"
)
);
head
.
AddOrUpdate
(
$"Workload_Amount_
{
workload
.
Name
}
"
,
amount
);
head
.
AddOrUpdate
(
$"Workload_Amount_
{
workload
.
Name
}
"
,
amount
);
}
}
}
}
...
@@ -747,7 +771,7 @@ private void topWorkloadCalculate(Dictionary<string, object> head, List<SecondWo
...
@@ -747,7 +771,7 @@ private void topWorkloadCalculate(Dictionary<string, object> head, List<SecondWo
/// <param name="head"></param>
/// <param name="head"></param>
private
void
topSeniorityCalculate
(
Dictionary
<
string
,
object
>
head
)
private
void
topSeniorityCalculate
(
Dictionary
<
string
,
object
>
head
)
{
{
var
amount
=
GetDecimal2
(
head
,
nameof
(
ag_headsource
.
SeniorityTitlesAccountedPerformance
))
*
GetDecimal2
(
head
,
nameof
(
ag_headsource
.
TheTotalAllocationOfPerformanceResults
));
var
amount
=
GetDecimal2
(
head
.
GetDecimal
(
nameof
(
ag_headsource
.
SeniorityTitlesAccountedPerformance
))
*
head
.
GetDecimal
(
nameof
(
ag_headsource
.
TheTotalAllocationOfPerformanceResults
)
));
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
SeniorityTitlesPerformance
),
amount
);
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
SeniorityTitlesPerformance
),
amount
);
}
}
...
@@ -758,13 +782,13 @@ private void topSeniorityCalculate(Dictionary<string, object> head)
...
@@ -758,13 +782,13 @@ private void topSeniorityCalculate(Dictionary<string, object> head)
/// <param name="rows"></param>
/// <param name="rows"></param>
private
void
overviewCalculate
(
Dictionary
<
string
,
object
>
head
,
List
<
Dictionary
<
string
,
object
>>
rows
)
private
void
overviewCalculate
(
Dictionary
<
string
,
object
>
head
,
List
<
Dictionary
<
string
,
object
>>
rows
)
{
{
//夜班工作量绩效总和
//
//
夜班工作量绩效总和
var
nightShiftWorkPerforTotal
=
rows
.
Sum
(
row
=>
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
NightWorkPerformance
)));
//
var nightShiftWorkPerforTotal = rows.Sum(row => GetDecimal2(row, nameof(ag_bodysource.NightWorkPerformance)));
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
NightShiftWorkPerforTotal
),
nightShiftWorkPerforTotal
);
//
head.AddOrUpdate(nameof(ag_headsource.NightShiftWorkPerforTotal), nightShiftWorkPerforTotal);
// 可分配绩效(顶栏) = 科室总绩效 - 夜班绩效(顶栏)
// 可分配绩效(顶栏) = 科室总绩效 - 夜班绩效(顶栏)
var
totalPerformance
=
GetDecimal2
(
head
,
nameof
(
ag_headsource
.
TotalDistPerformance
))
-
GetDecimal2
(
head
,
nameof
(
ag_headsource
.
NightShiftWorkPerforTotal
));
var
totalPerformance
=
GetDecimal2
(
head
,
nameof
(
ag_headsource
.
TotalDistPerformance
))
-
GetDecimal2
(
head
,
nameof
(
ag_headsource
.
NightShiftWorkPerforTotal
));
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
TotalPerformance
),
totalPerformance
);
head
.
AddOrUpdate
(
nameof
(
ag_headsource
.
TotalPerformance
),
totalPerformance
);
////医院其他绩效总和
////
医院其他绩效总和
//var otherPerformance = rows.Sum(row => GetDecimal2(row, nameof(ag_bodysource.OtherPerformance)));
//var otherPerformance = rows.Sum(row => GetDecimal2(row, nameof(ag_bodysource.OtherPerformance)));
//head.AddOrUpdate(nameof(ag_headsource.HosOtherPerformance), otherPerformance);
//head.AddOrUpdate(nameof(ag_headsource.HosOtherPerformance), otherPerformance);
//科室核算人数 = 人员系数 * 实际出勤
//科室核算人数 = 人员系数 * 实际出勤
...
@@ -838,8 +862,11 @@ private void titleCoefficientCalculate(Dictionary<string, object> head, List<Dic
...
@@ -838,8 +862,11 @@ 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
=
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
ActualAttendance
))
*
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
TitleCoefficient
));
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
TitlePerformanceScore
),
GetDecimal2
(
titlePerformanceScore
));
//个人职称绩效 = ( 当前行实际出勤 * 当前行职称系数 ) / 职称系数总和* 年资职称绩效总和
//个人职称绩效 = ( 当前行实际出勤 * 当前行职称系数 ) / 职称系数总和* 年资职称绩效总和
var
titlePerformance
=
total_titleCoefficient
==
0
?
0
:
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
ActualAttendance
))
*
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
TitleCoefficient
))
/
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
));
}
}
}
}
...
@@ -1139,11 +1166,19 @@ public List<SecondComputeCheckResultDto> CheckData(ag_secondallot second, List<D
...
@@ -1139,11 +1166,19 @@ public List<SecondComputeCheckResultDto> CheckData(ag_secondallot second, List<D
/// <param name="allot"></param>
/// <param name="allot"></param>
/// <param name="second"></param>
/// <param name="second"></param>
/// <returns></returns>
/// <returns></returns>
public
(
Dictionary
<
string
,
object
>
head
,
List
<
Dictionary
<
string
,
object
>>
rows
)
RedistributionDetail
(
ComputeMode
computeMode
,
per_allot
allot
,
ag_secondallot
second
)
public
(
Dictionary
<
string
,
object
>
head
,
List
<
Dictionary
<
string
,
object
>>
rows
)
RedistributionDetail
(
ComputeMode
computeMode
,
per_allot
allot
,
ag_secondallot
second
,
List
<
SecondWorkLoadDto
>
workloadGroups
)
{
{
var
head
=
LoadHead
(
computeMode
,
allot
,
second
);
var
loadEmployees
=
_agbodysourceRepository
.
GetEntities
(
w
=>
w
.
SecondId
==
second
.
Id
);
var
loadEmployees
=
_agbodysourceRepository
.
GetEntities
(
w
=>
w
.
SecondId
==
second
.
Id
);
var
rows
=
LoadWorkload
(
allot
,
second
,
loadEmployees
);
var
rows
=
LoadWorkload
(
allot
,
second
,
loadEmployees
);
var
head
=
LoadHead
(
computeMode
,
allot
,
second
);
if
(
computeMode
!=
ComputeMode
.
NotCalculate
)
{
overviewCalculate
(
head
,
rows
);
// 计算顶部工作量
topWorkloadCalculate
(
head
,
workloadGroups
);
// 计算顶部年资系数
topSeniorityCalculate
(
head
);
}
return
(
head
,
rows
);
return
(
head
,
rows
);
}
}
...
@@ -1218,7 +1253,6 @@ public object RedistributionEmployee(SecondEmployeeDto request)
...
@@ -1218,7 +1253,6 @@ public object RedistributionEmployee(SecondEmployeeDto request)
{
{
foreach
(
var
score
in
loads
.
Where
(
w
=>
w
.
Title
.
StartsWithIgnoreCase
(
"AssessmentScore_"
)).
ToList
())
foreach
(
var
score
in
loads
.
Where
(
w
=>
w
.
Title
.
StartsWithIgnoreCase
(
"AssessmentScore_"
)).
ToList
())
{
{
if
(
score
.
Value
==
null
)
item
.
AddOrUpdate
(
score
.
Title
,
100
);
item
.
AddOrUpdate
(
score
.
Title
,
100
);
}
}
}
}
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
f981c990
...
@@ -1420,7 +1420,7 @@ private List<ag_secondallot> GetNotAuditSeconds(int hospitalId, ag_workload_type
...
@@ -1420,7 +1420,7 @@ private List<ag_secondallot> GetNotAuditSeconds(int hospitalId, ag_workload_type
/**
/**
* 添加数据时注意避免给已经提交过的数据添加,否则会造成提交时的数据和显示数据不一致
* 添加数据时注意避免给已经提交过的数据添加,否则会造成提交时的数据和显示数据不一致
*/
*/
return
agsecondallotRepository
.
GetEntities
(
t
=>
allots
.
Select
(
w
=>
w
.
ID
).
Contains
(
t
.
AllotId
.
Value
)
&&
t
.
Department
==
type
.
Department
&&
t
.
UnitType
==
type
.
UnitType
&&
IsAudit
(
t
.
Status
))
??
seconds
;
return
agsecondallotRepository
.
GetEntities
(
t
=>
allots
.
Select
(
w
=>
w
.
ID
).
Contains
(
t
.
AllotId
.
Value
)
&&
t
.
Department
==
type
.
Department
&&
t
.
UnitType
==
type
.
UnitType
&&
!
IsAudit
(
t
.
Status
))
??
seconds
;
}
}
/// <summary>
/// <summary>
...
...
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