Blame view

fw-morax-domain/src/main/java/cn/fw/morax/domain/vo/kpi/KpiIndicatorRankStaffVO.java 2.42 KB
7de20f3f   姜超   feature(*): 绩效薪酬查看
1
2
  package cn.fw.morax.domain.vo.kpi;
  
c93b733c   姜超   feature(*): 修改值转换
3
  import cn.fw.morax.common.constant.Constant;
99471c63   姜超   feature(*): 指标排名
4
  import cn.fw.morax.common.utils.PublicUtil;
c93b733c   姜超   feature(*): 修改值转换
5
6
  import cn.fw.morax.domain.enums.DataTypeEnum;
  import cn.fw.morax.domain.enums.TargetTypeEnum;
7de20f3f   姜超   feature(*): 绩效薪酬查看
7
8
  import lombok.Data;
  
99471c63   姜超   feature(*): 指标排名
9
  import java.math.BigDecimal;
7de20f3f   姜超   feature(*): 绩效薪酬查看
10
  import java.util.Date;
16ee250d   姜超   feature(*): 排名修改
11
  import java.util.Optional;
7de20f3f   姜超   feature(*): 绩效薪酬查看
12
13
14
15
16
17
18
  
  /**
   * @author : kurisu
   * @date : 2022-4-6
   * @desc : 绩效池
   */
  @Data
99471c63   姜超   feature(*): 指标排名
19
  public class KpiIndicatorRankStaffVO implements Comparable<KpiIndicatorRankStaffVO>{
7de20f3f   姜超   feature(*): 绩效薪酬查看
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
      /**
       * 用户id
       */
      private Long userId;
      /**
       * 用户名称
       */
      private String userName;
      /**
       * 岗位id
       */
      private Long postId;
      /**
       * 岗位名称
       */
      private String postName;
      /**
       * 门店id
       */
      private Long shopId;
      /**
       * 门店名称
       */
      private String shopName;
      /**
       * 是否纳入绩效计算
       */
      private Boolean inclusion;
7de20f3f   姜超   feature(*): 绩效薪酬查看
48
      /**
99471c63   姜超   feature(*): 指标排名
49
       * 指标排名序号
7de20f3f   姜超   feature(*): 绩效薪酬查看
50
       */
99471c63   姜超   feature(*): 指标排名
51
52
53
54
55
56
57
      private Integer indicatorRank;
  
      /**
       * 原始值
       */
      private BigDecimal originValue;
  
7de20f3f   姜超   feature(*): 绩效薪酬查看
58
      /**
99471c63   姜超   feature(*): 指标排名
59
       * 达成值
7de20f3f   姜超   feature(*): 绩效薪酬查看
60
       */
99471c63   姜超   feature(*): 指标排名
61
      private BigDecimal reachValue;
7de20f3f   姜超   feature(*): 绩效薪酬查看
62
  
c93b733c   姜超   feature(*): 修改值转换
63
64
65
      /**
       * 转换为百分数展示
       */
69f59d7a   姜超   feature(bug): 修改目...
66
      public void convertReportValueToPercent(DataTypeEnum dataType){
c93b733c   姜超   feature(*): 修改值转换
67
          if (PublicUtil.isNotEmpty(dataType) && DataTypeEnum.RATIO.equals(dataType)) {
c93b733c   姜超   feature(*): 修改值转换
68
69
              this.setOriginValue(this.getOriginValue().multiply(Constant.ONE_HUNDRED));
          }
99780da3   姜超   feature(bug): 排名...
70
71
72
          if (PublicUtil.isNotEmpty(this.getReachValue())) {
              this.setReachValue(this.getReachValue().multiply(Constant.ONE_HUNDRED));
          }
c93b733c   姜超   feature(*): 修改值转换
73
74
      }
  
bdcc7a51   姜超   feature(*): 查询指标排名
75
76
77
78
79
80
81
82
83
84
      /**
       * 转换为百分数展示
       */
      public void convertValueForTarget(DataTypeEnum dataType){
          if (PublicUtil.isNotEmpty(dataType) && DataTypeEnum.RATIO.equals(dataType)) {
              this.setOriginValue(this.getOriginValue().multiply(Constant.ONE_HUNDRED));
          }
          this.setReachValue(this.getReachValue().multiply(Constant.ONE_HUNDRED));
      }
  
99471c63   姜超   feature(*): 指标排名
85
86
      @Override
      public int compareTo(KpiIndicatorRankStaffVO other) {
4ba9c650   姜超   feature(bug): 排名...
87
          if (Boolean.TRUE.equals(this.inclusion) && Boolean.FALSE.equals(other.inclusion)) {
c1af0cac   姜超   feature(bug): 排序修改
88
              return -1;
99471c63   姜超   feature(*): 指标排名
89
          }
4ba9c650   姜超   feature(bug): 排名...
90
          if (Boolean.FALSE.equals(this.inclusion) && Boolean.TRUE.equals(other.inclusion)) {
c1af0cac   姜超   feature(bug): 排序修改
91
              return 1;
16ee250d   姜超   feature(*): 排名修改
92
93
94
          }
          return Optional.ofNullable(other.originValue).orElse(BigDecimal.ZERO)
                  .compareTo(Optional.ofNullable(this.originValue).orElse(BigDecimal.ZERO));
99471c63   姜超   feature(*): 指标排名
95
      }
7de20f3f   姜超   feature(*): 绩效薪酬查看
96
  }