package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * 人员身份类别 (特殊人员类型)
 */
public enum PsnIdetType {
    YFRY("21", "优抚人员"),
    YGXSJRJS("2101", "因公牺牲军人家属"),
    TCXYDCJJR("2102", "退出现役的残疾军人"),
    EDYJSCJR("2103", "二等乙级伤残军人"),
    YZLJCJJR("2104", "一至六级残疾军人"),
    LHJ("2105", "老红军"),
    DFKZYFRY("2160", "地方扩展优抚人员"),
    YLZGRY("22", "医疗照顾人员"),
    FSJYSZZHTXLD("2201", "副省级以上在职和退休领导"),
    LYYS("2211", "两院院士"),
    SZZGYXZJ("2212", "省直直管优秀专家"),
    GJJLM("2231", "国家级劳模"),
    XSGWYDSJLM("2232", "享受公务员的省级劳模"),
    YZYSGJYDY("2241", "亚洲以上冠军运动员"),
    DFKZYLZGRY("2260", "地方扩展医疗照顾人员"),
    YLJZRY("23", "医疗救助人员"),
    SWRY("2301", "三无人员"),
    JDLKPKRY("2302", "建档立卡贫困人员"),
    DBJZDX("2303", "低保救助对象"),
    TKJZDX("2304", "特困救助对象"),
    DSRJZDX("2305", "低收入救助对象"),
    SDFM("6008", "失独父母"),
    YBZPJZDXHZTDJBRY("2306", "因病致贫救助对象（含重特大疾病人员）"),
    NCWBH("2307", "农村五保户"),
    CJRY("2308", "残疾人员"),
    DFKZYLJZDXRY("2360", "地方扩展医疗救助对象人员"),
    JR("24", "军人"),
    XYJRJS("2401", "现役军人家属"),
    DFKZJRRYQTJZRY("2460", "地方扩展军人人员，其他军转人员"),
    JHSYH("31", "计划生育户"),
    SNJZH("32", "双女结扎户"),
    SJHH("33", "三结合户"),
    DNH("34", "独女户"),
    FQSYZBH("35", "放弃生育指标户"),
    DSZNH("36", "独生子女户"),
    DFKZQTTSDYRY("60", "地方扩展其他特殊待遇人员"),
    WGJCBJDX("6001", "文革基残保健对象"),
    WGQC("6002", "文革全残"),
    JGQLGR("6003", "建国前老工人"),
    JHSYH2("6004", "计划生育户"),
    SXTMDMM("6005", "实行退牧的牧民"),
    TDNYLDL("6006", "退地农业劳动力"),
    CZC("6007", "城中村");

    private final String code;
    private final String name;

    PsnIdetType(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static PsnIdetType get(String code) {
        if (StringUtil.isBlank(code)) {
            return null;
        }
        for (PsnIdetType patnCertType : PsnIdetType.values()) {
            if (code.trim().equals(patnCertType.getCode())) {
                return patnCertType;
            }
        }
        return null;
    }

    public static String getName(String code) {
        if (StringUtil.isBlank(code)) {
            return null;
        }
        for (PsnIdetType patnCertType : PsnIdetType.values()) {
            if (code.trim().equals(patnCertType.getCode())) {
                return patnCertType.getName();
            }
        }
        return null;
    }
}
