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
f40cbd61
Commit
f40cbd61
authored
Jun 22, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
cf96e1ed
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
84 deletions
+50
-84
performance/Performance.Api/Controllers/SecondAllotController.cs
+3
-3
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
+0
-20
performance/Performance.DtoModels/Second/Constant.cs
+3
-23
performance/Performance.DtoModels/Second/SecondColumnDictionary.cs
+5
-1
performance/Performance.Services/RedistributionService.cs
+39
-37
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
f40cbd61
...
...
@@ -552,9 +552,9 @@ public ApiResponse RedistributionLoad([FromBody] SecondLoadDto request)
if
(!
Enum
.
IsDefined
(
typeof
(
ComputeMode
),
request
.
ComputeMode
))
throw
new
PerformanceException
(
"暂不支持当前计算方式!"
);
var
overrideMode
=
OverrideMod
e
.
Initial
;
if
(
Enum
.
IsDefined
(
typeof
(
OverrideMod
e
),
request
.
OverrideMode
))
overrideMode
=
(
OverrideMod
e
)
request
.
OverrideMode
;
var
overrideMode
=
EmployeeSourc
e
.
Initial
;
if
(
Enum
.
IsDefined
(
typeof
(
EmployeeSourc
e
),
request
.
OverrideMode
))
overrideMode
=
(
EmployeeSourc
e
)
request
.
OverrideMode
;
var
result
=
_redistributionService
.
Load
(
request
.
SecondId
,
(
ComputeMode
)
request
.
ComputeMode
,
overrideMode
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
...
...
performance/Performance.Api/wwwroot/Performance.DtoModels.xml
View file @
f40cbd61
...
...
@@ -3781,26 +3781,6 @@
纵向计算
</summary>
</member>
<member
name=
"T:Performance.DtoModels.Second.OverrideMode"
>
<summary>
人员带出方式 已保存,上次,字典,测算表
</summary>
</member>
<member
name=
"F:Performance.DtoModels.Second.OverrideMode.Initial"
>
<summary>
初始化(用户保存后的数据)
</summary>
</member>
<member
name=
"F:Performance.DtoModels.Second.OverrideMode.PrevSecondAllot"
>
<summary>
上一个二次绩效记录
</summary>
</member>
<member
name=
"F:Performance.DtoModels.Second.OverrideMode.EmployeeDict"
>
<summary>
人员字典
</summary>
</member>
<member
name=
"P:Performance.DtoModels.SecondLoadDto.ComputeMode"
>
<summary>
计算方式:1 不计算 2 横向计算 3 纵向计算
...
...
performance/Performance.DtoModels/Second/Constant.cs
View file @
f40cbd61
...
...
@@ -12,34 +12,14 @@ public enum ComputeMode
/// <summary>
/// 不计算
/// </summary>
NotCalculate
=
1
,
NotCalculate
=
1
1
,
/// <summary>
/// 横向计算
/// </summary>
Horizontal
=
2
,
Horizontal
=
1
2
,
/// <summary>
/// 纵向计算
/// </summary>
Vertical
=
3
,
}
/// <summary>
/// 人员带出方式 已保存,上次,字典,测算表
/// </summary>
public
enum
OverrideMode
{
/// <summary>
/// 初始化(用户保存后的数据)
/// </summary>
Initial
=
0
,
/// <summary>
/// 上一个二次绩效记录
/// </summary>
PrevSecondAllot
=
1
,
/// <summary>
/// 人员字典
/// </summary>
EmployeeDict
=
2
,
Vertical
=
13
,
}
}
performance/Performance.DtoModels/Second/SecondColumnDictionary.cs
View file @
f40cbd61
...
...
@@ -5,20 +5,24 @@ public class SecondColumnDictionary
public
string
Label
{
get
;
set
;
}
public
string
Key
{
get
;
set
;
}
public
bool
IsTrue
{
get
;
set
;
}
public
string
Fixed
{
get
;
set
;
}
public
int
Sort
{
get
;
set
;
}
public
string
Site
{
get
;
set
;
}
public
string
Type
{
get
;
set
;
}
public
SecondColumnDictionary
()
{
}
public
SecondColumnDictionary
(
string
label
,
string
key
,
bool
isTrue
,
int
sort
,
string
site
=
"Table"
)
public
SecondColumnDictionary
(
string
label
,
string
key
,
bool
isTrue
,
int
sort
,
string
site
=
"Table"
,
string
fix
=
""
,
string
type
=
""
)
{
Label
=
label
;
Key
=
key
;
IsTrue
=
isTrue
;
Sort
=
sort
;
Site
=
site
;
Fixed
=
fix
;
Type
=
type
;
}
}
}
performance/Performance.Services/RedistributionService.cs
View file @
f40cbd61
...
...
@@ -72,10 +72,10 @@ public class RedistributionService : IAutoInjection
/// 加载
/// </summary>
/// <param name="secondId"></param>
/// <param name="computeMode">计算方式:1
不计算 2 横向计算
3 纵向计算</param>
/// <param name="computeMode">计算方式:1
1 不计算 12 横向计算 1
3 纵向计算</param>
/// <param name="overrideMode">数据加载方式:0 保存,1 上次,2 字典,3 测算表</param>
/// <returns></returns>
public
SecondDetailDto
Load
(
int
secondId
,
ComputeMode
computeMode
,
OverrideMod
e
overrideMode
)
public
SecondDetailDto
Load
(
int
secondId
,
ComputeMode
computeMode
,
EmployeeSourc
e
overrideMode
)
{
var
second
=
_secondallotRepository
.
GetEntity
(
t
=>
t
.
Id
==
secondId
);
if
(
second
==
null
)
throw
new
PerformanceException
(
"参数SecondId无效!"
);
...
...
@@ -128,45 +128,52 @@ public SecondDetailDto Load(int secondId, ComputeMode computeMode, OverrideMode
return
new
SecondDetailDto
{
Head
=
head
,
Body
=
handson
,
Dic
=
dic
};
}
/// <summary>
/// 表格及列头 字典信息
/// </summary>
/// <param name="second"></param>
/// <param name="loads"></param>
/// <returns></returns>
public
List
<
SecondColumnDictionary
>
GetTableHeaderDictionary
(
ag_secondallot
second
,
List
<
TitleValue
<
string
,
decimal
?>>
loads
)
{
var
maps
=
new
List
<
SecondColumnDictionary
>()
{
new
SecondColumnDictionary
(
"人员工号"
,
nameof
(
ag_bodysource
.
WorkNumber
),
true
,
100
),
new
SecondColumnDictionary
(
"姓名"
,
nameof
(
ag_bodysource
.
Name
),
true
,
100
),
new
SecondColumnDictionary
(
"科室"
,
nameof
(
ag_bodysource
.
Department
),
true
,
100
),
new
SecondColumnDictionary
(
"
岗位
"
,
nameof
(
ag_bodysource
.
Post
),
true
,
100
),
new
SecondColumnDictionary
(
"人员系数"
,
nameof
(
ag_bodysource
.
StaffCoefficient
),
tru
e
,
200
),
new
SecondColumnDictionary
(
"出勤"
,
nameof
(
ag_bodysource
.
ActualAttendance
),
tru
e
,
201
),
new
SecondColumnDictionary
(
"职称"
,
nameof
(
ag_bodysource
.
JobTitle
),
tru
e
,
202
),
new
SecondColumnDictionary
(
"职称系数"
,
nameof
(
ag_bodysource
.
TitleCoefficient
),
tru
e
,
203
),
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
.
Department
),
true
,
100
,
fix
:
"Left"
),
new
SecondColumnDictionary
(
"
主管
"
,
nameof
(
ag_bodysource
.
Post
),
true
,
100
),
new
SecondColumnDictionary
(
"人员系数"
,
nameof
(
ag_bodysource
.
StaffCoefficient
),
fals
e
,
200
),
new
SecondColumnDictionary
(
"出勤"
,
nameof
(
ag_bodysource
.
ActualAttendance
),
fals
e
,
201
),
new
SecondColumnDictionary
(
"职称"
,
nameof
(
ag_bodysource
.
JobTitle
),
fals
e
,
202
),
new
SecondColumnDictionary
(
"职称系数"
,
nameof
(
ag_bodysource
.
TitleCoefficient
),
fals
e
,
203
),
new
SecondColumnDictionary
(
"职称绩效"
,
nameof
(
ag_bodysource
.
TitlePerformance
),
true
,
299
),
new
SecondColumnDictionary
(
"工作量绩效
工资
"
,
nameof
(
ag_bodysource
.
WorkPerformance
),
true
,
399
),
new
SecondColumnDictionary
(
"单项奖励
小
计"
,
nameof
(
ag_bodysource
.
DeptReward
),
true
,
499
),
new
SecondColumnDictionary
(
"工作量绩效
合计
"
,
nameof
(
ag_bodysource
.
WorkPerformance
),
true
,
399
),
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
),
tru
e
,
601
),
new
SecondColumnDictionary
(
"预留金额"
,
nameof
(
ag_bodysource
.
ReservedAmount
),
tru
e
,
602
),
//new SecondColumnDictionary("预留比例",nameof(ag_bodysource.ReservedRatio),fals
e,601 ),
//new SecondColumnDictionary("预留金额",nameof(ag_bodysource.ReservedAmount),fals
e,602 ),
new
SecondColumnDictionary
(
"实发绩效
工资金额
"
,
nameof
(
ag_bodysource
.
RealAmount
),
true
,
700
),
new
SecondColumnDictionary
(
"实发绩效"
,
nameof
(
ag_bodysource
.
RealAmount
),
true
,
700
),
};
// 工作量
int
sort
=
300
;
foreach
(
var
item
in
loads
.
Where
(
w
=>
!
w
.
Title
.
StartsWithIgnoreCase
(
"SingleAwards_"
)))
{
maps
.
Add
(
new
SecondColumnDictionary
(
item
.
Value
,
item
.
Title
,
false
,
++
sort
));
maps
.
Add
(
new
SecondColumnDictionary
(
item
.
Value
,
item
.
Title
,
false
,
++
sort
,
type
:
"Workload"
));
}
// 单项奖励
sort
=
400
;
foreach
(
var
item
in
loads
.
Where
(
w
=>
w
.
Title
.
StartsWithIgnoreCase
(
"SingleAwards_"
)))
{
maps
.
Add
(
new
SecondColumnDictionary
(
item
.
Value
,
item
.
Title
,
false
,
++
sort
));
maps
.
Add
(
new
SecondColumnDictionary
(
item
.
Value
,
item
.
Title
,
false
,
++
sort
,
type
:
"SingleAwards"
));
}
...
...
@@ -284,12 +291,12 @@ public List<SecondColumnDictionary> GetTableHeaderDictionary(ag_secondallot seco
/// <param name="secondId"></param>
/// <param name="mode"></param>
/// <returns></returns>
private
List
<
ag_bodysource
>
LoadEmployees
(
per_allot
allot
,
ag_secondallot
second
,
OverrideMod
e
mode
)
private
List
<
ag_bodysource
>
LoadEmployees
(
per_allot
allot
,
ag_secondallot
second
,
EmployeeSourc
e
mode
)
{
var
employees
=
_peremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
second
.
AllotId
);
// 默认流程
if
(
mode
==
OverrideMod
e
.
Initial
)
if
(
mode
==
EmployeeSourc
e
.
Initial
)
{
var
saveDatas
=
_agbodysourceRepository
.
GetEntities
(
w
=>
w
.
SecondId
==
second
.
Id
);
// 数据带出顺序 1 已保存 2 上次 3 科室字典(或EXCEL行政工勤)
...
...
@@ -311,12 +318,12 @@ private List<ag_bodysource> LoadEmployees(per_allot allot, ag_secondallot second
else
{
List
<
string
>
numbers
=
new
List
<
string
>();
if
(
mode
==
OverrideMod
e
.
PrevSecondAllot
)
if
(
mode
==
EmployeeSourc
e
.
PrevSecondAllot
)
numbers
=
LoadEmployees_PrevSecondAllot
(
allot
,
second
);
// 如果行政工勤科室则默认从EXCEL中带出数据
else
if
(
mode
==
OverrideMod
e
.
EmployeeDict
&&
UnitTypeUtil
.
IsOffice
(
second
.
UnitType
))
else
if
(
mode
==
EmployeeSourc
e
.
EmployeeDict
&&
UnitTypeUtil
.
IsOffice
(
second
.
UnitType
))
numbers
=
LoadEmployees_OfficeExcel
(
second
);
else
if
(
mode
==
OverrideMod
e
.
EmployeeDict
)
else
if
(
mode
==
EmployeeSourc
e
.
EmployeeDict
)
numbers
=
LoadEmployees_EmployeeDict
(
second
,
employees
);
if
(
numbers
==
null
||
numbers
.
Count
==
0
)
...
...
@@ -409,11 +416,6 @@ private List<string> LoadEmployees_OfficeExcel(ag_secondallot second)
return
numbers
;
}
private
List
<
string
>
LoadEmployees_Save
(
List
<
ag_bodysource
>
saveDatas
)
{
return
saveDatas
.
Select
(
w
=>
w
.
WorkNumber
).
ToList
();
}
#
region
动态生成列头信息
/// <summary>
/// 动态生成列头信息
...
...
@@ -482,7 +484,7 @@ private List<string> LoadEmployees_Save(List<ag_bodysource> saveDatas)
private
HandsonTableBase
ComputeMode_Format1
(
List
<
string
>
colHeaders
,
List
<
HandsonColumn
>
columns
)
{
HandsonTableBase
handson
=
new
HandsonTableBase
();
handson
.
ColHeaders
.
AddRange
(
new
string
[]
{
"工号"
,
"姓名"
,
/* "核算单元",
*/
"主管"
,
"职称绩效"
,
"工作量绩效工资"
,
});
handson
.
ColHeaders
.
AddRange
(
new
string
[]
{
"工号"
,
"姓名"
,
/* "核算单元",
"主管",*/
"职称绩效"
,
"工作量绩效工资"
,
});
handson
.
Columns
.
AddRange
(
new
HandsonColumn
[]
{
...
...
@@ -677,13 +679,13 @@ private void clearPerformanceWorkload(List<Dictionary<string, object>> rows, Lis
{
foreach
(
var
workload
in
workloadGroups
)
{
row
.
Remove
(
workload
.
WorkloadScore
);
row
.
Remove
(
workload
.
AssessmentScore
);
row
.
Remove
(
workload
.
WorkPerformance
);
row
.
AddOrUpdate
(
workload
.
WorkloadScore
,
0
m
);
row
.
AddOrUpdate
(
workload
.
AssessmentScore
,
0
m
);
row
.
AddOrUpdate
(
workload
.
WorkPerformance
,
0
m
);
foreach
(
var
item
in
workload
.
Items
)
{
row
.
Remove
(
ite
m
);
row
.
AddOrUpdate
(
item
,
0
m
);
}
}
}
...
...
@@ -909,6 +911,7 @@ decimal ComputeMode_3(Dictionary<string, object> row, List<TitleValue<string, de
});
return
workload_score
;
}
/// <summary>
/// 2 横向计算
/// </summary>
...
...
@@ -1082,17 +1085,16 @@ public List<SecondComputeCheckResultDto> CheckData(ag_secondallot second, List<D
if
(
string
.
IsNullOrEmpty
(
number
)
||
string
.
IsNullOrEmpty
(
name
))
{
item
.
AddOrUpdate
(
nameof
(
ResponseType
),
ResponseType
.
Warning
);
result
.
Add
(
new
SecondComputeCheckResultDto
(
nameof
(
ResponseType
.
Warning
),
number
,
name
,
$"第
{(
i
+
1
)}
行,工号或姓名无效;计算式忽略。"
));
result
.
Add
(
new
SecondComputeCheckResultDto
(
nameof
(
ResponseType
.
Warning
),
"空"
,
"空"
,
$"第
{(
i
+
1
)}
行,工号或姓名无效;计算式忽略。"
));
}
var
emp
=
employees
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
number
&&
w
.
DoctorName
==
name
);
if
(
emp
==
null
)
else
if
(!
employees
.
Any
(
w
=>
w
.
PersonnelNumber
==
number
&&
w
.
DoctorName
==
name
))
{
item
.
AddOrUpdate
(
nameof
(
ResponseType
),
ResponseType
.
Error
);
result
.
Add
(
new
SecondComputeCheckResultDto
(
nameof
(
ResponseType
.
Error
),
number
,
name
,
$"第
{(
i
+
1
)}
行,工号和姓名在字典中不存在,请修复。"
));
}
else
{
var
emp
=
employees
.
FirstOrDefault
(
w
=>
w
.
PersonnelNumber
==
number
&&
w
.
DoctorName
==
name
);
item
.
AddOrUpdate
(
nameof
(
ResponseType
),
ResponseType
.
OK
);
item
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
Department
),
emp
.
AccountingUnit
);
item
.
AddOrUpdate
(
nameof
(
ag_bodysource
.
ReservedRatio
),
emp
.
ReservedRatio
);
...
...
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