7 changed files with 151 additions and 2 deletions
			
			
		@ -0,0 +1,61 @@ | 
				
			|||
package com.epmet.commons.tools.enums; | 
				
			|||
 | 
				
			|||
import java.util.Objects; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @author Administrator | 
				
			|||
 */ | 
				
			|||
public enum PartyPostEnum { | 
				
			|||
    //党员职务
 | 
				
			|||
    PTDY("0", "普通党员"), | 
				
			|||
    ZBSJ("1", "支部书记"), | 
				
			|||
    ZBWY("2", "支部委员"), | 
				
			|||
    DWWY("3", "党委委员"), | 
				
			|||
 | 
				
			|||
    UN_KNOWN("8", "未知"); | 
				
			|||
 | 
				
			|||
    private String code; | 
				
			|||
    private String name; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    PartyPostEnum(String code, String name) { | 
				
			|||
        this.code = code; | 
				
			|||
        this.name = name; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    public static String getName(String code) { | 
				
			|||
        PartyPostEnum[] partyPostEnums = values(); | 
				
			|||
        for (PartyPostEnum partyPostEnum : partyPostEnums) { | 
				
			|||
            if (Objects.equals(partyPostEnum.getCode(), code)) { | 
				
			|||
                return partyPostEnum.getName(); | 
				
			|||
            } | 
				
			|||
        } | 
				
			|||
        return PartyPostEnum.UN_KNOWN.getName(); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    public static String getCode(String name) { | 
				
			|||
        PartyPostEnum[] partyPostEnums = values(); | 
				
			|||
        for (PartyPostEnum partyPostEnum : partyPostEnums) { | 
				
			|||
            if (partyPostEnum.getName().equals(name)) { | 
				
			|||
                return partyPostEnum.getCode(); | 
				
			|||
            } | 
				
			|||
        } | 
				
			|||
        return null; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    public String getCode() { | 
				
			|||
        return code; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    public void setCode(String code) { | 
				
			|||
        this.code = code; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    public String getName() { | 
				
			|||
        return name; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    public void setName(String name) { | 
				
			|||
        this.name = name; | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue