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
54ca9ffb
Commit
54ca9ffb
authored
Jun 01, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/医院其他绩效大改' into develop
parents
c21b1c42
80d9424a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
131 deletions
+136
-131
performance/Performance.Api/Template/医院人员绩效模板.xlsx
+0
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+10
-0
performance/Performance.EntityModels/Other/view_per_apr_amount.cs
+20
-0
performance/Performance.Services/ComputeService.cs
+104
-129
performance/Performance.Services/EmployeeService.cs
+2
-2
No files found.
performance/Performance.Api/Template/医院人员绩效模板.xlsx
View file @
54ca9ffb
No preview for this file type
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
54ca9ffb
...
...
@@ -7341,5 +7341,15 @@
核算单元
</summary>
</member>
<member
name=
"P:Performance.EntityModels.view_per_total_amount.UnitType"
>
<summary>
核算单元组别
</summary>
</member>
<member
name=
"P:Performance.EntityModels.view_per_total_amount.AccountingUnit"
>
<summary>
核算单元
</summary>
</member>
</members>
</doc>
performance/Performance.EntityModels/Other/view_per_apr_amount.cs
View file @
54ca9ffb
...
...
@@ -11,4 +11,24 @@ public class view_per_apr_amount : per_apr_amount
/// </summary>
public
string
AccountingUnit
{
get
;
set
;
}
}
public
class
view_per_total_amount
{
/// <summary>
/// 核算单元组别
/// </summary>
public
string
UnitType
{
get
;
set
;
}
/// <summary>
/// 核算单元
/// </summary>
public
string
AccountingUnit
{
get
;
set
;
}
public
string
PersonnelNumber
{
get
;
set
;
}
/// <summary>
/// 医院其他绩效
/// </summary>
public
decimal
Amount
{
get
;
set
;
}
/// <summary>
/// 是否被使用 默认false
/// </summary>
public
bool
Use
{
get
;
set
;
}
}
}
performance/Performance.Services/ComputeService.cs
View file @
54ca9ffb
...
...
@@ -468,16 +468,7 @@ public List<DeptResponse> GetOfficePerformance(int allotId)
public
List
<
DeptResponse
>
GetAdminPerformance
(
int
allotId
)
{
var
result
=
new
List
<
DeptResponse
>();
var
employees
=
perforPeremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
)
??
new
List
<
per_employee
>();
// 获取各科室 医院其他绩效
var
amounts
=
perapramountRepository
.
GetFullAmount
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
Status
==
3
);
var
otherPerformances
=
amounts
.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
UnitType
}).
Select
(
t
=>
new
{
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
UnitType
=
t
.
Key
.
UnitType
==
"行政后勤"
?
"行政工勤"
:
t
.
Key
.
UnitType
,
Amount
=
t
.
Sum
(
s
=>
s
.
Amount
)
}).
ToList
();
//var employees = perforPeremployeeRepository.GetEntities(t => t.AllotId == allotId) ?? new List<per_employee>();
var
clinicalTypes
=
new
UnitType
[]
{
UnitType
.
医生组
,
UnitType
.
其他医生组
,
UnitType
.
医技组
,
UnitType
.
其他医技组
,
UnitType
.
护理组
,
UnitType
.
其他护理组
,
UnitType
.
特殊核算组
};
var
clinicalTypesString
=
clinicalTypes
.
Select
(
w
=>
w
.
ToString
()).
ToList
();
...
...
@@ -596,13 +587,56 @@ public List<DeptResponse> GetAdminPerformance(int allotId)
RealGiveFee
=
t
.
Sum
(
w
=>
w
.
RealGiveFee
),
});
;
result
.
AddRange
(
officeResult
);
// 获取各科室 医院其他绩效
var
amounts
=
perapramountRepository
.
GetFullAmount
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
Status
==
3
);
var
otherPerformances
=
amounts
?.
GroupBy
(
t
=>
new
{
t
.
AccountingUnit
,
t
.
UnitType
})
.
Select
(
t
=>
new
view_per_total_amount
{
AccountingUnit
=
t
.
Key
.
AccountingUnit
,
UnitType
=
t
.
Key
.
UnitType
==
"行政后勤"
?
"行政工勤"
:
t
.
Key
.
UnitType
,
Amount
=
t
.
Sum
(
s
=>
s
.
Amount
)
??
0
,
Use
=
false
}).
ToList
();
// 医院其他绩效、科主任护士长管理绩效、合并实发
foreach
(
var
item
in
result
)
{
item
.
AprPerforAmount
=
otherPerformances
?.
Where
(
w
=>
w
.
AccountingUnit
==
item
.
AccountingUnit
&&
w
.
UnitType
==
item
.
UnitName
)?.
Sum
(
w
=>
w
.
Amount
)
??
0
;
item
.
AprPerforAmount
=
0
;
var
other
=
otherPerformances
?.
FirstOrDefault
(
w
=>
w
.
AccountingUnit
==
item
.
AccountingUnit
&&
w
.
UnitType
==
item
.
UnitName
);
if
(
other
!=
null
)
{
other
.
Use
=
true
;
item
.
AprPerforAmount
=
other
?.
Amount
??
0
;
}
item
.
AssessLaterManagementFee
=
item
.
AssessLaterManagementFee
??
0
;
item
.
RealGiveFee
=
(
item
.
RealGiveFee
??
0
)
+
item
.
AssessLaterManagementFee
+
item
.
AprPerforAmount
;
}
// 医院其他绩效匹配不上补充
var
otherResult
=
otherPerformances
?.
Where
(
w
=>
w
.
Use
==
false
)
.
Select
(
t
=>
new
DeptResponse
{
UnitName
=
"医院其他绩效"
,
AccountingUnit
=
t
.
AccountingUnit
,
Department
=
t
.
AccountingUnit
,
PerforFee
=
0
,
WorkloadFee
=
0
,
AssessBeforeOtherFee
=
0
,
PerforTotal
=
0
,
ScoringAverage
=
1
,
Extra
=
0
,
MedicineExtra
=
0
,
MaterialsExtra
=
0
,
AssessLaterOtherFee
=
0
,
AssessLaterPerforTotal
=
0
,
AdjustFactor
=
1
,
AdjustLaterOtherFee
=
0
,
AprPerforAmount
=
t
.
Amount
,
RealGiveFee
=
t
.
Amount
,
});
;
result
.
AddRange
(
otherResult
);
var
enumItems
=
EnumHelper
.
GetItems
<
AccountUnitType
>();
result
=
result
.
OrderBy
(
t
=>
enumItems
.
FirstOrDefault
(
e
=>
e
.
Name
==
t
.
UnitName
)?.
Value
)
/*.ThenBy(t => t.AccountingUnit)*/
.
ToList
();
...
...
@@ -711,18 +745,38 @@ public DeptDetailResponse GetDepartmentDetail(int allotId, int accountId, int ty
/// <returns></returns>
public
List
<
ComputeResponse
>
AllCompute
(
int
allotId
,
int
hospitalId
,
int
isShowManage
,
bool
isEmpDic
=
false
)
{
var
fullAmounts
=
perapramountRepository
.
GetFullAmount
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
Status
==
3
);
// 人员字典
var
employees
=
perforPeremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
);
// 获取一次次绩效结果
var
response
=
GetAllotPerformance
(
allotId
,
hospitalId
,
isShowManage
);
// 获取医院其他绩效汇总结果
var
totalAmounts
=
GetTotalAmount
(
allotId
);
// 获取一次绩效结果
var
one
=
GetAllotPerformance
(
allotId
,
hospitalId
,
isShowManage
);
// 获取二次绩效结果
var
seconds
=
GetSecondPerformance
(
allotId
,
employees
,
fullAmounts
);
if
(
seconds
!=
null
)
response
?.
AddRange
(
seconds
);
var
two
=
GetSecondPerformance
(
allotId
);
var
response
=
new
List
<
ComputeResponse
>();
if
(
one
!=
null
)
response
.
AddRange
(
one
);
if
(
two
!=
null
)
response
.
AddRange
(
two
);
// 补充医院其他绩效
if
(
fullAmounts
!=
null
&&
fullAmounts
.
Any
())
response
=
AddAprAmount
(
allotId
,
response
,
fullAmounts
);
AddAprAmount
(
response
,
totalAmounts
);
// 补充一次二次分配不存在,但医院其他绩效的人员信息
var
notMatchs
=
totalAmounts
?.
Where
(
w
=>
w
.
Use
==
false
)
.
Select
(
other
=>
{
per_employee
employee
=
employees
?.
FirstOrDefault
(
t
=>
t
.
UnitType
==
other
.
UnitType
&&
t
.
AccountingUnit
==
other
.
AccountingUnit
&&
t
.
PersonnelNumber
==
other
.
PersonnelNumber
);
var
bc
=
new
ComputeResponse
(
"医院其他绩效"
,
other
.
AccountingUnit
,
employee
?.
DoctorName
??
""
,
other
.
PersonnelNumber
,
employee
?.
JobTitle
??
""
);
bc
.
UnitType
=
other
.
UnitType
;
bc
.
OthePerfor
=
other
.
Amount
;
bc
.
RealGiveFee
=
other
.
Amount
;
return
bc
;
});
if
(
notMatchs
!=
null
)
response
.
AddRange
(
notMatchs
);
// 预留比例
if
(
response
!=
null
)
...
...
@@ -766,7 +820,30 @@ public List<ComputeResponse> AllCompute(int allotId, int hospitalId, int isShowM
}
}
response
.
RemoveAll
(
w
=>
w
.
PerforSumFee
==
0
&&
w
.
PerforManagementFee
==
0
&&
w
.
ShouldGiveFee
==
0
&&
w
.
OthePerfor
==
0
&&
w
.
RealGiveFee
==
0
);
return
response
?.
OrderByDescending
(
t
=>
t
.
AccountingUnit
).
ToList
();
return
response
?.
OrderByDescending
(
t
=>
t
.
UnitType
).
ThenBy
(
t
=>
t
.
AccountingUnit
).
ToList
();
}
/// <summary>
/// 获取医院其他绩效汇总结果
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
private
List
<
view_per_total_amount
>
GetTotalAmount
(
int
allotId
)
{
var
fullAmounts
=
perapramountRepository
.
GetFullAmount
(
t
=>
t
.
AllotId
==
allotId
&&
t
.
Status
==
3
);
var
totalAmounts
=
fullAmounts
?.
GroupBy
(
w
=>
new
{
w
.
AccountingUnit
,
w
.
UnitType
,
w
.
PersonnelNumber
})
.
Select
(
w
=>
new
view_per_total_amount
{
AccountingUnit
=
w
.
Key
.
AccountingUnit
,
UnitType
=
w
.
Key
.
UnitType
,
PersonnelNumber
=
w
.
Key
.
PersonnelNumber
,
Amount
=
w
.
Sum
(
t
=>
t
.
Amount
)
??
0
,
Use
=
false
,
});
return
totalAmounts
?.
ToList
()
??
new
List
<
view_per_total_amount
>();
}
/// <summary>
...
...
@@ -840,7 +917,7 @@ private List<ComputeResponse> GetAllotPerformance(int allotId, int hospitalId, i
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
private
List
<
ComputeResponse
>
GetSecondPerformance
(
int
allotId
,
List
<
per_employee
>
employees
,
List
<
view_per_apr_amount
>
fullAmounts
)
private
List
<
ComputeResponse
>
GetSecondPerformance
(
int
allotId
)
{
List
<
ComputeResponse
>
responses
=
new
List
<
ComputeResponse
>();
...
...
@@ -865,37 +942,6 @@ private List<ComputeResponse> GetSecondPerformance(int allotId, List<per_employe
return
comp
;
})?.
ToList
();
if
(
fullAmounts
==
null
||
!
fullAmounts
.
Any
())
{
return
responses
;
}
// 补充字典中该科室不存在,但有其它绩效的人员信息
foreach
(
var
second
in
disAgains
.
Select
(
w
=>
new
{
w
.
UnitType
,
w
.
Department
}).
Distinct
())
{
var
amounts
=
fullAmounts
.
Where
(
w
=>
w
.
UnitType
==
second
.
UnitType
&&
w
.
AccountingUnit
==
second
.
Department
);
var
jobNumbers
=
fullAmounts
.
Where
(
w
=>
w
.
UnitType
==
second
.
UnitType
&&
w
.
AccountingUnit
==
second
.
Department
)
.
Select
(
t
=>
t
.
PersonnelNumber
)
.
Distinct
();
foreach
(
var
jobNumber
in
jobNumbers
)
{
if
(!
responses
.
Any
(
w
=>
w
.
UnitType
==
second
.
UnitType
&&
w
.
AccountingUnit
==
second
.
Department
&&
w
.
JobNumber
==
jobNumber
))
{
per_employee
employee
=
employees
?.
FirstOrDefault
(
t
=>
t
.
UnitType
==
second
.
UnitType
&&
t
.
AccountingUnit
==
second
.
Department
&&
t
.
PersonnelNumber
==
jobNumber
);
if
(
employee
!=
null
&&
employee
.
UnitType
==
second
.
UnitType
)
{
var
bc
=
new
ComputeResponse
(
"二次绩效"
,
second
.
Department
,
employee
.
DoctorName
,
jobNumber
,
employee
.
JobTitle
);
bc
.
UnitType
=
employee
.
UnitType
;
responses
.
Add
(
bc
);
}
}
}
}
return
responses
;
}
...
...
@@ -904,91 +950,20 @@ private List<ComputeResponse> GetSecondPerformance(int allotId, List<per_employe
/// </summary>
/// <param name="allotId"></param>
/// <param name="computes"></param>
public
List
<
ComputeResponse
>
AddAprAmount
(
int
allotId
,
List
<
ComputeResponse
>
computes
,
List
<
view_per_apr_amount
>
ful
lAmounts
)
public
void
AddAprAmount
(
List
<
ComputeResponse
>
computes
,
List
<
view_per_total_amount
>
tota
lAmounts
)
{
if
(
computes
==
null
||
!
computes
.
Any
())
return
computes
;
List
<
string
>
uses
=
new
List
<
string
>();
foreach
(
var
item
in
computes
.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
JobNumber
)).
GroupBy
(
w
=>
new
{
w
.
AccountingUnit
,
w
.
JobNumber
}))
foreach
(
var
item
in
computes
?.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
JobNumber
)).
GroupBy
(
w
=>
new
{
w
.
UnitType
,
w
.
AccountingUnit
,
w
.
JobNumber
}))
{
// 补充过一次就不在补充了
var
emp
=
computes
.
Where
(
w
=>
w
.
AccountingUnit
==
item
.
Key
.
AccountingUnit
&&
w
.
JobNumber
==
item
.
Key
.
JobNumber
).
OrderByDescending
(
w
=>
w
.
Source
).
FirstOrDefault
();
var
apramount
=
fullAmounts
?.
Where
(
t
=>
t
.
AccountingUnit
==
emp
.
AccountingUnit
&&
emp
.
JobNumber
?.
Trim
()
==
t
.
PersonnelNumber
?.
Trim
());
var
apramount
=
totalAmounts
?.
FirstOrDefault
(
t
=>
t
.
UnitType
==
item
.
Key
.
UnitType
&&
t
.
AccountingUnit
==
item
.
Key
.
AccountingUnit
&&
item
.
Key
.
JobNumber
?.
Trim
()
==
t
.
PersonnelNumber
?.
Trim
());
// 如果医院其他绩效 已经被使用,则不再多次带出,防止单个人多次出现造成金额叠加
var
tag
=
$"
{(
emp
.
AccountingUnit
??
""
)}
-
{(
emp
.
JobNumber
??
""
)}
"
;
if
(
apramount
!=
null
&&
!
uses
.
Contains
(
tag
))
if
(
apramount
!=
null
)
{
emp
.
OthePerfor
=
apramount
?.
Sum
(
w
=>
w
.
Amount
)
??
0
;
uses
.
Add
(
tag
)
;
item
.
First
().
OthePerfor
=
apramount
.
Amount
;
apramount
.
Use
=
true
;
}
}
return
computes
;
}
///// <summary>
///// 返回绩效发放列表
///// 科主任护士长返回管理绩效
///// </summary>
///// <param name="allotId">绩效ID</param>
///// <returns></returns>
//public List<ComputeResponse> AllManageCompute(int allotId)
//{
// var list = new List<ComputeResponse>();
// var mTypes = new[] { AccountUnitType.护士长.ToString(), AccountUnitType.科主任.ToString(), AccountUnitType.行政中层.ToString(), AccountUnitType.行政高层.ToString() };
// var allot = _perforRescomputeRepository.GetEntities(t => t.AllotID == allotId && mTypes.Contains(t.AccountType))?.OrderByDescending(t => t.AccountingUnit);
// if (allot != null && allot.Any(t => t.AllotID == allotId))
// {
// var types = new List<string> { AccountUnitType.护士长.ToString(), AccountUnitType.科主任.ToString() };
// list = allot.Select(t => new ComputeResponse
// {
// Source = "一次绩效",
// AccountingUnit = t.AccountingUnit,
// EmployeeName = t.EmployeeName,
// JobNumber = t.JobNumber,
// JobTitle = t.JobTitle,
// RealGiveFee = types.Contains(t.AccountType) ? t.ShouldGiveFee : t.RealGiveFee
// }).ToList();
// }
// var again = _perforAgcomputeRepository.GetEntities(t => t.AllotId == allotId);
// if (again != null && again.Any())
// {
// var group = again.GroupBy(t => new { t.Department, t.WorkPost, t.JobNumber, t.PersonName })
// .Select(t => new
// {
// department = t.Key.Department,
// jobtitle = t.Key.WorkPost,
// jobnumber = t.Key.JobNumber,
// name = t.Key.PersonName,
// fee = t.Sum(g => g.RealGiveFee)
// });
// list.AddRange(group.Select(t => new ComputeResponse
// {
// Source = "二次绩效",
// AccountingUnit = t.department,
// JobNumber = t.jobnumber,
// JobTitle = t.jobtitle,
// EmployeeName = t.name,
// RealGiveFee = t.fee
// }).OrderByDescending(t => t.AccountingUnit));
// }
// var result = AddAprAmount(allotId, list);
// if (result != null)
// {
// var empDic = perforPeremployeeRepository.GetEntities(w => w.AllotId == allotId);
// foreach (var item in result)
// {
// var temp = item.RealGiveFee ?? 0;
// item.ReservedRatio = empDic?.FirstOrDefault(w => w.DoctorName == item.EmployeeName && w.PersonnelNumber == item.JobNumber)?.ReservedRatio ?? 0;
// item.ReservedRatioFee = temp * item.ReservedRatio;
// item.RealGiveFee = temp - item.ReservedRatioFee;
// }
// }
// return result;
//}
#
endregion
绩效发放列表
public
res_compute
GetComputeSingle
(
int
computeid
)
...
...
performance/Performance.Services/EmployeeService.cs
View file @
54ca9ffb
...
...
@@ -744,11 +744,11 @@ public List<TitleValue> GetPerforTypeDict(int allotId)
foreach
(
var
type
in
perForType
)
{
var
emp
=
aprAmountList
.
Where
(
t
=>
t
.
PerforType
==
type
&&
t
.
PersonnelNumber
==
num
);
dicData
.
Add
(
type
,
Math
.
Round
(
emp
?.
Sum
(
c
=>
c
.
Amount
)
??
0
).
ToString
());
dicData
.
Add
(
type
,
Math
.
Round
(
emp
?.
Sum
(
c
=>
c
.
Amount
)
??
0
,
2
).
ToString
());
}
var
sum
=
aprAmountList
.
Where
(
c
=>
c
.
PersonnelNumber
==
num
)?.
Sum
(
t
=>
t
.
Amount
);
dicData
.
Add
(
"合计"
,
Math
.
Round
(
sum
??
0
,
0
).
ToString
());
dicData
.
Add
(
"合计"
,
Math
.
Round
(
sum
??
0
,
2
).
ToString
());
others
.
Add
(
dicData
);
}
...
...
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