Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-staff
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 25e699ae
authored
Jan 20, 2026
by
章家宝
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/v5.6.0' into v5.6.0
2 parents
990272c1
3a0b2b7c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
34 deletions
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/dto/perfSalary/PerfAppraisalDetailDTO.java
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/enums/PerformanceTimeCycleCodeEnum.java
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/perfSalary/PerformanceEvaluation.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/mapper/perfSalary/PerformanceEvaluationMapper.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/perfSalary/AutoPerfEvaluationService.java
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/perfSalary/PerformanceEvaluationService.java
rpc-dj-staff/src/main/resources/META-INF/orm/PerformanceEvaluationMapper.xml
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/dto/perfSalary/PerfAppraisalDetailDTO.java
View file @
25e699a
...
@@ -222,9 +222,9 @@ public class PerfAppraisalDetailDTO implements Serializable {
...
@@ -222,9 +222,9 @@ public class PerfAppraisalDetailDTO implements Serializable {
private
Integer
handleStatus
;
private
Integer
handleStatus
;
/**
/**
* 采用类型 1-采用自动绩效 2-采用手动绩效
* 采用类型 1-采用自动绩效 2-采用手动绩效
(null-未开启自动带绩效)
*/
*/
@ApiModelProperty
(
notes
=
"采用类型 1-采用自动绩效 2-采用手动绩效"
)
@ApiModelProperty
(
notes
=
"采用类型 1-采用自动绩效 2-采用手动绩效
(null-未开启自动带绩效)
"
)
private
Integer
adoptType
;
private
Integer
adoptType
;
/**
/**
...
...
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/enums/PerformanceTimeCycleCodeEnum.java
View file @
25e699a
...
@@ -46,7 +46,7 @@ public enum PerformanceTimeCycleCodeEnum {
...
@@ -46,7 +46,7 @@ public enum PerformanceTimeCycleCodeEnum {
*/
*/
T7
(
"T7"
,
"10. 发放最终工资,定稿工资数据"
),
T7
(
"T7"
,
"10. 发放最终工资,定稿工资数据"
),
;
;
;
private
String
code
;
private
final
String
code
;
private
String
desc
;
private
final
String
desc
;
}
}
rpc-dj-staff-api/src/main/java/cn/com/glsx/dj/staff/model/perfSalary/PerformanceEvaluation.java
View file @
25e699a
...
@@ -145,7 +145,7 @@ public class PerformanceEvaluation implements Serializable {
...
@@ -145,7 +145,7 @@ public class PerformanceEvaluation implements Serializable {
/**
/**
* 考勤计算后-
合计
工资
* 考勤计算后-
考勤
工资
*/
*/
@ApiModelProperty
(
notes
=
"考勤计算后-合计工资"
)
@ApiModelProperty
(
notes
=
"考勤计算后-合计工资"
)
@Column
(
name
=
"after_attendance_total_basic_salary"
)
@Column
(
name
=
"after_attendance_total_basic_salary"
)
...
@@ -172,12 +172,6 @@ public class PerformanceEvaluation implements Serializable {
...
@@ -172,12 +172,6 @@ public class PerformanceEvaluation implements Serializable {
@Column
(
name
=
"basic_salary"
)
@Column
(
name
=
"basic_salary"
)
private
BigDecimal
basicSalary
;
private
BigDecimal
basicSalary
;
/**
* 合计应发工资
*/
@ApiModelProperty
(
notes
=
"合计应发工资"
)
@Column
(
name
=
"total_gross_salary"
)
private
BigDecimal
totalGrossSalary
;
/**
/**
* 该月产值
* 该月产值
...
...
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/mapper/perfSalary/PerformanceEvaluationMapper.java
View file @
25e699a
...
@@ -27,4 +27,6 @@ public interface PerformanceEvaluationMapper extends OreMapper<PerformanceEvalua
...
@@ -27,4 +27,6 @@ public interface PerformanceEvaluationMapper extends OreMapper<PerformanceEvalua
List
<
AppraisalInfoDTO
>
perfStaffList
(
PerfRuleReqDTO
perfRuleReqDTO
);
List
<
AppraisalInfoDTO
>
perfStaffList
(
PerfRuleReqDTO
perfRuleReqDTO
);
BigDecimal
getTotalExtraAmount
(
PerfRuleReqDTO
perfRuleReqDTO
);
BigDecimal
getTotalExtraAmount
(
PerfRuleReqDTO
perfRuleReqDTO
);
int
submitOne
(
PerformanceEvaluation
updatePerfAppraisalDetailDTO
);
}
}
\ No newline at end of file
\ No newline at end of file
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/perfSalary/AutoPerfEvaluationService.java
View file @
25e699a
...
@@ -70,10 +70,7 @@ public class AutoPerfEvaluationService {
...
@@ -70,10 +70,7 @@ public class AutoPerfEvaluationService {
autoPerformRuleExample
.
createCriteria
().
andEqualTo
(
"deletedFlag"
,
'N'
)
autoPerformRuleExample
.
createCriteria
().
andEqualTo
(
"deletedFlag"
,
'N'
)
.
andEqualTo
(
"effectiveStatus"
,
EffectiveStatusEnum
.
EFFECTIVE
.
getCode
());
.
andEqualTo
(
"effectiveStatus"
,
EffectiveStatusEnum
.
EFFECTIVE
.
getCode
());
AutoPerformRule
autoPerformRule
=
autoPerformRuleMapper
.
selectOneByExample
(
autoPerformRuleExample
);
AutoPerformRule
autoPerformRule
=
autoPerformRuleMapper
.
selectOneByExample
(
autoPerformRuleExample
);
if
(
ObjectUtil
.
isEmpty
(
autoPerformRule
)
||
(
ObjectUtil
.
isNotEmpty
(
autoPerformRule
)
&&
ObjectUtil
.
equals
(
autoPerformRule
.
getStatus
(),
1
)))
{
// 自动绩效配置为空 或 配置已停用直接返回
return
;
}
// 查询北森同步表 获取该月在职或该月离职的员工
// 查询北森同步表 获取该月在职或该月离职的员工
Example
staffBeisenBaseExample
=
new
Example
(
StaffBeisenBaseInfo
.
class
);
Example
staffBeisenBaseExample
=
new
Example
(
StaffBeisenBaseInfo
.
class
);
// 上个月
// 上个月
...
@@ -141,6 +138,7 @@ public class AutoPerfEvaluationService {
...
@@ -141,6 +138,7 @@ public class AutoPerfEvaluationService {
}
}
log
.
info
(
"phoneOutValueMap:{}"
,
phoneOutValueMap
);
log
.
info
(
"phoneOutValueMap:{}"
,
phoneOutValueMap
);
content
.
clear
();
content
.
clear
();
boolean
judgeAutoPerformRuleEnable
=
ObjectUtil
.
isEmpty
(
autoPerformRule
)
||
(
ObjectUtil
.
isNotEmpty
(
autoPerformRule
)
&&
ObjectUtil
.
equals
(
autoPerformRule
.
getStatus
(),
1
));
List
<
PerformanceEvaluation
>
performanceEvaluations
=
new
ArrayList
<>();
List
<
PerformanceEvaluation
>
performanceEvaluations
=
new
ArrayList
<>();
for
(
StaffBeisenBaseInfo
employee
:
staffBeiSenBaseInfos
)
{
for
(
StaffBeisenBaseInfo
employee
:
staffBeiSenBaseInfos
)
{
log
.
info
(
"开始处理员工 {} 的数据"
,
employee
.
getStaffName
());
log
.
info
(
"开始处理员工 {} 的数据"
,
employee
.
getStaffName
());
...
@@ -183,7 +181,7 @@ public class AutoPerfEvaluationService {
...
@@ -183,7 +181,7 @@ public class AutoPerfEvaluationService {
BigDecimal
afterAttendanceProbationBasicSalary
=
BigDecimal
.
ZERO
;
BigDecimal
afterAttendanceProbationBasicSalary
=
BigDecimal
.
ZERO
;
// 计算-转正期间工资
// 计算-转正期间工资
BigDecimal
afterAttendanceRegularBasicSalary
=
BigDecimal
.
ZERO
;
BigDecimal
afterAttendanceRegularBasicSalary
=
BigDecimal
.
ZERO
;
// 计算-完整工资
// 计算-完整
-考勤
工资
BigDecimal
afterAttendanceTotalBasicSalary
=
BigDecimal
.
ZERO
;
BigDecimal
afterAttendanceTotalBasicSalary
=
BigDecimal
.
ZERO
;
// 考勤数据为空 工资为0
// 考勤数据为空 工资为0
if
(
ObjectUtil
.
isNotEmpty
(
attendanceSummary
))
{
if
(
ObjectUtil
.
isNotEmpty
(
attendanceSummary
))
{
...
@@ -257,9 +255,16 @@ public class AutoPerfEvaluationService {
...
@@ -257,9 +255,16 @@ public class AutoPerfEvaluationService {
}
else
{
}
else
{
log
.
info
(
"员工 {} 的考勤数据为空 底薪为0"
,
employee
.
getStaffName
());
log
.
info
(
"员工 {} 的考勤数据为空 底薪为0"
,
employee
.
getStaffName
());
}
}
// 考勤计算后-试用期阶段工资
performanceEvaluation
.
setAfterAttendanceProbationBasicSalary
(
afterAttendanceProbationBasicSalary
);
performanceEvaluation
.
setAfterAttendanceProbationBasicSalary
(
afterAttendanceProbationBasicSalary
);
// 考勤计算后-转正后阶段工资
performanceEvaluation
.
setAfterAttendanceRegularBasicSalary
(
afterAttendanceRegularBasicSalary
);
performanceEvaluation
.
setAfterAttendanceRegularBasicSalary
(
afterAttendanceRegularBasicSalary
);
// 考勤工资
performanceEvaluation
.
setAfterAttendanceTotalBasicSalary
(
afterAttendanceTotalBasicSalary
);
performanceEvaluation
.
setAfterAttendanceTotalBasicSalary
(
afterAttendanceTotalBasicSalary
);
// 底薪
BigDecimal
baseSalary
=
NumberUtil
.
mul
(
afterAttendanceTotalBasicSalary
,
basicSalaryRatio
).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
performanceEvaluation
.
setBaseSalary
(
baseSalary
);
if
(!
judgeAutoPerformRuleEnable
)
{
// 通过判断产值 判断绩效评级
// 通过判断产值 判断绩效评级
// 计算的评级
// 计算的评级
String
calculatorLevel
;
String
calculatorLevel
;
...
@@ -301,27 +306,33 @@ public class AutoPerfEvaluationService {
...
@@ -301,27 +306,33 @@ public class AutoPerfEvaluationService {
calculatorMonthOnboardTriggerRewardCoefficient
=
autoPerformRule
.
getNoMonthOnboardDefaultRewardCoefficient
();
calculatorMonthOnboardTriggerRewardCoefficient
=
autoPerformRule
.
getNoMonthOnboardDefaultRewardCoefficient
();
}
}
}
}
performanceEvaluation
.
setAutoGradeCode
(
calculatorLevel
);
performanceEvaluation
.
setAutoGradeCode
(
calculatorLevel
);
performanceEvaluation
.
setAutoRewardCoefficient
(
calculatorMonthOnboardTriggerRewardCoefficient
);
performanceEvaluation
.
setAutoRewardCoefficient
(
calculatorMonthOnboardTriggerRewardCoefficient
);
performanceEvaluation
.
setAutoScoreSymbolValue
(
calculatorMonthOnboardTriggerScore
);
performanceEvaluation
.
setAutoScoreSymbolValue
(
calculatorMonthOnboardTriggerScore
);
performanceEvaluation
.
setIsAutoPerformance
(
1
);
// 底薪
BigDecimal
baseSalary
=
NumberUtil
.
mul
(
afterAttendanceTotalBasicSalary
,
basicSalaryRatio
).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
// 绩效工资 = 合计工资 × (1 - 0.7) × 绩效工资系数
// 绩效工资 = 合计工资 × (1 - 0.7) × 绩效工资系数
BigDecimal
performanceSalary
=
NumberUtil
.
mul
(
NumberUtil
.
mul
(
afterAttendanceTotalBasicSalary
,
1
-
basicSalaryRatio
),
calculatorMonthOnboardTriggerRewardCoefficient
)
BigDecimal
performanceSalary
=
NumberUtil
.
mul
(
NumberUtil
.
mul
(
afterAttendanceTotalBasicSalary
,
1
-
basicSalaryRatio
),
calculatorMonthOnboardTriggerRewardCoefficient
)
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
// 基本工资 = (底薪 + 绩效工资)
// 基本工资 = (底薪 + 绩效工资)
BigDecimal
basicSalary
=
NumberUtil
.
add
(
baseSalary
,
performanceSalary
);
BigDecimal
basicSalary
=
NumberUtil
.
add
(
baseSalary
,
performanceSalary
);
performanceEvaluation
.
setBaseSalary
(
baseSalary
);
performanceEvaluation
.
setPerformanceSalary
(
performanceSalary
);
performanceEvaluation
.
setPerformanceSalary
(
performanceSalary
);
performanceEvaluation
.
setBasicSalary
(
basicSalary
);
performanceEvaluation
.
setBasicSalary
(
basicSalary
);
performanceEvaluation
.
setTotalGrossSalary
(
null
);
performanceEvaluation
.
setIsAutoPerformance
(
1
);
performanceEvaluation
.
setAdoptType
(
1
);
performanceEvaluation
.
setAutoGradeType
(
autoGradeType
);
}
else
{
// 未开启自动绩效情况
// 绩效工资设置为0
performanceEvaluation
.
setPerformanceSalary
(
BigDecimal
.
ZERO
);
// 基本工资为底薪
performanceEvaluation
.
setBasicSalary
(
baseSalary
);
performanceEvaluation
.
setIsAutoPerformance
(
0
);
performanceEvaluation
.
setAdoptType
(
null
);
performanceEvaluation
.
setAutoGradeType
(
null
);
}
performanceEvaluation
.
setOutputValue
(
staffOutValue
);
performanceEvaluation
.
setOutputValue
(
staffOutValue
);
performanceEvaluation
.
setAutoPerformanceConfigId
(
autoPerformRule
.
getId
());
performanceEvaluation
.
setAutoPerformanceConfigId
(
autoPerformRule
.
getId
());
performanceEvaluation
.
setPerformanceGradeUuid
(
autoPerformRule
.
getPerformanceLevelUuid
());
performanceEvaluation
.
setPerformanceGradeUuid
(
autoPerformRule
.
getPerformanceLevelUuid
());
performanceEvaluation
.
setAutoGradeType
(
autoGradeType
);
performanceEvaluation
.
setAdoptType
(
1
);
performanceEvaluation
.
setAmountCalculationType
(
1
);
performanceEvaluation
.
setAmountCalculationType
(
1
);
performanceEvaluations
.
add
(
performanceEvaluation
);
performanceEvaluations
.
add
(
performanceEvaluation
);
}
}
...
...
rpc-dj-staff/src/main/java/cn/com/glsx/dj/staff/service/perfSalary/PerformanceEvaluationService.java
View file @
25e699a
package
cn
.
com
.
glsx
.
dj
.
staff
.
service
.
perfSalary
;
package
cn
.
com
.
glsx
.
dj
.
staff
.
service
.
perfSalary
;
import
cn.com.glsx.dj.staff.dto.perfSalary.*
;
import
cn.com.glsx.dj.staff.dto.perfSalary.*
;
import
cn.com.glsx.dj.staff.dto.performance.PerformanceTimeCycleDTO
;
import
cn.com.glsx.dj.staff.enums.PerformanceTimeCycleCodeEnum
;
import
cn.com.glsx.dj.staff.mapper.PerformanceTimeCycleMapper
;
import
cn.com.glsx.dj.staff.mapper.perfSalary.PerformanceEvaluationMapper
;
import
cn.com.glsx.dj.staff.mapper.perfSalary.PerformanceEvaluationMapper
;
import
cn.com.glsx.dj.staff.mapper.perfSalary.PerformanceLevelMapper
;
import
cn.com.glsx.dj.staff.model.perfSalary.PerformanceEvaluation
;
import
cn.com.glsx.dj.staff.model.perfSalary.PerformanceLevel
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Slf4j
@Slf4j
...
@@ -22,6 +34,11 @@ public class PerformanceEvaluationService {
...
@@ -22,6 +34,11 @@ public class PerformanceEvaluationService {
@Resource
@Resource
private
PerformanceEvaluationMapper
performanceEvaluationMapper
;
private
PerformanceEvaluationMapper
performanceEvaluationMapper
;
@Resource
private
PerformanceLevelMapper
performanceLevelMapper
;
@Resource
private
PerformanceTimeCycleMapper
performanceTimeCycleMapper
;
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
public
void
test
(
String
test
)
{
public
void
test
(
String
test
)
{
...
@@ -78,8 +95,19 @@ public class PerformanceEvaluationService {
...
@@ -78,8 +95,19 @@ public class PerformanceEvaluationService {
/**
/**
* 绩效考核-提交-单个处理
* 绩效考核-提交-单个处理
*/
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
rollbackFor
=
RpcServiceException
.
class
)
public
Boolean
perfAppraisalSingleSubmit
(
PerfAppraisalSubmitReqDTO
perfAppraisalSubmitReqDTO
)
{
public
Boolean
perfAppraisalSingleSubmit
(
PerfAppraisalSubmitReqDTO
perfAppraisalSubmitReqDTO
)
{
// 校验
// 校验
// 校验是否在修改的时间
PerformanceTimeCycleDTO
performanceTimeCycleDTO
=
performanceTimeCycleMapper
.
selectByCode
(
PerformanceTimeCycleCodeEnum
.
T1
.
getCode
());
Date
startDate
=
performanceTimeCycleDTO
.
getStartDate
();
Date
endDate
=
performanceTimeCycleDTO
.
getEndDate
();
Date
now
=
DateUtil
.
date
();
// 判断当前时间是否在考核时间范围内 当前时间需要大于等于开始时间,小于等于结束时间
boolean
judgeTime
=
now
.
compareTo
(
startDate
)
<
0
||
now
.
compareTo
(
endDate
)
>
0
;
if
(
judgeTime
)
{
throw
new
RpcServiceException
(
"亲,当前时间不能再提交数据"
);
}
PerfRuleReqDTO
perfRuleReqDTO
=
new
PerfRuleReqDTO
();
PerfRuleReqDTO
perfRuleReqDTO
=
new
PerfRuleReqDTO
();
perfRuleReqDTO
.
setMobilePhone
(
perfAppraisalSubmitReqDTO
.
getMobilePhone
());
perfRuleReqDTO
.
setMobilePhone
(
perfAppraisalSubmitReqDTO
.
getMobilePhone
());
perfRuleReqDTO
.
setQueryMonth
(
perfAppraisalSubmitReqDTO
.
getEvaluationMonth
());
perfRuleReqDTO
.
setQueryMonth
(
perfAppraisalSubmitReqDTO
.
getEvaluationMonth
());
...
@@ -88,22 +116,75 @@ public class PerformanceEvaluationService {
...
@@ -88,22 +116,75 @@ public class PerformanceEvaluationService {
throw
new
RpcServiceException
(
"该员工该月绩效评分数据不存在"
);
throw
new
RpcServiceException
(
"该员工该月绩效评分数据不存在"
);
}
}
if
(
perfAppraisalDetailDTO
.
getSubmitCount
()
>=
2
)
{
if
(
perfAppraisalDetailDTO
.
getSubmitCount
()
>=
2
)
{
throw
new
RpcServiceException
(
"该员工该月绩效评分数据已处理2次"
);
throw
new
RpcServiceException
(
"亲,每月只有修改2次绩效次数,如有问题请联系总部运营,统一增加扣减金额"
);
}
// 判断该月未开启自动绩效 且选择自动绩效 则抛异常
if
(
ObjectUtil
.
notEqual
(
perfAppraisalDetailDTO
.
getIsAutoPerformance
(),
1
)
&&
ObjectUtil
.
equal
(
perfAppraisalSubmitReqDTO
.
getAdoptType
(),
1
)
&&
ObjectUtil
.
isEmpty
(
perfAppraisalSubmitReqDTO
.
getManualFinalPerformanceAmount
()))
{
throw
new
RpcServiceException
(
"亲,该月未开启自动打绩效,请选择手动绩效或填写手动维护最终绩效金额"
);
}
}
// 查询该月该经理下员工可分配绩效金额额度 当前totalExtraAmount大于0则不能提交 小于0时需要计算是否符合
// 查询该月该经理下员工可分配绩效金额额度 当前totalExtraAmount大于0则不能提交 小于0时需要计算是否符合
BigDecimal
totalExtraAmount
=
performanceEvaluationMapper
.
getTotalExtraAmount
(
perfRuleReqDTO
);
BigDecimal
totalExtraAmount
=
performanceEvaluationMapper
.
getTotalExtraAmount
(
perfRuleReqDTO
);
Integer
adoptType
=
perfAppraisalSubmitReqDTO
.
getAdoptType
();
Integer
adoptType
=
perfAppraisalSubmitReqDTO
.
getAdoptType
();
// 通过uuid获取对应的系数
Example
performanceLevelExample
=
new
Example
(
PerformanceLevel
.
class
);
performanceLevelExample
.
createCriteria
().
andEqualTo
(
"uuid"
,
perfAppraisalDetailDTO
.
getPerformanceGradeUuid
());
performanceLevelMapper
.
selectByExample
(
performanceLevelExample
);
List
<
PerformanceLevel
>
performanceLevels
=
performanceLevelMapper
.
selectByExample
(
performanceLevelExample
);
// 按绩效等级获取对应的系数分组 Map<绩效等级, 实体类>
Map
<
String
,
PerformanceLevel
>
performanceLevelMap
=
performanceLevels
.
stream
().
collect
(
Collectors
.
toMap
(
PerformanceLevel:
:
getLevelCode
,
v
->
v
));
// 初始绩效 = 考勤计算后-合计工资 * (1 - basic_salary_ratio)
BigDecimal
initPerfAmt
=
NumberUtil
.
mul
(
perfAppraisalDetailDTO
.
getAfterAttendanceTotalBasicSalary
(),
NumberUtil
.
sub
(
BigDecimal
.
ONE
,
perfAppraisalDetailDTO
.
getBasicSalaryRatio
()));
BigDecimal
subInit
;
// 绩效工资
BigDecimal
performanceSalary
;
// 判断手动绩效金额是否为空
if
(
ObjectUtil
.
isNotEmpty
(
perfAppraisalSubmitReqDTO
.
getManualFinalPerformanceAmount
()))
{
// 手动绩效金额 - 初始绩效
subInit
=
NumberUtil
.
sub
(
perfAppraisalSubmitReqDTO
.
getManualFinalPerformanceAmount
(),
initPerfAmt
);
performanceSalary
=
perfAppraisalSubmitReqDTO
.
getManualFinalPerformanceAmount
();
}
else
{
if
(
adoptType
==
1
)
{
if
(
adoptType
==
1
)
{
// 自动绩效判断 考勤计算后-合计工资 x (1 - basic_salary_ratio) x 评分系数' todz 检查一下
// 自动绩效金额(进行系数计算) = 初始绩效 * 系数
BigDecimal
multiply
=
perfAppraisalDetailDTO
.
getAfterAttendanceTotalBasicSalary
()
performanceSalary
=
NumberUtil
.
mul
(
initPerfAmt
,
perfAppraisalDetailDTO
.
getAutoRewardCoefficient
());
.
multiply
((
BigDecimal
.
ONE
.
divide
(
perfAppraisalDetailDTO
.
getBasicSalaryRatio
()))
// 自动绩效金额 - 初始绩效
.
multiply
(
perfAppraisalDetailDTO
.
getAutoRewardCoefficient
()));
subInit
=
NumberUtil
.
sub
(
performanceSalary
,
initPerfAmt
);
// perfAppraisalDetailDTO.getAutoRewardCoefficient() * perfAppraisalDetailDTO.get()
}
else
{
}
else
{
// 手动绩效判断
// 手动评分绩效判断
// 获取等级对应的系数
BigDecimal
rewardCoefficient
=
performanceLevelMap
.
get
(
perfAppraisalSubmitReqDTO
.
getManualGradeCode
()).
getRewardCoefficient
();
// 手动评分绩效金额 = 初始绩效 * 系数
performanceSalary
=
NumberUtil
.
mul
(
initPerfAmt
,
rewardCoefficient
);
// 手动绩效金额 - 初始绩效
subInit
=
NumberUtil
.
sub
(
performanceSalary
,
initPerfAmt
);
}
}
}
return
null
;
// 判断该金额加上totalExtraAmount是否大于0 如果结果大于0则抛异常说明 当前你名下的驻店销售组员,奖励金额已超出当前扣罚金额,请及时调整整体绩效等级
if
(
NumberUtil
.
add
(
subInit
,
totalExtraAmount
).
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
throw
new
RpcServiceException
(
"亲,当前你名下的驻店销售组员,奖励金额已超出当前扣罚金额,请及时调整整体绩效等级"
);
}
// 更新绩效
boolean
isAuto
=
ObjectUtil
.
equals
(
adoptType
,
1
);
PerformanceEvaluation
updatePerfAppraisal
=
new
PerformanceEvaluation
();
updatePerfAppraisal
.
setId
(
perfAppraisalDetailDTO
.
getId
());
updatePerfAppraisal
.
setAdoptType
(
adoptType
);
updatePerfAppraisal
.
setHandleStatus
(
1
);
updatePerfAppraisal
.
setManualFinalPerformanceAmount
(
perfAppraisalSubmitReqDTO
.
getManualFinalPerformanceAmount
());
updatePerfAppraisal
.
setManualGradeCode
(
isAuto
?
null
:
perfAppraisalSubmitReqDTO
.
getManualGradeCode
());
updatePerfAppraisal
.
setManualRewardCoefficient
(
isAuto
?
null
:
performanceLevelMap
.
get
(
perfAppraisalSubmitReqDTO
.
getManualGradeCode
()).
getRewardCoefficient
());
updatePerfAppraisal
.
setManualScoreSymbolValue
(
isAuto
?
null
:
performanceLevelMap
.
get
(
perfAppraisalSubmitReqDTO
.
getManualGradeCode
()).
getScoreSymbolValue
());
// 绩效工资
updatePerfAppraisal
.
setPerformanceSalary
(
performanceSalary
);
// 基本工资
updatePerfAppraisal
.
setBasicSalary
(
NumberUtil
.
add
(
perfAppraisalDetailDTO
.
getBaseSalary
(),
performanceSalary
));
updatePerfAppraisal
.
setSubmitCount
(
perfAppraisalDetailDTO
.
getSubmitCount
()
+
1
);
int
updateCount
=
performanceEvaluationMapper
.
submitOne
(
updatePerfAppraisal
);
if
(
updateCount
<
1
)
{
throw
new
RpcServiceException
(
"亲,每月只有修改2次绩效次数,如有问题请联系总部运营,统一增加扣减金额"
);
}
return
true
;
}
}
/**
/**
...
...
rpc-dj-staff/src/main/resources/META-INF/orm/PerformanceEvaluationMapper.xml
View file @
25e699a
...
@@ -258,6 +258,7 @@
...
@@ -258,6 +258,7 @@
updated_date = current_timestamp
updated_date = current_timestamp
</insert>
</insert>
<select
id=
"perfAppraisalStatisticsCard"
resultType=
"cn.com.glsx.dj.staff.dto.perfSalary.PerfAppraisalStatisticsCardDTO"
>
<select
id=
"perfAppraisalStatisticsCard"
resultType=
"cn.com.glsx.dj.staff.dto.perfSalary.PerfAppraisalStatisticsCardDTO"
>
SELECT
SELECT
COALESCE(SUM(CASE WHEN grade = 'S' THEN 1 ELSE 0 END), 0) AS sCount,
COALESCE(SUM(CASE WHEN grade = 'S' THEN 1 ELSE 0 END), 0) AS sCount,
...
@@ -460,4 +461,20 @@
...
@@ -460,4 +461,20 @@
and superior_leader_mobile_phone = #{regionManagerMobilePhone}
and superior_leader_mobile_phone = #{regionManagerMobilePhone}
</select>
</select>
<update
id=
"submitOne"
>
update sal_performance_evaluation
set adopt_type = #{adoptType},
handle_status = #{handleStatus},
manual_final_performance_amount = #{manualFinalPerformanceAmount},
manual_grade_code = #{manualGradeCode},
manual_reward_coefficient = #{manualRewardCoefficient},
manual_score_symbol_value = #{manualScoreSymbolValue},
performance_salary = #{performanceSalary},
basic_salary = #{basicSalary},
submit_count = #{submitCount}
where id = #{id}
and deleted_flag = 'N'
and
<![CDATA[ submit_count < 2]]>
</update>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment