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
bb6b2950
Commit
bb6b2950
authored
Aug 10, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/二次分配行政工勤工作量带出' into develop
parents
7b8c1c74
d33a2b96
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
29 deletions
+33
-29
performance/Performance.Services/RedistributionService.cs
+33
-29
No files found.
performance/Performance.Services/RedistributionService.cs
View file @
bb6b2950
...
...
@@ -90,13 +90,16 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
var
allot
=
_perallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
second
.
AllotId
);
if
(
allot
==
null
)
throw
new
PerformanceException
(
"绩效记录不存在!"
);
// 填报模板带出 行政工勤 绩效
var
computes
=
_rescomputeRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allot
.
ID
&&
UnitTypeUtil
.
IsOffice
(
w
.
AccountType
));
var
loads
=
GetWorkLoads
(
allot
.
HospitalId
,
second
.
UnitType
,
second
.
Department
);
var
employees
=
_peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
second
.
AllotId
);
HandsonTableBase
handson
=
GetHandsonTable
(
computeMode
,
loads
);
// 先占位,更加选择加载指定范围数据
// 加载方式分 保存,上次,字典,测算表
var
loadEmployees
=
LoadEmployees
(
allot
,
second
,
overrideMode
,
out
bool
isSave
);
var
loadEmployees
=
LoadEmployees
(
allot
,
second
,
employees
,
overrideMode
,
out
bool
isSave
);
// 保存后则不再设置默认值
if
(!
isSave
)
{
...
...
@@ -106,6 +109,9 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
item
.
StaffCoefficient
=
item
.
StaffCoefficient
??
1
;
// 人员系数
item
.
ActualAttendance
=
item
.
ActualAttendance
??
DateTime
.
DaysInMonth
(
allot
.
Year
,
allot
.
Month
);
// 出勤
item
.
TitleCoefficient
=
item
.
TitleCoefficient
??
1
;
// 职称系数
// 填报模板带出 行政工勤 绩效
if
(
computeMode
==
ComputeMode
.
NotCalculate
)
item
.
WorkPerformance
=
computes
?.
Where
(
w
=>
w
.
AccountingUnit
==
second
.
Department
&&
w
.
JobNumber
?.
Trim
()
==
item
.
WorkNumber
?.
Trim
())?.
Sum
(
w
=>
w
.
GiveFee
)
??
0
;
}
}
//if (overrideMode == EmployeeSource.Workload) isSave = false;
...
...
@@ -388,9 +394,8 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
/// <param name="mode"></param>
/// <param name="isSave">true 保存 false 未保存</param>
/// <returns></returns>
private
List
<
ag_bodysource
>
LoadEmployees
(
per_allot
allot
,
ag_secondallot
second
,
EmployeeSource
mode
,
out
bool
isSave
)
private
List
<
ag_bodysource
>
LoadEmployees
(
per_allot
allot
,
ag_secondallot
second
,
List
<
per_employee
>
employees
,
EmployeeSource
mode
,
out
bool
isSave
)
{
var
employees
=
_peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
second
.
AllotId
);
isSave
=
false
;
// 默认流程
if
(
new
[]
{
EmployeeSource
.
Initial
,
EmployeeSource
.
Workload
}.
Contains
(
mode
))
...
...
@@ -447,17 +452,15 @@ List<ag_bodysource> LoadEmployeeByDictionary(ag_secondallot second, List<per_emp
foreach
(
var
personnelNumber
in
numbers
)
{
var
existEmp
=
employees
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
?.
Trim
()
==
personnelNumber
?.
Trim
());
if
(
existEmp
==
null
)
continue
;
var
data
=
new
ag_bodysource
{
SecondId
=
second
.
Id
,
Department
=
existEmp
.
AccountingUnit
,
WorkNumber
=
existEmp
.
P
ersonnelNumber
,
Name
=
existEmp
.
DoctorName
,
JobTitle
=
existEmp
.
JobTitle
,
ReservedRatio
=
existEmp
.
ReservedRatio
,
Department
=
existEmp
?.
AccountingUnit
??
""
,
WorkNumber
=
p
ersonnelNumber
,
Name
=
existEmp
?.
DoctorName
??
"花名册无信息"
,
JobTitle
=
existEmp
?.
JobTitle
??
""
,
ReservedRatio
=
existEmp
?.
ReservedRatio
??
1
,
Post
=
""
,
};
// 带出上次 人员系数、职称系数
...
...
@@ -1338,31 +1341,32 @@ public object RedistributionEmployee(SecondEmployeeDto request)
if
(
employees
!=
null
)
{
Func
<
per_employee
,
decimal
?>
getDistPerformance
=
(
emp
)
=>
0
;
// 不计算模板时,带出工作量绩效(一次分配中的应发绩效)
if
(
request
.
ComputeMode
==
(
int
)
ComputeMode
.
NotCalculate
)
{
if
(
UnitTypeUtil
.
IsOffice
(
second
.
UnitType
))
{
var
distPerformance
=
_rescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
second
.
AllotId
&&
employees
.
Select
(
s
=>
s
.
PersonnelNumber
).
Contains
(
t
.
JobNumber
));
getDistPerformance
=
(
emp
)
=>
{
if
(
second
.
Department
==
emp
.
AccountingUnit
)
return
distPerformance
?.
Where
(
w
=>
w
.
JobNumber
?.
Trim
()
==
emp
.
PersonnelNumber
?.
Trim
())?.
Sum
(
w
=>
w
.
GiveFee
);
return
0
;
};
}
}
//// 不计算模板时,带出工作量绩效(一次分配中的应发绩效)
//if (request.ComputeMode == (int)ComputeMode.NotCalculate)
//{
// if (UnitTypeUtil.IsOffice(second.UnitType))
// {
// // 填报模板带出 行政工勤 绩效
// var distPerformance = _rescomputeRepository.GetEntities(t => t.AllotID == second.AllotId && employees.Select(s => s.PersonnelNumber).Contains(t.JobNumber));
// getDistPerformance = (emp) =>
// {
// if (second.Department == emp.AccountingUnit)
// return distPerformance?.Where(w => w.JobNumber?.Trim() == emp.PersonnelNumber?.Trim())?.Sum(w => w.GiveFee) ?? 0;
// return 0;
// };
// }
//}
var
secondWorkload
=
GetSecondWorkloadByValue
(
second
.
AllotId
.
Value
,
second
.
UnitType
,
second
.
Department
);
var
monthDays
=
DateTime
.
DaysInMonth
(
allot
.
Year
,
allot
.
Month
);
foreach
(
var
employee
in
employees
)
{
Dictionary
<
string
,
object
>
item
=
new
Dictionary
<
string
,
object
>();
// 不计算模板时,带出工作量绩效(一次分配中的应发绩效)
if
(
request
.
ComputeMode
==
(
int
)
ComputeMode
.
NotCalculate
)
{
item
.
Add
(
nameof
(
ag_bodysource
.
WorkPerformance
),
getDistPerformance
(
employee
));
}
//
//
不计算模板时,带出工作量绩效(一次分配中的应发绩效)
//
if (request.ComputeMode == (int)ComputeMode.NotCalculate)
//
{
//
item.Add(nameof(ag_bodysource.WorkPerformance), getDistPerformance(employee));
//
}
item
.
Add
(
nameof
(
per_employee
.
UnitType
),
employee
.
UnitType
);
item
.
Add
(
nameof
(
ag_bodysource
.
SecondId
),
request
.
SecondId
);
...
...
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