P15GEN2\59518
2024-05-29 d4210c7c4b04abde20037ea8aa0f54ef8a2649aa
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 foundation.capacity;
 
import foundation.org.Position;
import foundation.user.User;
import foundation.util.Util;
 
public enum TargetType {
 
    Org, Position, User, None;
 
    public static TargetType parse(String value) {
        if (Util.isEmpty(value)) {
            return None;
        }
        
        value = value.toLowerCase();
        
        if ("org".equals(value)) {
            return Org;
        }
        else if ("position".equals(value)) {
            return Position;
        }
        else if ("user".equals(value)) {
            return User;
        }
        
        return None;
    }
    
    public static TargetType parse(Object value) {
        if (value == null) {
            return None;
        }
        else if ("org".equals(value)) {
            return Org;
        }
        else if (value instanceof Position) {
            return Position;
        }
        else if (value instanceof User) {
            return User;
        }
        
        return None;
    }
 
    public String toChinese(Object value) {
        if (value == null) {
            return "无";
        }
        else if (value == Org) {
            return "公司";
        }
        else if (value == Position) {
            return "岗位";
        }
        else if (value == User) {
            return "用户";
        }
        
        return "无";
    }
    
}