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
3cb09656
Commit
3cb09656
authored
Aug 18, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
5c4a9e2e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
+3
-0
performance/Performance.DtoModels/Response/OwnerPerformanceDto.cs
+1
-1
performance/Performance.Services/AllotService.cs
+21
-8
No files found.
performance/Performance.DtoModels/AutoMapper/AutoMapperConfigs.cs
View file @
3cb09656
...
...
@@ -244,6 +244,9 @@ public AutoMapperConfigs()
CreateMap
<
ag_headsource
,
SecPrintHeaderResponse
>()
.
ForMember
(
dest
=>
dest
.
TheTotalAllocationOfPerformanceResults
,
opt
=>
opt
.
MapFrom
(
src
=>
src
.
TotalDeptReward
))
.
ReverseMap
();
CreateMap
<
view_allot_result
,
OwnerPerformanceDto
>()
.
ReverseMap
();
}
}
}
performance/Performance.DtoModels/Response/OwnerPerformanceDto.cs
View file @
3cb09656
...
...
@@ -6,7 +6,7 @@ namespace Performance.DtoModels
{
public
class
OwnerPerformanceDto
:
view_allot_result
{
public
IEnumerable
<
view_allot_result
>
Detail
{
get
;
set
;
}
public
IEnumerable
<
OwnerPerformanceDto
>
Detail
{
get
;
set
;
}
/// <summary>
/// 应发绩效
/// </summary>
...
...
performance/Performance.Services/AllotService.cs
View file @
3cb09656
...
...
@@ -687,6 +687,8 @@ public List<OwnerPerformanceDto> GetOwnerPerformance(int userid)
if
(
owner
==
null
||
!
owner
.
Any
())
return
new
List
<
OwnerPerformanceDto
>();
var
employees
=
_perforPeremployeeRepository
.
GetEntities
(
w
=>
w
.
PersonnelNumber
==
jobNumber
);
var
res
=
owner
.
GroupBy
(
w
=>
new
{
w
.
AllotId
,
w
.
Year
,
w
.
Month
,
w
.
JobNumber
})
.
Select
(
w
=>
new
OwnerPerformanceDto
...
...
@@ -704,25 +706,36 @@ public List<OwnerPerformanceDto> GetOwnerPerformance(int userid)
HideOtherPerfor
=
Math
.
Round
(
w
.
Sum
(
p
=>
p
.
HideOtherPerfor
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
),
// 不公示其他绩效
RealPerformance
=
Math
.
Round
(
w
.
Sum
(
p
=>
p
.
RealPerformance
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
),
// 中转使用: 业绩绩效+管理绩效+调节后其他绩效
Detail
=
w
.
Where
(
p
=>
p
.
Year
==
w
.
Key
.
Year
&&
p
.
Month
==
w
.
Key
.
Month
&&
p
.
JobNumber
==
w
.
Key
.
JobNumber
),
Detail
=
w
.
Where
(
p
=>
p
.
Year
==
w
.
Key
.
Year
&&
p
.
Month
==
w
.
Key
.
Month
&&
p
.
JobNumber
==
w
.
Key
.
JobNumber
)
.
Select
(
detial
=>
{
var
dto
=
Mapper
.
Map
<
OwnerPerformanceDto
>(
detial
);
// 应发绩效
dto
.
ShouldGiveFee
=
Math
.
Round
((
dto
.
RealPerformance
??
0
)
+
(
dto
.
OtherPerfor
??
0
)
+
(
dto
.
HideOtherPerfor
??
0
)
+
(
dto
.
NightWorkPerfor
??
0
),
2
,
MidpointRounding
.
AwayFromZero
);
dto
.
ReservedRatio
=
employees
?.
FirstOrDefault
(
emp
=>
emp
.
AllotId
==
dto
.
AllotId
&&
emp
.
PersonnelNumber
==
jobNumber
)?.
ReservedRatio
??
0
;
// 预留比例
dto
.
ReservedRatioFee
=
Math
.
Round
((
dto
.
RealPerformance
??
0
)
*
(
dto
.
ReservedRatio
??
0
),
2
,
MidpointRounding
.
AwayFromZero
);
// 预留绩效
dto
.
RealGiveFee
=
Math
.
Round
(
dto
.
ShouldGiveFee
-
(
dto
.
ReservedRatioFee
??
0
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
);
// 实发绩效
return
dto
;
}),
})
.
ToList
();
var
employees
=
_perforPeremployeeRepository
.
GetEntities
(
w
=>
w
.
PersonnelNumber
==
jobNumber
);
foreach
(
var
item
in
res
)
{
item
.
UnitType
=
employees
?.
FirstOrDefault
(
w
=>
w
.
AllotId
==
item
.
AllotId
&&
w
.
PersonnelNumber
==
jobNumber
)?.
UnitType
??
""
;
item
.
AccountingUnit
=
employees
?.
FirstOrDefault
(
w
=>
w
.
AllotId
==
item
.
AllotId
&&
w
.
PersonnelNumber
==
jobNumber
)?.
AccountingUnit
??
""
;
item
.
EmployeeName
=
employees
?.
FirstOrDefault
(
w
=>
w
.
AllotId
==
item
.
AllotId
&&
w
.
PersonnelNumber
==
jobNumber
)?.
DoctorName
??
""
;
// 应发绩效
item
.
ShouldGiveFee
=
Math
.
Round
((
item
.
RealPerformance
??
0
)
+
(
item
.
OtherPerfor
??
0
)
+
(
item
.
HideOtherPerfor
??
0
)
+
(
item
.
NightWorkPerfor
??
0
),
2
,
MidpointRounding
.
AwayFromZero
);
// 全部是0的记录不显示
item
.
Detail
=
item
.
Detail
.
Where
(
w
=>
!(
w
.
PerforSumFee
==
0
&&
w
.
PerforManagementFee
==
0
&&
w
.
ShouldGiveFee
==
0
&&
w
.
OtherPerfor
==
0
&&
w
.
HideOtherPerfor
==
0
&&
w
.
RealGiveFee
==
0
));
// 为了保证总额一致
item
.
ShouldGiveFee
=
Math
.
Round
(
item
.
Detail
?.
Sum
(
w
=>
w
.
ShouldGiveFee
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
);
// 应发绩效
item
.
ReservedRatio
=
employees
?.
FirstOrDefault
(
w
=>
w
.
AllotId
==
item
.
AllotId
&&
w
.
PersonnelNumber
==
jobNumber
)?.
ReservedRatio
??
0
;
// 预留比例
item
.
ReservedRatioFee
=
Math
.
Round
(
(
item
.
RealPerformance
??
0
)
*
(
item
.
ReservedRatio
??
0
)
,
2
,
MidpointRounding
.
AwayFromZero
);
// 预留绩效
item
.
RealGiveFee
=
Math
.
Round
(
item
.
ShouldGiveFee
-
(
item
.
ReservedRatioFee
??
0
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
);
// 实发绩效
item
.
ReservedRatioFee
=
Math
.
Round
(
item
.
Detail
?.
Sum
(
w
=>
w
.
ReservedRatioFee
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
);
// 预留绩效
item
.
RealGiveFee
=
Math
.
Round
(
item
.
Detail
?.
Sum
(
w
=>
w
.
RealGiveFee
)
??
0
,
2
,
MidpointRounding
.
AwayFromZero
);
// 实发绩效
}
return
res
;
return
res
?.
OrderByDescending
(
w
=>
w
.
Year
).
ThenByDescending
(
w
=>
w
.
Month
).
ToList
()
;
}
}
}
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