package com.goafanti.expenseAccount.Enums;


import java.util.HashMap;
import java.util.Map;

public enum EAProcessStatus {

    FQ(0,"发起"),
    SJSH(1,"上级审核"),
    CWSH(2,"财务审核"),
    ZJLSH(3,"总经理审核"),
    DSZSH(4,"董事长审核"),
    WCSH(5,"完成审核"),
    NOT(99,"未知");

    private Integer code;
    private String desc;

    EAProcessStatus(Integer code,String desc){
        this.code=code;
        this.desc=desc;
    }
    private static Map<Integer, EAProcessStatus> status = new HashMap<Integer, EAProcessStatus>();

    static {
        for (EAProcessStatus value : EAProcessStatus.values()) {
            status.put(value.getCode(), value);
        }
    }

    public static String getDesc(Integer code){
        for (EAProcessStatus value : EAProcessStatus.values()) {
            if (value.getCode()==code)return value.getDesc();
        }
        return NOT.getDesc();
    }

    public static boolean containsType(Integer code) {
        return status.containsKey(code);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
