Commit 916a0611b705bb774babff3f1db0dde757be1165

Authored by 姜超
2 parents 34a38764 85eb9bf3

Merge branch 'main' into test

fw-morax-service/src/main/java/cn/fw/morax/service/biz/kpi/KpiGroupIndicatorBizService.java
... ... @@ -478,16 +478,20 @@ public class KpiGroupIndicatorBizService {
478 478 * @return
479 479 */
480 480 public void calcRank(List<KpiIndicatorRankStaffVO> staffs) {
481   -
482 481 int rank = 1;
483   - BigDecimal lastIndicatorValue = null;
  482 + Optional<BigDecimal> lastIndicatorValueOp = staffs.stream()
  483 + .filter(staff -> Boolean.TRUE.equals(staff.getInclusion()))
  484 + .findFirst().map(KpiIndicatorRankStaffVO::getOriginValue);
  485 + if (Boolean.FALSE.equals(lastIndicatorValueOp.isPresent())) {
  486 + return;
  487 + }
  488 + BigDecimal lastIndicatorValue = lastIndicatorValueOp.get();
484 489 for (KpiIndicatorRankStaffVO staff : staffs) {
485 490 if (! staff.getInclusion()) {
486 491 continue;
487 492 }
488   - if (PublicUtil.isEmpty(lastIndicatorValue) || PublicUtil.isEmpty(staff.getOriginValue()) ) {
489   - staff.setIndicatorRank(rank);
490   - lastIndicatorValue = staff.getOriginValue();
  493 + //原始值为空,无排名
  494 + if (PublicUtil.isEmpty(staff.getOriginValue())) {
491 495 continue;
492 496 }
493 497 if (lastIndicatorValue.compareTo(staff.getOriginValue()) != 0) {
... ...