Commit 16ee250dbc1cef18a12dd85bbfb9ca334bde6f1f
1 parent
6a162455
feature(*): 排名修改
排名修改
Showing
2 changed files
with
12 additions
and
10 deletions
fw-morax-domain/src/main/java/cn/fw/morax/domain/vo/kpi/KpiIndicatorRankStaffVO.java
... | ... | @@ -5,6 +5,7 @@ import lombok.Data; |
5 | 5 | |
6 | 6 | import java.math.BigDecimal; |
7 | 7 | import java.util.Date; |
8 | +import java.util.Optional; | |
8 | 9 | |
9 | 10 | /** |
10 | 11 | * @author : kurisu |
... | ... | @@ -58,15 +59,13 @@ public class KpiIndicatorRankStaffVO implements Comparable<KpiIndicatorRankStaff |
58 | 59 | |
59 | 60 | @Override |
60 | 61 | public int compareTo(KpiIndicatorRankStaffVO other) { |
61 | - if (inclusion) { | |
62 | - if (PublicUtil.isEmpty(this.originValue)) { | |
63 | - return -1; | |
64 | - } | |
65 | - if (PublicUtil.isEmpty(other.originValue)) { | |
66 | - return 1; | |
67 | - } | |
68 | - return this.originValue.compareTo(other.originValue); | |
62 | + if (! this.inclusion) { | |
63 | + return 1; | |
69 | 64 | } |
70 | - return -1; | |
65 | + if (! other.inclusion) { | |
66 | + return -1; | |
67 | + } | |
68 | + return Optional.ofNullable(other.originValue).orElse(BigDecimal.ZERO) | |
69 | + .compareTo(Optional.ofNullable(this.originValue).orElse(BigDecimal.ZERO)); | |
71 | 70 | } |
72 | 71 | } |
73 | 72 | \ No newline at end of file | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/KpiGroupIndicatorBizService.java
... | ... | @@ -329,7 +329,7 @@ public class KpiGroupIndicatorBizService { |
329 | 329 | List<KpiPool> pools = kpiPoolService.list(Wrappers.<KpiPool>lambdaQuery() |
330 | 330 | .eq(KpiPool::getKpiGroupId, dto.getKpiGroupId()) |
331 | 331 | .eq(KpiPool::getMonthly, YearMonth.from(localDate)) |
332 | - .eq(KpiPool::getInclusion, Boolean.TRUE) | |
332 | +// .eq(KpiPool::getInclusion, Boolean.TRUE) | |
333 | 333 | .eq(KpiPool::getYn, Boolean.TRUE) |
334 | 334 | ); |
335 | 335 | |
... | ... | @@ -491,6 +491,9 @@ public class KpiGroupIndicatorBizService { |
491 | 491 | int rank = 1; |
492 | 492 | BigDecimal lastIndicatorValue = null; |
493 | 493 | for (KpiIndicatorRankStaffVO staff : staffs) { |
494 | + if (! staff.getInclusion()) { | |
495 | + continue; | |
496 | + } | |
494 | 497 | if (PublicUtil.isNotEmpty(lastIndicatorValue) && (lastIndicatorValue.compareTo(staff.getOriginValue()) != 0)) { |
495 | 498 | rank++; |
496 | 499 | } | ... | ... |