Commit 224ee28bd3bb1fc0afdd0bd586b6d66d408898d1
1 parent
9161579f
feature(*): 排名修改
排名修改
Showing
2 changed files
with
19 additions
and
10 deletions
fw-morax-domain/src/main/java/cn/fw/morax/domain/vo/eval/EvalGroupRewardRankLogVO.java
... | ... | @@ -81,9 +81,22 @@ public class EvalGroupRewardRankLogVO { |
81 | 81 | private Long groupId; |
82 | 82 | |
83 | 83 | /** |
84 | - * 转换为百分数展示 | |
84 | + * 转换为百分数展示(条件使用) | |
85 | 85 | */ |
86 | - public void convertValueToPercent(DataTypeEnum dataType, TargetTypeEnum targetType){ | |
86 | + public void convertPercentForCond(DataTypeEnum dataType, TargetTypeEnum targetType){ | |
87 | + if (DataTypeEnum.RATIO.equals(dataType)) { | |
88 | + this.setValue(this.getValue().multiply(Constant.ONE_HUNDRED)); | |
89 | + } | |
90 | + //有目标 | |
91 | + if (! TargetTypeEnum.NO.equals(targetType)) { | |
92 | + this.setReachValue(this.getReachValue().multiply(Constant.ONE_HUNDRED)); | |
93 | + } | |
94 | + } | |
95 | + | |
96 | + /** | |
97 | + * 转换为百分数展示(条件使用) | |
98 | + */ | |
99 | + public void convertPercentForCommission(DataTypeEnum dataType, TargetTypeEnum targetType){ | |
87 | 100 | if (DataTypeEnum.RATIO.equals(dataType)) { |
88 | 101 | this.setValue(this.getValue().multiply(Constant.ONE_HUNDRED)); |
89 | 102 | } | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/biz/eval/EvalGroupPoolService.java
1 | 1 | package cn.fw.morax.service.biz.eval; |
2 | 2 | |
3 | 3 | import cn.fw.common.exception.BusinessException; |
4 | -import cn.fw.morax.common.config.FlowVal; | |
5 | 4 | import cn.fw.morax.common.constant.Constant; |
6 | 5 | import cn.fw.morax.common.utils.DateUtil; |
7 | 6 | import cn.fw.morax.common.utils.PublicUtil; |
... | ... | @@ -14,12 +13,7 @@ import cn.fw.morax.domain.vo.eval.*; |
14 | 13 | import cn.fw.morax.domain.vo.kpi.IndicatorUserValueVO; |
15 | 14 | import cn.fw.morax.domain.vo.kpi.KpiIndicatorRankStaffVO; |
16 | 15 | import cn.fw.morax.domain.vo.kpi.KpiIndicatorRankVO; |
17 | -import cn.fw.morax.rpc.approval.FlowApproveRpc; | |
18 | -import cn.fw.morax.service.biz.ApprovalBizService; | |
19 | 16 | import cn.fw.morax.service.biz.CommonService; |
20 | -import cn.fw.morax.service.biz.kpi.KpiGroupUserBizService; | |
21 | -import cn.fw.morax.service.data.ApprovalRecordService; | |
22 | -import cn.fw.morax.service.data.SettingDraftService; | |
23 | 17 | import cn.fw.morax.service.data.eval.*; |
24 | 18 | import cn.fw.morax.service.data.kpi.IndicatorUserValueService; |
25 | 19 | import com.alibaba.fastjson.JSON; |
... | ... | @@ -1232,6 +1226,7 @@ public class EvalGroupPoolService { |
1232 | 1226 | public List<EvalGroupRewardRankLogVO> getRewardCondRankLogs(Long preconditionId, LocalDate dataDate) { |
1233 | 1227 | EvalGroupRewardPrecondition precondition = evalGroupRewardPreconditionService.getById(preconditionId); |
1234 | 1228 | BV.notNull(precondition, "奖惩条件不存在"); |
1229 | + BV.isTrue(ConditionTypeEnum.RANK.equals(precondition.getCondType()), "满足排名率条件才能查询排名情况"); | |
1235 | 1230 | final DataTypeEnum dataType = precondition.getDataType(); |
1236 | 1231 | final TargetTypeEnum targetType = precondition.getTargetType(); |
1237 | 1232 | List<EvalGroupRewardRankLog> rankLogs = evalGroupRewardRankLogService.list(Wrappers.<EvalGroupRewardRankLog>lambdaQuery() |
... | ... | @@ -1243,11 +1238,13 @@ public class EvalGroupPoolService { |
1243 | 1238 | Collections.sort(rankLogs); |
1244 | 1239 | |
1245 | 1240 | List<EvalGroupRewardRankLogVO> rankLogVOs = PublicUtil.copyList(rankLogs, EvalGroupRewardRankLogVO.class); |
1246 | - rankLogVOs.stream().forEach(rankLog -> rankLog.convertValueToPercent(dataType, targetType)); | |
1241 | + rankLogVOs.stream().forEach(rankLog -> rankLog.convertPercentForCond(dataType, targetType)); | |
1247 | 1242 | return rankLogVOs; |
1248 | 1243 | } |
1249 | 1244 | |
1250 | 1245 | public List<EvalGroupRewardRankLogVO> queryRewardCommissionRank(Long evalGroupRewardId, LocalDate dataDate) { |
1246 | + EvalGroupReward reward = evalGroupRewardService.getById(evalGroupRewardId); | |
1247 | + BV.notNull(reward, "奖惩不存在"); | |
1251 | 1248 | List<EvalGroupRewardRankLog> rankLogs = evalGroupRewardRankLogService.list(Wrappers.<EvalGroupRewardRankLog>lambdaQuery() |
1252 | 1249 | .eq(EvalGroupRewardRankLog::getDataDate, dataDate) |
1253 | 1250 | .eq(EvalGroupRewardRankLog::getReferId, evalGroupRewardId) |
... | ... | @@ -1255,7 +1252,6 @@ public class EvalGroupPoolService { |
1255 | 1252 | .eq(EvalGroupRewardRankLog::getYn, Boolean.TRUE) |
1256 | 1253 | ); |
1257 | 1254 | Collections.sort(rankLogs); |
1258 | - | |
1259 | 1255 | List<EvalGroupRewardRankLogVO> rankLogVOs = PublicUtil.copyList(rankLogs, EvalGroupRewardRankLogVO.class); |
1260 | 1256 | return rankLogVOs; |
1261 | 1257 | } | ... | ... |