wuzeyu
2024-06-11 a3b3610216dfeb82c729c914dbb2018da7eb54ef
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
package com.dy.pipIrrGlobal.util;
 
 
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.EnumValue;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
public enum Org {
 
//    Ym("ym", "元谋"),
//    Pj("pj", "片角镇"),
    Jyg("ym", "嘉峪关");
 
    @EnumValue
    public String tag ;
    public String name ;
 
    Org(String tag, String name){
        this.tag = tag ;
        this.name = name ;
    }
    //用来转json
    public static List<Map> OrgList = new ArrayList<>();
    static {
        Org[] all = Org.values();
        for (Org one : all) {
            Map<String, String> objMap = new HashMap<>();
            objMap.put("tag", one.tag);
            objMap.put("name", one.name);
            OrgList.add(objMap) ;
        }
    }
 
    public String getTag() {
        return this.tag ;
    }
 
    public String getName() {
        return this.name ;
    }
 
    public static Org get(String tag){
//        if(tag.equals(Ym.tag) || tag.equals(Jyg.tag)){
//            return Ym ;
//        }else if(tag.equals(Pj.tag)){
//            return Pj ;
//        }
        if( tag.equals(Jyg.tag)){
            return Jyg ;
        }
        return null ;
    }
 
 
    @JSONField
    public JSONObject toJson() {
        return JSONObject.of("tag", getTag(), "name", getName());
    }
}