1
sunshine
2024-11-05 92a9e53e82c74d36a72eb92f93777bbb16e2db73
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
58
59
60
61
62
63
64
65
package com.nova.sankuai.domain.enums;
 
import io.swagger.annotations.ApiModel;
import org.apache.commons.lang.StringUtils;
 
/**
 * @author weikangdi
 * 职业信息
 */
@ApiModel(value = "职业信息枚举")
public enum ProfessionInfoEnum {
 
    OFFICE_WORKER(0, "上班族"),
    FREELANCE(1, "自由职业"),
    BUSINESS_OWNERS(2, "企业主"),
    SELF_EMPLOYED(3, "个体户"),
    CIVIL_SERVANTS(4, "公务员");
 
    private Integer code;
    private String value;
 
    ProfessionInfoEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }
 
    public static String value(Integer code) {
        if (code != null) {
            for (ProfessionInfoEnum m : ProfessionInfoEnum.values()) {
                if (m.getCode() == code.intValue()) {
                    return m.getValue();
                }
            }
        }
        return null;
    }
 
    public static String getValues(String ids) {
        String resultStr = "";
        String[] split = ids.split(",");
        for (String code : split) {
            String value = value(Integer.valueOf(code));
            if (StringUtils.isNotBlank(value)) {
                resultStr = StringUtils.isNotBlank(resultStr) ? resultStr + "," + value : resultStr + value;
            }
        }
        return resultStr;
    }
 
    public Integer getCode() {
        return code;
    }
 
    public void setCode(Integer code) {
        this.code = code;
    }
 
    public String getValue() {
        return value;
    }
 
    public void setValue(String value) {
        this.value = value;
    }
}