huminmin
4 天以前 a50e3f61c7b45cd9e11364519e83071b372c4b9d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package cn.iocoder.yudao.module.hrm.enums;
 
import lombok.Getter;
import lombok.RequiredArgsConstructor;
 
import java.math.BigDecimal;
import java.util.Arrays;
 
/** 加班类型及法定工资倍率。 */
@Getter
@RequiredArgsConstructor
public enum HrmOvertimeTypeEnum {
 
    WORKDAY(1, "工作日加班", new BigDecimal("1.5")),
    REST_DAY(2, "休息日加班", new BigDecimal("2.0")),
    LEGAL_HOLIDAY(3, "法定节假日加班", new BigDecimal("3.0"));
 
    private final Integer type;
    private final String name;
    private final BigDecimal salaryMultiplier;
 
    public static HrmOvertimeTypeEnum valueOfType(Integer type) {
        return Arrays.stream(values()).filter(item -> item.type.equals(type)).findFirst().orElse(null);
    }
 
    public static String getName(Integer type) {
        HrmOvertimeTypeEnum value = valueOfType(type);
        return value == null ? "" : value.name;
    }
 
}