Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
attendance-performance-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
attendance-performance-platform
Commits
75cd5018
Commit
75cd5018
authored
Mar 14, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绩效汇总分数显示优化
parent
c0bf2de4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffPerformSummaryServiceImpl.java
...le/staff/service/impl/StaffPerformSummaryServiceImpl.java
+40
-0
No files found.
attendance-performance-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffPerformSummaryServiceImpl.java
View file @
75cd5018
package
com.mortals.xhx.module.staff.service.impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.common.pdu.WeightPdu
;
import
com.mortals.xhx.module.staff.dao.StaffPerformSummaryDao
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.StaffPerformSummaryEntity
;
...
...
@@ -13,10 +16,14 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.math.BigDecimal
;
import
java.util.Calendar
;
import
java.util.List
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
ParamKey
.
SYS_PARAM_WEIGHT
;
/**
* StaffPerformSummaryService
* 员工绩效统计 service实现
...
...
@@ -30,6 +37,8 @@ public class StaffPerformSummaryServiceImpl extends AbstractCRUDServiceImpl<Staf
@Autowired
private
StaffService
staffService
;
@Autowired
private
ParamService
paramService
;
@Override
protected
StaffPerformSummaryEntity
findBefore
(
StaffPerformSummaryEntity
params
,
PageInfo
pageInfo
,
Context
context
)
throws
AppException
{
...
...
@@ -48,13 +57,44 @@ public class StaffPerformSummaryServiceImpl extends AbstractCRUDServiceImpl<Staf
@Override
protected
void
findAfter
(
StaffPerformSummaryEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
StaffPerformSummaryEntity
>
list
)
throws
AppException
{
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
String
value
=
paramService
.
getValueByKey
(
SYS_PARAM_WEIGHT
);
WeightPdu
weightPdu
;
if
(
ObjectUtils
.
isEmpty
(
value
)){
weightPdu
=
new
WeightPdu
();
}
else
{
weightPdu
=
JSONObject
.
parseObject
(
value
,
WeightPdu
.
class
);
}
for
(
StaffPerformSummaryEntity
item:
list
)
{
StaffEntity
staffEntity
=
staffService
.
get
(
item
.
getStaffId
());
if
(
staffEntity
!=
null
){
item
.
setWorkNum
(
staffEntity
.
getWorkNum
());
item
.
setPhoneNumber
(
staffEntity
.
getPhoneNumber
());
}
computeSummary
(
item
,
weightPdu
);
}
}
}
private
void
computeSummary
(
StaffPerformSummaryEntity
staffPerformSummaryEntity
,
WeightPdu
weightPdu
){
BigDecimal
total
=
new
BigDecimal
(
100
);
BigDecimal
reviewScore
=
total
.
add
(
staffPerformSummaryEntity
.
getReviewScore
());
//评价
reviewScore
=
reviewScore
.
multiply
(
weightPdu
.
reviewWeight
());
staffPerformSummaryEntity
.
setReviewScore
(
reviewScore
.
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
));
BigDecimal
attendScore
=
total
.
add
(
staffPerformSummaryEntity
.
getAttendScore
());
//考勤
attendScore
=
attendScore
.
multiply
(
weightPdu
.
attendWeight
());
staffPerformSummaryEntity
.
setAttendScore
(
attendScore
.
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
));
BigDecimal
otherScore
=
staffPerformSummaryEntity
.
getOtherScore
();
//自评不用加100
if
(
otherScore
.
compareTo
(
BigDecimal
.
ZERO
)==
0
){
otherScore
=
new
BigDecimal
(
100
);
}
otherScore
=
otherScore
.
multiply
(
weightPdu
.
selfWeight
());
staffPerformSummaryEntity
.
setOtherScore
(
otherScore
.
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
));
BigDecimal
goworkScore
=
total
.
add
(
staffPerformSummaryEntity
.
getGoworkScore
());
//办件
goworkScore
=
goworkScore
.
multiply
(
weightPdu
.
goworkWeight
());
staffPerformSummaryEntity
.
setGoworkScore
(
goworkScore
.
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
));
BigDecimal
effectScore
=
total
.
add
(
staffPerformSummaryEntity
.
getEffectScore
());
//效能
effectScore
=
effectScore
.
multiply
(
weightPdu
.
effectWeight
());
staffPerformSummaryEntity
.
setEffectScore
(
effectScore
.
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
));
}
}
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