diff --git a/fw-morax-server/src/main/java/cn/fw/morax/server/consumer/EhrStaffPostConsumer.java b/fw-morax-server/src/main/java/cn/fw/morax/server/consumer/EhrStaffPostConsumer.java index 6bef36a..292cd9e 100644 --- a/fw-morax-server/src/main/java/cn/fw/morax/server/consumer/EhrStaffPostConsumer.java +++ b/fw-morax-server/src/main/java/cn/fw/morax/server/consumer/EhrStaffPostConsumer.java @@ -87,9 +87,9 @@ public class EhrStaffPostConsumer implements RocketMQListener(){{add("FWGW");add("XSGW");}}, Boolean.TRUE); return indicatorsService.getPostIndicators(dto); } diff --git a/fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/KpiGroupUserBizService.java b/fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/KpiGroupUserBizService.java index 1724f8c..3e368aa 100644 --- a/fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/KpiGroupUserBizService.java +++ b/fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/KpiGroupUserBizService.java @@ -491,7 +491,7 @@ public class KpiGroupUserBizService { * * @param userId */ - public void calcStartKpiDate(Long userId) { + public LocalDate calcStartKpiDate(Long userId) { String key = getStartKpiKey() + userId; BoundValueOperations strOps = stringRedisTemplate.boundValueOps(key); LocalDate currentDate = LocalDate.now(); @@ -500,6 +500,7 @@ public class KpiGroupUserBizService { //若定时器执行之前key失效,那么不能正确赋值开始计算考核时间,多加一天 days = days + 1; strOps.set(startKpiDate.toString(), days, TimeUnit.DAYS); + return startKpiDate; } /** diff --git a/fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/KpiPoolBizService.java b/fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/KpiPoolBizService.java index 9049535..8d79e6f 100644 --- a/fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/KpiPoolBizService.java +++ b/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; import cn.fw.morax.domain.bo.kpi.KpiRankCalculableBO; import cn.fw.morax.domain.bo.kpi.KpiStarLadderBO; import cn.fw.morax.domain.db.kpi.*; +import cn.fw.morax.domain.enums.KpiIgnoreCauseEnum; import cn.fw.morax.domain.enums.ScoreWayEnum; import cn.fw.morax.domain.enums.StarEvaluationEnum; import cn.fw.morax.domain.enums.StarLevelEnum; @@ -61,6 +62,7 @@ public class KpiPoolBizService { private final KpiGroupRankService kpiGroupRankService; private final StringRedisTemplate stringRedisTemplate; private final KpiGroupUserService kpiGroupUserService; + private final KpiPoolCommonService kpiPoolCommonService; private final KpiStarLaddersService kpiStarLaddersService; private final KpiGroupIndicatorService kpiGroupIndicatorService; private final KpiStarSpecialRuleService kpiStarSpecialRuleService; @@ -412,14 +414,29 @@ public class KpiPoolBizService { * @param userId */ @Transactional(rollbackFor = Exception.class) - public void invalidKpiPool(Long userId) { - Boolean result = kpiPoolService.update(Wrappers.lambdaUpdate() + public void invalidKpiPool(KpiGroup originKpiGroup, Long userId, LocalDate anticipatedDate) { + KpiGroupUser groupUser = kpiGroupUserService.getOne(Wrappers.lambdaQuery() + .eq(KpiGroupUser::getKgc, originKpiGroup.getKgc()) + .eq(KpiGroupUser::getUserId, userId) + .eq(KpiGroupUser::getDataDate, LocalDate.now()) + .eq(KpiGroupUser::getYn, Boolean.TRUE) + ); + if (PublicUtil.isNotEmpty(groupUser)) { + groupUser.setIgnored(Boolean.TRUE); + if (PublicUtil.isNotEmpty(anticipatedDate)) { + groupUser.setAnticipatedDate(anticipatedDate); + } + groupUser.setIgnoreCause(KpiIgnoreCauseEnum.TRANSFER_NEW_POSITION_AFTER); + groupUser.setIgnoreCauseDesc(KpiIgnoreCauseEnum.TRANSFER_NEW_POSITION_AFTER.getName()); + kpiGroupUserService.updateById(groupUser); + } + + kpiPoolService.update(Wrappers.lambdaUpdate() .set(KpiPool::getInclusion, Boolean.FALSE) .set(KpiPool::getRevoked, Boolean.TRUE) .eq(KpiPool::getUserId, userId) .eq(KpiPool::getInclusion, Boolean.TRUE) ); - BV.isTrue(result, "绩效池是否纳入绩效计算修改失败"); } /**