puzhibing
2023-06-30 f58cca364b731eac2d60a440ffaa804be3cd43fd
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.stylefeng.guns.modular.system.enums;
 
 
 
/**
 * @Description 系统规则配置
 * @Author xiaochen
 * @Date 2023/02/15 9:42
 */
public enum SystemConfigTypeEnum {
 
    /*类型(1=派单规则,2=佣金分成规则,3=抽成规则,4=积分规则,5=价格规则,6=余额规则,7=客服管理)*/
 
    DISPATCH_RULES(1, "派单规则"),
    COMMISSION_SHARING_RULES(2, "佣金分成规则"),
    EXTRACTION_RULE(3, "抽成规则"),
    INTEGRAL_RULE(4, "积分规则"),
    PRICE_RULES(5, "价格规则"),
    BALANCE_RULES(6, "余额规则"),
    CUSTOMER_SERVICE_MGMT(7,"客服管理");
 
    private String desc;
 
 
    private int code;
 
 
    SystemConfigTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
 
    public String getDesc() {
        return desc;
    }
 
    public int getCode() {
        return code;
    }
 
    /**
     * 通过code获取枚举
     *
     * @param code
     * @return
     */
    public static SystemConfigTypeEnum fromCode(Integer code) {
        SystemConfigTypeEnum[] resultTypes = SystemConfigTypeEnum.values();
        for (SystemConfigTypeEnum resultType : resultTypes) {
            if (code.equals(resultType.getCode())) {
                return resultType;
            }
        }
        return null;
    }
 
}