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
ffae97f9
Commit
ffae97f9
authored
Jun 29, 2021
by
钟博
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/新二次分配' into release/v20210625二次绩效划拨合并
parents
1b2fe38b
2d14e9c6
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
204 additions
and
15 deletions
+204
-15
performance/Performance.Api/Controllers/SecondAllotController.cs
+12
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+6
-0
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+5
-0
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+26
-1
performance/Performance.DtoModels/Request/WorkloadRequest.cs
+5
-0
performance/Performance.EntityModels/Entity/ag_bodysource.cs
+6
-1
performance/Performance.EntityModels/Entity/ag_workload.cs
+5
-0
performance/Performance.EntityModels/Other/view_second_workload_result.cs
+27
-0
performance/Performance.Repository/PerforPerAllotRepository.cs
+51
-0
performance/Performance.Services/RedistributionService.cs
+44
-13
performance/Performance.Services/SecondAllotService.cs
+17
-0
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
ffae97f9
...
...
@@ -298,6 +298,18 @@ public ApiResponse WorkTypeList([FromBody] WorkloadRequest request, int secondId
}
/// <summary>
/// 获取二次分配 提取工作量带出字典
/// </summary>
/// <returns></returns>
[
Route
(
"api/second/worktype/map/{secondId}"
)]
[
HttpPost
]
public
ApiResponse
WorkloadMap
(
int
secondId
)
{
var
result
=
secondAllotService
.
WorkloadMap
(
secondId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 保存二次绩效工作量类型
/// </summary>
/// <returns></returns>
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
ffae97f9
...
...
@@ -1551,6 +1551,12 @@
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.WorkloadMap(System.Int32)"
>
<summary>
获取二次分配 提取工作量带出字典
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.SingleSave(Performance.EntityModels.ag_workload_type,System.Int32)"
>
<summary>
保存二次绩效工作量类型
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
ffae97f9
...
...
@@ -2525,6 +2525,11 @@
是否是单项奖励
</summary>
</member>
<member
name=
"P:Performance.DtoModels.WorkloadRequest.SourceCategory"
>
<summary>
工作量带出HIS来源
</summary>
</member>
<member
name=
"P:Performance.DtoModels.WorkyearRequest.MaxRange"
>
<summary>
最大工龄范围(小于)
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
ffae97f9
...
...
@@ -511,7 +511,7 @@
</member>
<member
name=
"P:Performance.EntityModels.ag_bodysource.RealAmount"
>
<summary>
实发绩效
工资金额
实发绩效
(不含医院其他绩效)
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_bodysource.Signature"
>
...
...
@@ -529,6 +529,11 @@
预留金额
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_bodysource.ReferToRealAmount"
>
<summary>
实发绩效(参考,含医院其他绩效)
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ag_compute"
>
<summary>
二次绩效结果表
...
...
@@ -1379,6 +1384,11 @@
-1、单项奖励 0、工作量占比 ..(自定义占比)
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_workload.SourceCategory"
>
<summary>
工作量来源类型
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ag_workload_source"
>
<summary>
...
...
@@ -7609,5 +7619,20 @@
是否被使用 默认false
</summary>
</member>
<member
name=
"P:Performance.EntityModels.view_second_workload_result.UnitType"
>
<summary>
核算单元组别
</summary>
</member>
<member
name=
"P:Performance.EntityModels.view_second_workload_result.AccountingUnit"
>
<summary>
核算单元
</summary>
</member>
<member
name=
"P:Performance.EntityModels.view_second_workload_result.HISDeptName"
>
<summary>
统计的HIS的原始科室名称
</summary>
</member>
</members>
</doc>
performance/Performance.DtoModels/Request/WorkloadRequest.cs
View file @
ffae97f9
...
...
@@ -51,6 +51,11 @@ public class WorkloadRequest
/// 是否是单项奖励
/// </summary>
public
bool
IsSingleAwards
{
get
;
set
;
}
/// <summary>
/// 工作量带出HIS来源
/// </summary>
public
string
SourceCategory
{
get
;
set
;
}
}
public
class
WorkloadRequestValidator
:
AbstractValidator
<
WorkloadRequest
>
{
...
...
performance/Performance.EntityModels/Entity/ag_bodysource.cs
View file @
ffae97f9
...
...
@@ -127,7 +127,7 @@ public class ag_bodysource
public
Nullable
<
decimal
>
NightWorkPerformance
{
get
;
set
;
}
/// <summary>
/// 实发绩效
工资金额
/// 实发绩效
(不含医院其他绩效)
/// </summary>
public
Nullable
<
decimal
>
RealAmount
{
get
;
set
;
}
...
...
@@ -145,5 +145,10 @@ public class ag_bodysource
/// 预留金额
/// </summary>
public
Nullable
<
decimal
>
ReservedAmount
{
get
;
set
;
}
/// <summary>
/// 实发绩效(参考,含医院其他绩效)
/// </summary>
public
Nullable
<
decimal
>
ReferToRealAmount
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/ag_workload.cs
View file @
ffae97f9
...
...
@@ -60,5 +60,10 @@ public class ag_workload
/// -1、单项奖励 0、工作量占比 ..(自定义占比)
/// </summary>
public
int
WorkTypeId
{
get
;
set
;
}
/// <summary>
/// 工作量来源类型
/// </summary>
public
string
SourceCategory
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Other/view_second_workload_result.cs
0 → 100644
View file @
ffae97f9
namespace
Performance.EntityModels
{
public
class
view_second_workload_result
{
public
int
HospitalId
{
get
;
set
;
}
public
int
AllotId
{
get
;
set
;
}
/// <summary>
/// 核算单元组别
/// </summary>
public
string
UnitType
{
get
;
set
;
}
/// <summary>
/// 核算单元
/// </summary>
public
string
AccountingUnit
{
get
;
set
;
}
/// <summary>
/// 统计的HIS的原始科室名称
/// </summary>
public
string
HISDeptName
{
get
;
set
;
}
public
string
ItemId
{
get
;
set
;
}
public
string
ItemName
{
get
;
set
;
}
public
decimal
?
FactorValue
{
get
;
set
;
}
public
string
PersonnelNumber
{
get
;
set
;
}
public
string
DoctorName
{
get
;
set
;
}
public
string
Category
{
get
;
set
;
}
public
decimal
Value
{
get
;
set
;
}
}
}
performance/Performance.Repository/PerforPerAllotRepository.cs
View file @
ffae97f9
...
...
@@ -228,5 +228,55 @@ public IEnumerable<ex_result> QueryIncomeData(int allotid, string source, string
}
}
}
/// <summary>
/// 二次分配按工号带出带出工作量
/// </summary>
/// <param name="allotid"></param>
/// <param name="unittype"></param>
/// <param name="accountingunit"></param>
/// <returns></returns>
public
IEnumerable
<
view_second_workload_result
>
GetSecondWorkload
(
int
allotid
,
string
unittype
,
string
accountingunit
)
{
using
(
var
connection
=
context
.
Database
.
GetDbConnection
())
{
if
(
connection
.
State
!=
ConnectionState
.
Open
)
connection
.
Open
();
try
{
string
query
=
$@"SELECT * FROM view_second_workload_result WHERE AllotId = @allotid AND UnitType = @unittype AND AccountingUnit = @accountingunit"
;
return
connection
.
Query
<
view_second_workload_result
>(
query
,
new
{
allotid
,
unittype
,
accountingunit
},
commandTimeout
:
60
*
60
);
}
catch
(
Exception
ex
)
{
throw
ex
;
}
}
}
/// <summary>
/// 查询HIS提取数据,工作量字典
/// </summary>
/// <param name="allotid"></param>
/// <param name="unittype"></param>
/// <param name="accountingunit"></param>
/// <returns></returns>
public
IEnumerable
<
string
>
GetSecondWorkloadMaps
(
int
allotid
,
string
unittype
,
string
accountingunit
)
{
using
(
var
connection
=
context
.
Database
.
GetDbConnection
())
{
if
(
connection
.
State
!=
ConnectionState
.
Open
)
connection
.
Open
();
try
{
string
query
=
$@"SELECT DISTINCT Category FROM view_second_workload_his his
INNER JOIN per_dept_dic dic ON his.HospitalId = dic.HospitalId and his.UnitType = dic.UnitType and his.Department = dic.HISDeptName
WHERE AllotId = @allotid AND dic.UnitType = @unittype AND dic.AccountingUnit = @accountingunit"
;
return
connection
.
Query
<
string
>(
query
,
new
{
allotid
,
unittype
,
accountingunit
},
commandTimeout
:
60
*
60
);
}
catch
(
Exception
ex
)
{
throw
ex
;
}
}
}
}
}
\ No newline at end of file
performance/Performance.Services/RedistributionService.cs
View file @
ffae97f9
...
...
@@ -96,7 +96,7 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
HandsonTableBase
handson
=
GetHandsonTable
(
computeMode
,
loads
);
// 先占位,更加选择加载指定范围数据
// 加载方式分 保存,上次,字典,测算表
var
loadEmployees
=
LoadEmployees
(
allot
,
second
,
overrideMode
);
var
loadEmployees
=
LoadEmployees
(
allot
,
second
,
overrideMode
,
out
bool
isSave
);
// 设置固定信息默认值
foreach
(
var
item
in
loadEmployees
)
{
...
...
@@ -106,7 +106,7 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, EmployeeSourc
}
// 加载已保存工作量数据
handson
.
Data
=
LoadWorkload
(
allot
,
second
,
loadEmployees
);
handson
.
Data
=
LoadWorkload
(
allot
,
second
,
loadEmployees
,
isSave
);
// 设置工作量考核等分默认值
foreach
(
var
item
in
handson
.
Data
)
...
...
@@ -179,13 +179,15 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
new
SecondColumnDictionary
(
"单项奖励合计"
,
nameof
(
ag_bodysource
.
DeptReward
),
true
,
499
),
new
SecondColumnDictionary
(
"可分配绩效"
,
nameof
(
ag_bodysource
.
DistPerformance
),
true
,
500
),
new
SecondColumnDictionary
(
"医院其他绩效"
,
nameof
(
ag_bodysource
.
OtherPerformance
),
true
,
501
),
new
SecondColumnDictionary
(
"医院发放夜班绩效"
,
nameof
(
ag_bodysource
.
NightWorkPerformance
),
true
,
502
),
//new SecondColumnDictionary("预留比例",nameof(ag_bodysource.ReservedRatio),false,601 ),
//new SecondColumnDictionary("预留金额",nameof(ag_bodysource.ReservedAmount),false,602 ),
new
SecondColumnDictionary
(
"实发绩效"
,
nameof
(
ag_bodysource
.
RealAmount
),
true
,
700
),
new
SecondColumnDictionary
(
"绩效分配合计"
,
nameof
(
ag_bodysource
.
RealAmount
),
true
,
700
),
new
SecondColumnDictionary
(
"医院其他绩效"
,
nameof
(
ag_bodysource
.
OtherPerformance
),
false
,
801
,
color
:
"referto_color"
),
new
SecondColumnDictionary
(
"实发绩效"
,
nameof
(
ag_bodysource
.
ReferToRealAmount
),
false
,
802
,
color
:
"referto_color"
),
};
// 工作量
...
...
@@ -230,8 +232,9 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
/// <param name="allot"></param>
/// <param name="second"></param>
/// <param name="loadEmployees"></param>
/// <param name="isSave">True 加载已保存数据 False 加载工作量自动带出</param>
/// <returns></returns>
private
List
<
Dictionary
<
string
,
object
>>
LoadWorkload
(
per_allot
allot
,
ag_secondallot
second
,
List
<
ag_bodysource
>
loadEmployees
)
private
List
<
Dictionary
<
string
,
object
>>
LoadWorkload
(
per_allot
allot
,
ag_secondallot
second
,
List
<
ag_bodysource
>
loadEmployees
,
bool
isSave
=
true
)
{
List
<
Dictionary
<
string
,
object
>>
result
=
new
List
<
Dictionary
<
string
,
object
>>();
var
status
=
(
new
int
[]
{
(
int
)
SecondAllotStatus
.
WaitReview
,
(
int
)
SecondAllotStatus
.
PassAudit
});
...
...
@@ -261,12 +264,21 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
if
(
workloads
!=
null
&&
workloads
.
Any
())
{
/* isSave 为True时,没必要查询数据 */
var
secondWorkload
=
isSave
?
new
List
<
view_second_workload_result
>()
:
GetSecondWorkloadByValue
(
second
.
AllotId
.
Value
,
second
.
UnitType
,
second
.
Department
);
foreach
(
var
employee
in
loadEmployees
)
{
var
dict
=
JsonHelper
.
Deserialize
<
Dictionary
<
string
,
object
>>(
JsonHelper
.
Serialize
(
employee
));
foreach
(
var
workitem
in
workloads
)
{
var
value
=
bodyDynamic
?.
FirstOrDefault
(
w
=>
w
.
BodyId
==
employee
.
Id
&&
w
.
WorkloadId
==
workitem
.
Id
)?.
Value
;
/* 如果是已保存数据,则加载原始数据,否则加载工作量自动带出 */
var
value
=
isSave
?
bodyDynamic
?.
FirstOrDefault
(
w
=>
w
.
BodyId
==
employee
.
Id
&&
w
.
WorkloadId
==
workitem
.
Id
)?.
Value
:
secondWorkload
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
employee
.
WorkNumber
&&
w
.
DoctorName
==
employee
.
Name
&&
workitem
.
ItemId
.
EqualsIgnoreCase
(
w
.
ItemId
))?.
Value
;
dict
.
AddOrUpdate
(
workitem
.
ItemId
,
value
);
}
result
.
Add
(
dict
);
...
...
@@ -350,17 +362,17 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ComputeMode compute
/// <param name="secondId"></param>
/// <param name="mode"></param>
/// <returns></returns>
private
List
<
ag_bodysource
>
LoadEmployees
(
per_allot
allot
,
ag_secondallot
second
,
EmployeeSource
mode
)
private
List
<
ag_bodysource
>
LoadEmployees
(
per_allot
allot
,
ag_secondallot
second
,
EmployeeSource
mode
,
out
bool
isSave
)
{
var
employees
=
_peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
second
.
AllotId
);
isSave
=
false
;
// 默认流程
if
(
mode
==
EmployeeSource
.
Initial
)
{
var
saveDatas
=
_agbodysourceRepository
.
GetEntities
(
w
=>
w
.
SecondId
==
second
.
Id
);
isSave
=
(
saveDatas
!=
null
&&
saveDatas
.
Count
>
0
);
// 数据带出顺序 1 已保存 2 上次 3 科室字典(或EXCEL行政工勤)
if
(
saveDatas
!=
null
)
return
saveDatas
;
if
(
isSave
)
return
saveDatas
;
var
prevSecond
=
LoadEmployees_PrevSecondAllot
(
allot
,
second
);
List
<
string
>
numbers
=
prevSecond
?.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
WorkNumber
)).
Select
(
w
=>
w
.
WorkNumber
).
ToList
()
??
new
List
<
string
>();
...
...
@@ -1119,14 +1131,17 @@ private void realAmountCalculate(List<Dictionary<string, object>> rows)
{
foreach
(
var
row
in
rows
)
{
// 总绩效 = 夜班工作量绩效 + 医院其他绩效
var
row_ShifaAmountOfPerformancePay
=
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
NightWorkPerformance
))
+
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
OtherPerformance
));
// ReservedAmount 年度考核发放金额 DistPerformance 可分配绩效
var
reservedAmount
=
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
DistPerformance
))
*
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
ReservedRatio
));
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
ReservedAmount
),
reservedAmount
);
var
realAmount
=
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
DistPerformance
))
-
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
ReservedAmount
))
+
row_ShifaAmountOfPerformancePay
;
// 实发绩效 = 可分配绩效 - 预留绩效 + 夜班工作量绩效
var
realAmount
=
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
DistPerformance
))
-
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
ReservedAmount
))
+
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
NightWorkPerformance
));
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
RealAmount
),
realAmount
);
// 参考(实发绩效 = 实发绩效 + 医院其他绩效)
var
referToRealAmount
=
realAmount
+
GetDecimal2
(
row
,
nameof
(
ag_bodysource
.
OtherPerformance
));
row
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
ReferToRealAmount
),
referToRealAmount
);
}
}
...
...
@@ -1302,6 +1317,7 @@ public object RedistributionEmployee(SecondEmployeeDto request)
};
}
}
var
secondWorkload
=
GetSecondWorkloadByValue
(
second
.
AllotId
.
Value
,
second
.
UnitType
,
second
.
Department
);
var
monthDays
=
DateTime
.
DaysInMonth
(
allot
.
Year
,
allot
.
Month
);
foreach
(
var
employee
in
employees
)
{
...
...
@@ -1329,7 +1345,17 @@ public object RedistributionEmployee(SecondEmployeeDto request)
{
item
.
AddOrUpdate
(
score
.
Title
,
100
);
}
// 工作量带出
if
(
secondWorkload
!=
null
&&
secondWorkload
.
Any
())
{
var
workload
=
secondWorkload
.
Where
(
w
=>
w
.
DoctorName
==
employee
.
DoctorName
&&
w
.
PersonnelNumber
==
employee
.
PersonnelNumber
&&
loads
.
Select
(
score
=>
score
.
Title
).
Contains
(
w
.
ItemId
));
foreach
(
var
wl
in
workload
)
{
item
.
AddOrUpdate
(
wl
.
ItemId
,
wl
.
Value
);
}
}
}
result
.
Add
(
item
);
}
}
...
...
@@ -1337,5 +1363,10 @@ public object RedistributionEmployee(SecondEmployeeDto request)
return
new
{
employees
.
CurrentPage
,
employees
.
TotalPages
,
employees
.
PageSize
,
employees
.
TotalCount
,
list
=
result
};
}
#
endregion
private
IEnumerable
<
view_second_workload_result
>
GetSecondWorkloadByValue
(
int
allotid
,
string
unittype
,
string
accountingunit
)
{
return
_perallotRepository
.
GetSecondWorkload
(
allotid
,
unittype
,
accountingunit
);
}
}
}
performance/Performance.Services/SecondAllotService.cs
View file @
ffae97f9
...
...
@@ -1054,6 +1054,20 @@ public List<TitleValue<int>> WorkTypeList(WorkloadRequest request, int secondId)
}
/// <summary>
/// 获取二次分配 提取工作量带出字典
/// </summary>
/// <param name="secondId"></param>
/// <returns></returns>
public
List
<
string
>
WorkloadMap
(
int
secondId
)
{
var
second
=
agsecondallotRepository
.
GetEntity
(
t
=>
t
.
Id
==
secondId
);
if
(
second
==
null
)
throw
new
PerformanceException
(
"参数错误"
);
var
worktypes
=
perallotRepository
.
GetSecondWorkloadMaps
(
second
.
AllotId
.
Value
,
second
.
UnitType
,
second
.
Department
);
return
(
worktypes
!=
null
&&
worktypes
.
Any
())
?
worktypes
.
ToList
()
:
new
List
<
string
>();
}
/// <summary>
/// 保存工作量类型
/// </summary>
/// <param name="secondId"></param>
...
...
@@ -1072,6 +1086,7 @@ public ag_workload_type SaveWorkType(ag_workload_type request, int secondId)
entity
=
agworkloadtypeRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
Id
);
entity
.
HospitalId
=
request
.
HospitalId
;
entity
.
TypeName
=
request
.
TypeName
;
entity
.
TypeName
=
request
.
TypeName
;
agworkloadtypeRepository
.
Update
(
entity
);
}
...
...
@@ -1353,6 +1368,7 @@ public bool WorkloadAdd(WorkloadRequest request)
FactorValue
=
request
.
FactorValue
??
1
,
ItemName
=
request
.
ItemName
,
Sort
=
request
.
Sort
??
1
,
SourceCategory
=
request
.
SourceCategory
,
WorkTypeId
=
request
.
IsSingleAwards
?
(
int
)
AgWorkloadType
.
SingleAwards
:
request
.
WorkTypeId
};
var
result
=
agworkloadRepository
.
Add
(
workload
);
...
...
@@ -1382,6 +1398,7 @@ public bool WorkloadUpdate(WorkloadRequest request)
workload
.
UnitType
=
request
.
UnitType
;
workload
.
FactorValue
=
request
.
FactorValue
;
workload
.
ItemName
=
request
.
ItemName
;
workload
.
SourceCategory
=
request
.
SourceCategory
;
workload
.
Sort
=
request
.
Sort
;
workload
.
ItemId
=
getWorkloadItemId
.
Invoke
(
request
.
IsSingleAwards
,
request
.
WorkTypeId
,
workload
.
Id
);
;
workload
.
WorkTypeId
=
request
.
IsSingleAwards
?
(
int
)
AgWorkloadType
.
SingleAwards
:
request
.
WorkTypeId
;
...
...
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