Commit 1355883a3842eb74c66ff9ce4bda6a9b4b0e37c4
1 parent
9cabf1b9
feature(*): 人员调岗修改绩效组人员数据
人员调岗修改绩效组人员数据
Showing
4 changed files
with
25 additions
and
6 deletions
fw-morax-server/src/main/java/cn/fw/morax/server/consumer/EhrStaffPostConsumer.java
... | ... | @@ -87,9 +87,9 @@ public class EhrStaffPostConsumer implements RocketMQListener<StaffPostChangeEve |
87 | 87 | |
88 | 88 | Long userId = result.getStaffId(); |
89 | 89 | //开始计算绩效时间 |
90 | - kpiGroupUserBizService.calcStartKpiDate(userId); | |
90 | + LocalDate startKpiDate = kpiGroupUserBizService.calcStartKpiDate(userId); | |
91 | 91 | //失效当前所有绩效池数据 |
92 | - kpiPoolBizService.invalidKpiPool(userId); | |
92 | + kpiPoolBizService.invalidKpiPool(originKpiGroup, userId, startKpiDate); | |
93 | 93 | } |
94 | 94 | |
95 | 95 | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/IndicatorBizService.java
... | ... | @@ -186,6 +186,7 @@ public class IndicatorBizService { |
186 | 186 | .distinct().collect(Collectors.toList()); |
187 | 187 | Boolean queryManagerRole = hasManagerRole(roleCodes); |
188 | 188 | IndicatorPostQueryDTO dto = new IndicatorPostQueryDTO(roleCodes, queryManagerRole); |
189 | +// IndicatorPostQueryDTO dto = new IndicatorPostQueryDTO(new ArrayList<String>(){{add("FWGW");add("XSGW");}}, Boolean.TRUE); | |
189 | 190 | return indicatorsService.getPostIndicators(dto); |
190 | 191 | } |
191 | 192 | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/KpiGroupUserBizService.java
... | ... | @@ -491,7 +491,7 @@ public class KpiGroupUserBizService { |
491 | 491 | * |
492 | 492 | * @param userId |
493 | 493 | */ |
494 | - public void calcStartKpiDate(Long userId) { | |
494 | + public LocalDate calcStartKpiDate(Long userId) { | |
495 | 495 | String key = getStartKpiKey() + userId; |
496 | 496 | BoundValueOperations<String, String> strOps = stringRedisTemplate.boundValueOps(key); |
497 | 497 | LocalDate currentDate = LocalDate.now(); |
... | ... | @@ -500,6 +500,7 @@ public class KpiGroupUserBizService { |
500 | 500 | //若定时器执行之前key失效,那么不能正确赋值开始计算考核时间,多加一天 |
501 | 501 | days = days + 1; |
502 | 502 | strOps.set(startKpiDate.toString(), days, TimeUnit.DAYS); |
503 | + return startKpiDate; | |
503 | 504 | } |
504 | 505 | |
505 | 506 | /** | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/KpiPoolBizService.java
... | ... | @@ -11,6 +11,7 @@ import cn.fw.morax.domain.bo.kpi.KpiGroupCalculableRankBO; |
11 | 11 | import cn.fw.morax.domain.bo.kpi.KpiRankCalculableBO; |
12 | 12 | import cn.fw.morax.domain.bo.kpi.KpiStarLadderBO; |
13 | 13 | import cn.fw.morax.domain.db.kpi.*; |
14 | +import cn.fw.morax.domain.enums.KpiIgnoreCauseEnum; | |
14 | 15 | import cn.fw.morax.domain.enums.ScoreWayEnum; |
15 | 16 | import cn.fw.morax.domain.enums.StarEvaluationEnum; |
16 | 17 | import cn.fw.morax.domain.enums.StarLevelEnum; |
... | ... | @@ -61,6 +62,7 @@ public class KpiPoolBizService { |
61 | 62 | private final KpiGroupRankService kpiGroupRankService; |
62 | 63 | private final StringRedisTemplate stringRedisTemplate; |
63 | 64 | private final KpiGroupUserService kpiGroupUserService; |
65 | + private final KpiPoolCommonService kpiPoolCommonService; | |
64 | 66 | private final KpiStarLaddersService kpiStarLaddersService; |
65 | 67 | private final KpiGroupIndicatorService kpiGroupIndicatorService; |
66 | 68 | private final KpiStarSpecialRuleService kpiStarSpecialRuleService; |
... | ... | @@ -412,14 +414,29 @@ public class KpiPoolBizService { |
412 | 414 | * @param userId |
413 | 415 | */ |
414 | 416 | @Transactional(rollbackFor = Exception.class) |
415 | - public void invalidKpiPool(Long userId) { | |
416 | - Boolean result = kpiPoolService.update(Wrappers.<KpiPool>lambdaUpdate() | |
417 | + public void invalidKpiPool(KpiGroup originKpiGroup, Long userId, LocalDate anticipatedDate) { | |
418 | + KpiGroupUser groupUser = kpiGroupUserService.getOne(Wrappers.<KpiGroupUser>lambdaQuery() | |
419 | + .eq(KpiGroupUser::getKgc, originKpiGroup.getKgc()) | |
420 | + .eq(KpiGroupUser::getUserId, userId) | |
421 | + .eq(KpiGroupUser::getDataDate, LocalDate.now()) | |
422 | + .eq(KpiGroupUser::getYn, Boolean.TRUE) | |
423 | + ); | |
424 | + if (PublicUtil.isNotEmpty(groupUser)) { | |
425 | + groupUser.setIgnored(Boolean.TRUE); | |
426 | + if (PublicUtil.isNotEmpty(anticipatedDate)) { | |
427 | + groupUser.setAnticipatedDate(anticipatedDate); | |
428 | + } | |
429 | + groupUser.setIgnoreCause(KpiIgnoreCauseEnum.TRANSFER_NEW_POSITION_AFTER); | |
430 | + groupUser.setIgnoreCauseDesc(KpiIgnoreCauseEnum.TRANSFER_NEW_POSITION_AFTER.getName()); | |
431 | + kpiGroupUserService.updateById(groupUser); | |
432 | + } | |
433 | + | |
434 | + kpiPoolService.update(Wrappers.<KpiPool>lambdaUpdate() | |
417 | 435 | .set(KpiPool::getInclusion, Boolean.FALSE) |
418 | 436 | .set(KpiPool::getRevoked, Boolean.TRUE) |
419 | 437 | .eq(KpiPool::getUserId, userId) |
420 | 438 | .eq(KpiPool::getInclusion, Boolean.TRUE) |
421 | 439 | ); |
422 | - BV.isTrue(result, "绩效池是否纳入绩效计算修改失败"); | |
423 | 440 | } |
424 | 441 | |
425 | 442 | /** | ... | ... |