4b07306b
姜超
feature(*): 星级特殊调整申请
|
1
2
|
package cn.fw.morax.service.biz.kpi;
|
b365d22a
姜超
feature(*): 申述日期修...
|
3
|
import cn.fw.common.exception.BusinessException;
|
a5953781
姜超
feature(*): 保存、修改...
|
4
|
import cn.fw.common.web.annotation.DisLock;
|
a207ee2d
姜超
feature(*): 星级调整查询人员
|
5
|
import cn.fw.common.web.auth.LoginAuthBean;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
6
|
import cn.fw.morax.common.constant.Constant;
|
29887f53
姜超
feature(*): 审批星级特...
|
7
|
import cn.fw.morax.common.pojo.event.ApprovalResultEvent;
|
7b6ab90b
姜超
feature(*): 绩效保存修...
|
8
9
|
import cn.fw.morax.common.pojo.event.KpiStarAdjustmentEvent;
import cn.fw.morax.common.utils.EventBusUtil;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
10
|
import cn.fw.morax.common.utils.PublicUtil;
|
29887f53
姜超
feature(*): 审批星级特...
|
11
|
import cn.fw.morax.domain.db.ApprovalRecord;
|
43817799
姜超
feature(*): 星级考核审批
|
12
|
import cn.fw.morax.domain.db.kpi.KpiPool;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
13
|
import cn.fw.morax.domain.db.kpi.KpiStarSpecialRule;
|
b365d22a
姜超
feature(*): 申述日期修...
|
14
|
import cn.fw.morax.domain.db.salary.SalaryClosure;
|
ead23336
姜超
feature(*): 新增实体类...
|
15
|
import cn.fw.morax.domain.dto.kpi.KpiStarSpecialRuleDTO;
|
7d586267
姜超
feature(*): 绩效星级特...
|
16
|
import cn.fw.morax.domain.dto.query.SalaryGroupStaffQueryDTO;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
17
|
import cn.fw.morax.domain.enums.SettingStatusEnum;
|
d2feb148
姜超
feature(*): 绩效组人员...
|
18
|
import cn.fw.morax.domain.enums.StarLevelEnum;
|
83fc9174
姜超
feature(*): 薪酬项查询...
|
19
|
import cn.fw.morax.domain.vo.kpi.KpiStarSpecialRuleVO;
|
7d586267
姜超
feature(*): 绩效星级特...
|
20
21
22
|
import cn.fw.morax.domain.vo.salary.StaffSelectVO;
import cn.fw.morax.rpc.ehr.EhrRpcService;
import cn.fw.morax.rpc.ehr.dto.PerformanceStaffDTO;
|
a207ee2d
姜超
feature(*): 星级调整查询人员
|
23
|
import cn.fw.morax.rpc.ehr.dto.StaffBaseInfoDTO;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
24
|
import cn.fw.morax.service.biz.ApprovalBizService;
|
ea8f43d3
姜超
feature(*): 薪酬相关查询接口
|
25
|
import cn.fw.morax.service.biz.salary.SalaryGeneralSettinBizService;
|
b365d22a
姜超
feature(*): 申述日期修...
|
26
|
import cn.fw.morax.service.biz.salary.SalarySettingCommonService;
|
e58a1def
姜超
feature(*): 绩效星级调...
|
27
|
import cn.fw.morax.service.data.ApprovalRecordService;
|
43817799
姜超
feature(*): 星级考核审批
|
28
|
import cn.fw.morax.service.data.kpi.KpiPoolService;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
29
|
import cn.fw.morax.service.data.kpi.KpiStarSpecialRuleService;
|
29887f53
姜超
feature(*): 审批星级特...
|
30
|
import com.alibaba.fastjson.JSON;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
31
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
d2feb148
姜超
feature(*): 绩效组人员...
|
32
|
import com.google.common.collect.Lists;
|
7d586267
姜超
feature(*): 绩效星级特...
|
33
|
import com.google.common.collect.Sets;
|
a5953781
姜超
feature(*): 保存、修改...
|
34
|
import lombok.Getter;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
35
36
|
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
|
a5953781
姜超
feature(*): 保存、修改...
|
37
|
import org.springframework.beans.factory.annotation.Value;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
38
39
40
|
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
|
43817799
姜超
feature(*): 星级考核审批
|
41
|
import java.time.LocalDate;
|
a207ee2d
姜超
feature(*): 星级调整查询人员
|
42
|
import java.time.LocalDateTime;
|
43817799
姜超
feature(*): 星级考核审批
|
43
|
import java.time.YearMonth;
|
a207ee2d
姜超
feature(*): 星级调整查询人员
|
44
45
|
import java.time.ZoneId;
import java.time.temporal.TemporalAdjusters;
|
022c7dcd
张志伟
feature(*): 薪资数据上...
|
46
|
import java.util.*;
|
7d586267
姜超
feature(*): 绩效星级特...
|
47
|
import java.util.stream.Collectors;
|
43817799
姜超
feature(*): 星级考核审批
|
48
|
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
49
50
51
52
53
54
55
|
import static cn.fw.common.businessvalidator.Validator.BV;
@RequiredArgsConstructor
@Service
@Slf4j
public class KpiStarSpecialRuleBizService {
|
b365d22a
姜超
feature(*): 申述日期修...
|
56
|
private final SalarySettingCommonService salarySettingCommonService;
|
ea8f43d3
姜超
feature(*): 薪酬相关查询接口
|
57
|
private final SalaryGeneralSettinBizService salaryGeneralSettinBizService;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
58
|
private final KpiStarSpecialRuleService kpiStarSpecialRuleService;
|
e58a1def
姜超
feature(*): 绩效星级调...
|
59
|
private final ApprovalRecordService approvalRecordService;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
60
|
private final ApprovalBizService approvalBizService;
|
43817799
姜超
feature(*): 星级考核审批
|
61
|
private final KpiPoolService kpiPoolService;
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
62
|
private final KpiPoolBizService kpiPoolBizService;
|
7d586267
姜超
feature(*): 绩效星级特...
|
63
|
private final EhrRpcService ehrRpcService;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
64
|
|
a5953781
姜超
feature(*): 保存、修改...
|
65
66
67
68
|
@Value("${spring.cache.custom.global-prefix}:kpi:star:adjustment:")
@Getter
private String savePrefix;
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
69
70
|
/**
* 申请绩效星级特殊调整
|
b8b6eb02
姜超
feature(*): 接口注释修改
|
71
|
*
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
72
73
74
|
* @param dto
*/
@Transactional(rollbackFor = Exception.class)
|
a5953781
姜超
feature(*): 保存、修改...
|
75
|
@DisLock(prefix = "#this.getSavePrefix()", key = "#dto.getUserId()", message = "保存中,请勿重复操作")
|
e58a1def
姜超
feature(*): 绩效星级调...
|
76
|
public void applyKpiStarAdjustment(KpiStarSpecialRuleDTO dto, LoginAuthBean user) {
|
b365d22a
姜超
feature(*): 申述日期修...
|
77
|
Date expTime = this.checkAppealDate(dto.getUserId());
|
84815243
姜超
feature(*): 星级特殊人...
|
78
79
80
81
|
this.checkAdjustment(dto.getUserId());
KpiStarSpecialRule specialRule = this.convertToPo(dto);
Boolean result = kpiStarSpecialRuleService.save(specialRule);
BV.isTrue(result, Constant.SAVE_FAIL_RETRY_PROMPT);
|
b365d22a
姜超
feature(*): 申述日期修...
|
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
approvalBizService.applyKpiStarAdjustment(specialRule, user, expTime);
}
/**
* 查询薪酬系统配置
*
* @param
* @return
*/
public Date checkAppealDate(Long userId) {
StaffBaseInfoDTO staffBaseInfo = ehrRpcService.queryStaffBaseInfo(userId);
BV.notNull(staffBaseInfo, "员工信息为空");
SalaryClosure salaryClosure = salarySettingCommonService.queryShopClosure(staffBaseInfo.getShopId(), YearMonth.now().minusMonths(1));
if (PublicUtil.isEmpty(salaryClosure)) {
throw new BusinessException("上月还未关单,不能申请");
}
|
707b76c5
姜超
feature(*): 申述日期修...
|
99
|
LocalDateTime expTime = salaryClosure.getApproveEndTime().atTime(23,59,59);
|
b365d22a
姜超
feature(*): 申述日期修...
|
100
|
return Date.from(expTime.atZone(ZoneId.systemDefault()).toInstant());
|
84815243
姜超
feature(*): 星级特殊人...
|
101
102
103
104
105
106
107
108
|
}
/**
* 检查是否有审批中的星级特殊调整
*
* @param userId
*/
public void checkAdjustment(Long userId) {
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
109
110
111
|
Integer approvingRecords = kpiStarSpecialRuleService.count(Wrappers.<KpiStarSpecialRule>lambdaQuery()
.eq(KpiStarSpecialRule::getStatus, SettingStatusEnum.APPROVING)
.eq(KpiStarSpecialRule::getUserId, userId)
|
98f0b2aa
姜超
feature(*): 添加yn判断
|
112
|
.eq(KpiStarSpecialRule::getYn, Boolean.TRUE)
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
113
114
|
);
BV.isFalse(approvingRecords > 0, "已有申请中的星级考核调整");
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
115
116
117
118
|
}
/**
* 检查并转换dto
|
b8b6eb02
姜超
feature(*): 接口注释修改
|
119
|
*
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
120
121
122
|
* @param dto
* @return
*/
|
84815243
姜超
feature(*): 星级特殊人...
|
123
|
private KpiStarSpecialRule convertToPo(KpiStarSpecialRuleDTO dto) {
|
ea8f43d3
姜超
feature(*): 薪酬相关查询接口
|
124
|
Long groupId = dto.getGroupId();
|
7b6ab90b
姜超
feature(*): 绩效保存修...
|
125
|
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
126
127
128
|
KpiStarSpecialRule kpiStarSpecialRule = new KpiStarSpecialRule();
kpiStarSpecialRule.setUserId(dto.getUserId());
kpiStarSpecialRule.setUserName(dto.getUserName());
|
7b6ab90b
姜超
feature(*): 绩效保存修...
|
129
|
//几月开始绩效考核
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
130
131
132
133
134
135
136
137
138
139
140
141
|
if (PublicUtil.isNotEmpty(dto.getStartingKpiEnum())) {
switch (dto.getStartingKpiEnum()) {
case CURRENT_MONTH: {
kpiStarSpecialRule.setEarliestStartingMonthly(PublicUtil.getCurMonthFirstDay());
break;
}
case NEXT_MONTH: {
kpiStarSpecialRule.setEarliestStartingMonthly(PublicUtil.getNextMonthFirstDay());
break;
}
}
}
|
7b6ab90b
姜超
feature(*): 绩效保存修...
|
142
143
|
//未核发工资月度星级调整
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
144
|
if (PublicUtil.isNotEmpty(dto.getRevisedMonthly())) {
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
145
146
147
|
kpiStarSpecialRule.setRevisedMonthly(dto.getRevisedMonthly().atDay(1));
kpiStarSpecialRule.setRevisedLevel(dto.getRevisedLevel());
}
|
7b6ab90b
姜超
feature(*): 绩效保存修...
|
148
149
|
//上个月绩效考核不算,按C级计算工资
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
150
|
if (PublicUtil.isNotEmpty(dto.getExclusionLastMonth()) && dto.getExclusionLastMonth()) {
|
7b6ab90b
姜超
feature(*): 绩效保存修...
|
151
|
kpiStarSpecialRule.setExclusionMonthly(PublicUtil.getCurMonthEndDay().plusMonths(-1));
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
152
|
}
|
7b6ab90b
姜超
feature(*): 绩效保存修...
|
153
154
|
//免除D级次数
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
155
156
157
158
159
160
161
|
if (PublicUtil.isNotEmpty(dto.getRevokedTimes())) {
Boolean revokedCorrect = dto.getRevokedTimes() >= 1 && dto.getRevokedTimes() <= 3;
BV.isTrue(revokedCorrect, "免除D级次数只能在1-3次之间");
kpiStarSpecialRule.setRevokedTimes(dto.getRevokedTimes());
}
kpiStarSpecialRule.setReason(dto.getReason());
kpiStarSpecialRule.setAttachment(dto.getAttachment());
|
ea8f43d3
姜超
feature(*): 薪酬相关查询接口
|
162
|
kpiStarSpecialRule.setGroupId(groupId);
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
163
164
165
166
|
kpiStarSpecialRule.setStatus(SettingStatusEnum.APPROVING);
return kpiStarSpecialRule;
}
|
d2feb148
姜超
feature(*): 绩效组人员...
|
167
168
|
/**
* 绩效星级考核调整审批
|
b8b6eb02
姜超
feature(*): 接口注释修改
|
169
|
*
|
7c9d0419
姜超
feature(*): 注释修改、...
|
170
|
* @param approvalRecord
|
d2feb148
姜超
feature(*): 绩效组人员...
|
171
172
|
* @param resultEvent
*/
|
29887f53
姜超
feature(*): 审批星级特...
|
173
|
@Transactional(rollbackFor = Exception.class)
|
7c9d0419
姜超
feature(*): 注释修改、...
|
174
|
public void approvalKpiStarAdjustment(ApprovalRecord approvalRecord, ApprovalResultEvent resultEvent) {
|
d2feb148
姜超
feature(*): 绩效组人员...
|
175
|
log.info("收到绩效星级考核调整审批信息:{}", JSON.toJSONString(resultEvent));
|
022c7dcd
张志伟
feature(*): 薪资数据上...
|
176
177
178
|
boolean agree = Boolean.TRUE.equals(resultEvent.getAgree());
KpiStarSpecialRule specialRule = kpiStarSpecialRuleService.getById(approvalRecord.getDataId());
if (Objects.isNull(specialRule)) {
|
29887f53
姜超
feature(*): 审批星级特...
|
179
180
|
return;
}
|
022c7dcd
张志伟
feature(*): 薪资数据上...
|
181
182
183
184
185
186
|
if (!agree) {
specialRule.setStatus(SettingStatusEnum.INEFFECTIVE);
} else {
specialRule.setStatus(SettingStatusEnum.EFFECTIVE);
}
kpiStarSpecialRuleService.updateById(specialRule);
|
d2feb148
姜超
feature(*): 绩效组人员...
|
187
|
this.adjustmentKpiData(specialRule);
|
29887f53
姜超
feature(*): 审批星级特...
|
188
189
|
}
|
29887f53
姜超
feature(*): 审批星级特...
|
190
191
|
/**
* 调整绩效星级
|
d2feb148
姜超
feature(*): 绩效组人员...
|
192
193
194
195
|
* 1. 开始绩效考核月度
* 2. 未核发工资月度星级调整
* 3. 上个月绩效考核不算,按C级计算工资
* 4. 免除D级次数
|
b8b6eb02
姜超
feature(*): 接口注释修改
|
196
|
*
|
29887f53
姜超
feature(*): 审批星级特...
|
197
198
199
|
* @param specialRule
*/
@Transactional(rollbackFor = Exception.class)
|
25a37717
张志伟
feature(*): 完成星级变...
|
200
|
public void adjustmentKpiData(KpiStarSpecialRule specialRule) {
|
022c7dcd
张志伟
feature(*): 薪资数据上...
|
201
202
203
|
if (!SettingStatusEnum.EFFECTIVE.equals(specialRule.getStatus())) {
return;
}
|
d2feb148
姜超
feature(*): 绩效组人员...
|
204
|
Long userId = specialRule.getUserId();
|
a0684221
姜超
feature(*): 完善绩效配置代码
|
205
206
|
//未设置开始绩效考核月度
Boolean noSetKpiStartMonthRule = true;
|
29887f53
姜超
feature(*): 审批星级特...
|
207
208
|
//开始考核日期
if (PublicUtil.isNotEmpty(specialRule.getEarliestStartingMonthly())) {
|
a0684221
姜超
feature(*): 完善绩效配置代码
|
209
|
noSetKpiStartMonthRule = false;
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
210
|
this.resetKpiDate(userId, YearMonth.from(specialRule.getEarliestStartingMonthly()));
|
29887f53
姜超
feature(*): 审批星级特...
|
211
212
213
|
}
//修正未核发工资月度星级
if (PublicUtil.isNotEmpty(specialRule.getRevisedMonthly())) {
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
214
|
this.starAdjustmentEvent(specialRule.getRevisedLevel(), userId, YearMonth.from(specialRule.getRevisedMonthly()));
|
29887f53
姜超
feature(*): 审批星级特...
|
215
|
}
|
d2feb148
姜超
feature(*): 绩效组人员...
|
216
|
//哪个月绩效考核不算,按C级计算工资(只能算上月)
|
29887f53
姜超
feature(*): 审批星级特...
|
217
|
if (PublicUtil.isNotEmpty(specialRule.getExclusionMonthly())) {
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
218
|
this.starAdjustmentEvent(StarLevelEnum.C, userId, YearMonth.from(specialRule.getExclusionMonthly()));
|
29887f53
姜超
feature(*): 审批星级特...
|
219
220
221
|
}
//免除D级次数
if (PublicUtil.isNotEmpty(specialRule.getRevokedTimes())) {
|
d2feb148
姜超
feature(*): 绩效组人员...
|
222
223
|
this.revokedKpiTimes(specialRule);
}
|
29887f53
姜超
feature(*): 审批星级特...
|
224
|
|
d2feb148
姜超
feature(*): 绩效组人员...
|
225
|
//没有开始绩效考核月度设置,就将绩效星级规则状态设置为失效
|
a0684221
姜超
feature(*): 完善绩效配置代码
|
226
|
if (noSetKpiStartMonthRule) {
|
baf571c2
姜超
feature(*): 查询员工星...
|
227
|
kpiStarSpecialRuleService.update(Wrappers.<KpiStarSpecialRule>lambdaUpdate()
|
d2feb148
姜超
feature(*): 绩效组人员...
|
228
229
230
|
.set(KpiStarSpecialRule::getStatus, SettingStatusEnum.INEFFECTIVE)
.eq(KpiStarSpecialRule::getId, specialRule.getId())
);
|
d2feb148
姜超
feature(*): 绩效组人员...
|
231
232
233
234
235
236
237
238
239
|
}
}
/**
* 失效旧绩效星级特殊规则(开始绩效考核月度设置 使用)
*
* @param userId
*/
@Transactional(rollbackFor = Exception.class)
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
240
|
public void inEffectiveOldSpecialRule(Long userId, Long specialRuleId) {
|
918e8642
姜超
fix(Service): 更新语句修改
|
241
|
List<KpiStarSpecialRule> specialRules = kpiStarSpecialRuleService.list(Wrappers.<KpiStarSpecialRule>lambdaQuery()
|
d2feb148
姜超
feature(*): 绩效组人员...
|
242
243
|
.eq(KpiStarSpecialRule::getStatus, SettingStatusEnum.EFFECTIVE)
.eq(KpiStarSpecialRule::getUserId, userId)
|
98f0b2aa
姜超
feature(*): 添加yn判断
|
244
|
.eq(KpiStarSpecialRule::getYn, Boolean.TRUE)
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
245
|
.ne(KpiStarSpecialRule::getId, specialRuleId)
|
d2feb148
姜超
feature(*): 绩效组人员...
|
246
247
248
249
|
);
if (PublicUtil.isEmpty(specialRules)) {
return;
}
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
250
|
List<Long> inEffectiveRulesIds = Lists.newArrayList();
|
d2feb148
姜超
feature(*): 绩效组人员...
|
251
252
|
for (KpiStarSpecialRule rule : specialRules) {
if (PublicUtil.isNotEmpty(rule.getEarliestStartingMonthly())) {
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
253
|
inEffectiveRulesIds.add(rule.getId());
|
d2feb148
姜超
feature(*): 绩效组人员...
|
254
255
|
}
}
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
256
|
if (PublicUtil.isNotEmpty(inEffectiveRulesIds)) {
|
98f0b2aa
姜超
feature(*): 添加yn判断
|
257
|
kpiStarSpecialRuleService.update(Wrappers.<KpiStarSpecialRule>lambdaUpdate()
|
d2feb148
姜超
feature(*): 绩效组人员...
|
258
|
.set(KpiStarSpecialRule::getStatus, SettingStatusEnum.INEFFECTIVE)
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
259
|
.in(KpiStarSpecialRule::getId, inEffectiveRulesIds)
|
d2feb148
姜超
feature(*): 绩效组人员...
|
260
|
);
|
d2feb148
姜超
feature(*): 绩效组人员...
|
261
262
263
264
265
|
}
}
/**
|
a0684221
姜超
feature(*): 完善绩效配置代码
|
266
|
* 免除D级次数(最近一年之内)
|
b8b6eb02
姜超
feature(*): 接口注释修改
|
267
|
*
|
d2feb148
姜超
feature(*): 绩效组人员...
|
268
269
270
271
272
|
* @param specialRule
*/
@Transactional(rollbackFor = Exception.class)
public void revokedKpiTimes(KpiStarSpecialRule specialRule) {
Long userId = specialRule.getUserId();
|
6467e2b8
张志伟
|
273
274
275
276
277
|
int revokedTimes = specialRule.getRevokedTimes();
YearMonth yearMonth = YearMonth.now().minusMonths(1L);
List<KpiPool> list = kpiPoolService.list(Wrappers.<KpiPool>lambdaQuery()
.eq(KpiPool::getGroupId, specialRule.getGroupId())
|
d2feb148
姜超
feature(*): 绩效组人员...
|
278
|
.eq(KpiPool::getUserId, userId)
|
6467e2b8
张志伟
|
279
280
281
|
.eq(KpiPool::getInclusion, Boolean.TRUE)
.eq(KpiPool::getYn, Boolean.TRUE)
.le(KpiPool::getMonthly, yearMonth)
|
d2feb148
姜超
feature(*): 绩效组人员...
|
282
|
.orderByDesc(KpiPool::getMonthly)
|
6467e2b8
张志伟
|
283
|
.last(" limit 12 ")
|
d2feb148
姜超
feature(*): 绩效组人员...
|
284
|
);
|
6467e2b8
张志伟
|
285
286
|
for (KpiPool kpiPool : list) {
|
d2feb148
姜超
feature(*): 绩效组人员...
|
287
|
if (StarLevelEnum.D.equals(kpiPool.getStarLevel()) && revokedTimes > 0) {
|
6467e2b8
张志伟
|
288
289
|
kpiPool.setRevoked(Boolean.TRUE);
revokedTimes--;
|
d2feb148
姜超
feature(*): 绩效组人员...
|
290
291
|
}
}
|
6467e2b8
张志伟
|
292
|
kpiPoolService.updateBatchById(list);
|
29887f53
姜超
feature(*): 审批星级特...
|
293
294
|
}
|
b7dd7786
姜超
feature(*): 阶梯值校验...
|
295
296
|
/**
* 绩效星级特殊规则详情
|
b8b6eb02
姜超
feature(*): 接口注释修改
|
297
|
*
|
b7dd7786
姜超
feature(*): 阶梯值校验...
|
298
299
300
|
* @param kpiStarSpecialRuleId
* @return
*/
|
83fc9174
姜超
feature(*): 薪酬项查询...
|
301
|
public KpiStarSpecialRuleVO getKpiStarSpecialRuleDetail(Long kpiStarSpecialRuleId) {
|
b7dd7786
姜超
feature(*): 阶梯值校验...
|
302
|
KpiStarSpecialRule kpiStarSpecialRule = kpiStarSpecialRuleService.getById(kpiStarSpecialRuleId);
|
cbb0e628
姜超
feature(*): 人事系统对...
|
303
|
BV.notNull(kpiStarSpecialRule, "绩效星级特殊规则不存在");
|
83fc9174
姜超
feature(*): 薪酬项查询...
|
304
|
KpiStarSpecialRuleVO kpiStarSpecialRuleVo = PublicUtil.copy(kpiStarSpecialRule, KpiStarSpecialRuleVO.class);
|
b7dd7786
姜超
feature(*): 阶梯值校验...
|
305
|
KpiPool kpiPool = kpiPoolService.getOne(Wrappers.<KpiPool>lambdaUpdate()
|
25a37717
张志伟
feature(*): 完成星级变...
|
306
|
.eq(KpiPool::getUserId, kpiStarSpecialRule.getUserId())
|
07b31968
jiangchao
fix(bug): 查询绩效池加上...
|
307
|
.eq(KpiPool::getYn, Boolean.TRUE)
|
cbb0e628
姜超
feature(*): 人事系统对...
|
308
|
.orderByDesc(KpiPool::getId)
|
25a37717
张志伟
feature(*): 完成星级变...
|
309
|
.last("limit 1")
|
cbb0e628
姜超
feature(*): 人事系统对...
|
310
|
// .ge(KpiPool::getMonthly, kpiStarSpecialRule.getRevisedMonthly())
|
b7dd7786
姜超
feature(*): 阶梯值校验...
|
311
312
313
314
|
);
kpiStarSpecialRuleVo.setRevisedMonthLevel(kpiPool.getStarLevel());
return kpiStarSpecialRuleVo;
}
|
7d586267
姜超
feature(*): 绩效星级特...
|
315
316
317
318
319
320
321
322
|
/**
* 绩效星级特殊调整人员
*
* @param dto
* @return
*/
public List<StaffSelectVO> queryStarAdjustmentStaffs(SalaryGroupStaffQueryDTO dto) {
|
7d586267
姜超
feature(*): 绩效星级特...
|
323
324
325
326
327
328
|
List<PerformanceStaffDTO> staffs = ehrRpcService.queryKpiStaffByName(dto.getPostId(), dto.getShopIds(), dto.getStaffName());
LocalDate lastMonth = LocalDate.now().plusMonths(-1);
List<KpiPool> poolList = kpiPoolService.list(Wrappers.<KpiPool>lambdaQuery()
.eq(KpiPool::getPostId, dto.getPostId())
.in(KpiPool::getShopId, dto.getShopIds())
.eq(KpiPool::getMonthly, lastMonth)
|
a207ee2d
姜超
feature(*): 星级调整查询人员
|
329
|
.like(PublicUtil.isNotEmpty(dto.getStaffName()), KpiPool::getUserName, dto.getStaffName())
|
7d586267
姜超
feature(*): 绩效星级特...
|
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
|
.eq(KpiPool::getYn, Boolean.TRUE)
);
Set<Long> staffIds = Sets.newHashSetWithExpectedSize(staffs.size() + poolList.size());
List<StaffSelectVO> selectVOS = staffs.stream().map(staffDTO -> {
StaffSelectVO staffSelectVO = new StaffSelectVO();
staffIds.add(staffDTO.getId());
staffSelectVO.setId(staffDTO.getId());
staffSelectVO.setName(staffDTO.getName());
return staffSelectVO;
}).collect(Collectors.toList());
poolList.forEach(pool -> {
if (staffIds.contains(pool.getUserId())) {
return;
}
StaffSelectVO staffSelectVO = new StaffSelectVO();
staffIds.add(pool.getUserId());
staffSelectVO.setId(pool.getUserId());
staffSelectVO.setName(pool.getUserName());
selectVOS.add(staffSelectVO);
});
return selectVOS;
}
|
a207ee2d
姜超
feature(*): 星级调整查询人员
|
353
354
355
356
357
358
359
360
|
/**
* 绩效星级特殊调整人员
*
* @param user
* @return
*/
public List<StaffSelectVO> queryLastMonthManageStaffs(LoginAuthBean user) {
|
a207ee2d
姜超
feature(*): 星级调整查询人员
|
361
|
Long userId = user.getUserId();
|
74bc017b
姜超
feature(*): 修改bug
|
362
|
this.checkAppealDate(userId);
|
a207ee2d
姜超
feature(*): 星级调整查询人员
|
363
|
List<StaffBaseInfoDTO> managerStaffs = ehrRpcService.queryManageStaffs(userId);
|
cc9fae5a
姜超
feature(*): 保存校验修改
|
364
365
366
|
if (PublicUtil.isEmpty(managerStaffs)) {
managerStaffs = new ArrayList<>();
}
|
a207ee2d
姜超
feature(*): 星级调整查询人员
|
367
368
369
370
|
LocalDateTime lastMonth = LocalDateTime.now().minusMonths(1);
Date firstDayOfLastMonth = Date.from(lastMonth.with(TemporalAdjusters.firstDayOfMonth()).atZone(ZoneId.systemDefault()).toInstant());
Date endDayOfLastMonth = Date.from(lastMonth.with(TemporalAdjusters.lastDayOfMonth()).atZone(ZoneId.systemDefault()).toInstant());
List<StaffBaseInfoDTO> leaveManagerStaffs = ehrRpcService.queryLeaveManageStaffs(userId, firstDayOfLastMonth, endDayOfLastMonth);
|
cc9fae5a
姜超
feature(*): 保存校验修改
|
371
372
373
|
if (PublicUtil.isNotEmpty(leaveManagerStaffs)) {
managerStaffs.addAll(leaveManagerStaffs);
}
|
baf571c2
姜超
feature(*): 查询员工星...
|
374
|
List<StaffSelectVO> selectVOS = managerStaffs.stream()
|
022c7dcd
张志伟
feature(*): 薪资数据上...
|
375
|
.filter(staff -> (!staff.getId().equals(userId)))
|
6467e2b8
张志伟
|
376
|
.map(staff -> new StaffSelectVO(staff.getId(), staff.getName())).collect(Collectors.toList());
|
a207ee2d
姜超
feature(*): 星级调整查询人员
|
377
378
379
|
return selectVOS;
}
|
baf571c2
姜超
feature(*): 查询员工星...
|
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
|
/**
* 查询员工绩效星级
*
* @param userId
* @return
*/
public String getStaffKpiStar(Long userId, YearMonth yearMonth) {
KpiPool pool = kpiPoolService.getOne(Wrappers.<KpiPool>lambdaQuery()
.eq(KpiPool::getMonthly, yearMonth)
.eq(KpiPool::getUserId, userId)
.eq(KpiPool::getInclusion, Boolean.TRUE)
.eq(KpiPool::getYn, Boolean.TRUE)
.orderByAsc(KpiPool::getId)
.last("limit 1")
);
if (PublicUtil.isEmpty(pool)) {
return null;
}
//当实际星级 和 绩效星级不一致,可能绩效星级已经被调整,返回实际星级
|
022c7dcd
张志伟
feature(*): 薪资数据上...
|
399
|
if (PublicUtil.isNotEmpty(pool.getActualStar()) && (!pool.getStarLevel().equals(pool.getActualStar()))) {
|
baf571c2
姜超
feature(*): 查询员工星...
|
400
401
402
403
|
return pool.getActualStar().getName();
}
return pool.getStarLevel().getName();
}
|
e58a1def
姜超
feature(*): 绩效星级调...
|
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
/**
* 绩效星级特殊调整详情
*
* @param approvalNo
*/
public KpiStarSpecialRuleVO getKpiStarAdjustment(String approvalNo) {
ApprovalRecord approvalRecord = approvalRecordService.getOne(Wrappers.<ApprovalRecord>lambdaQuery()
.eq(ApprovalRecord::getApprovalNo, approvalNo));
BV.notNull(approvalRecord, "绩效星级特殊调整审批不存在");
KpiStarSpecialRule specialRule = kpiStarSpecialRuleService.getById(approvalRecord.getDataId());
BV.notNull(specialRule, "绩效星级特殊调整审批不存在");
KpiStarSpecialRuleVO kpiStarSpecialRuleVO = PublicUtil.copy(specialRule, KpiStarSpecialRuleVO.class);
if (PublicUtil.isNotEmpty(specialRule.getRevisedMonthly())) {
KpiPool kpiPool = kpiPoolService.getOne(Wrappers.<KpiPool>lambdaUpdate()
.eq(KpiPool::getUserId, specialRule.getUserId())
.eq(KpiPool::getMonthly, YearMonth.from(specialRule.getRevisedMonthly()))
|
07b31968
jiangchao
fix(bug): 查询绩效池加上...
|
421
|
.eq(KpiPool::getYn, Boolean.TRUE)
|
e58a1def
姜超
feature(*): 绩效星级调...
|
422
423
424
425
426
427
428
429
430
431
|
.orderByDesc(KpiPool::getId)
.last("limit 1")
// .ge(KpiPool::getMonthly, kpiStarSpecialRule.getRevisedMonthly())
);
if (PublicUtil.isNotEmpty(kpiPool)) {
kpiStarSpecialRuleVO.setRevisedMonthLevel(kpiPool.getStarLevel());
}
}
return kpiStarSpecialRuleVO;
}
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
|
/**
* 修正未核发工资月度星级
*
* @param revisedLevel
* @param userId
* @param monthly
*/
@Transactional(rollbackFor = Exception.class)
public void starAdjustmentEvent(StarLevelEnum revisedLevel, Long userId, YearMonth monthly) {
kpiPoolService.update(Wrappers.<KpiPool>lambdaUpdate()
.set(KpiPool::getActualStar, revisedLevel)
.eq(KpiPool::getUserId, userId)
.eq(KpiPool::getMonthly, monthly)
);
EventBusUtil.asyncPost(KpiStarAdjustmentEvent.builder()
.userId(userId)
.yearMonth(monthly)
.build());
}
/**
* 几月开始考核,将几月之前绩效设置为不参与计算
*
* @param userId
* @param monthly
*/
@Transactional(rollbackFor = Exception.class)
public void resetKpiDate(Long userId, YearMonth monthly) {
|
6467e2b8
张志伟
|
461
462
|
kpiPoolService.update(Wrappers.<KpiPool>lambdaUpdate()
.set(KpiPool::getInclusion, Boolean.FALSE)
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
463
464
465
466
|
.eq(KpiPool::getUserId, userId)
.lt(KpiPool::getMonthly, monthly)
.eq(KpiPool::getYn, Boolean.TRUE)
);
|
ef61f23a
姜超
feature(*): 绩效星级特...
|
467
468
|
}
|
4b07306b
姜超
feature(*): 星级特殊调整申请
|
469
|
}
|