package com.goafanti.expenseAccount.Enums;


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

public enum EAProcessStatus {
//流程状态 0=成员发起，1=上级审核，2=部门负责人审核，3=财务审核，4=财务复审，5=董事长，6=财务管理员，7=公司副总，8=出纳
    FQ(0,"发起"),
    SJSH(1,"上级审核"),
    BMFZRSH(2,"部门负责人审核"),
    CWSH(3,"财务审核"),
    CWFS(4,"财务复审"),
    DSZSH(5,"董事长"),
    CWGGLYSH(6,"财务管理员"),
    GSFSSH(7,"公司副总"),
    CNSH(8,"出纳"),
    BXWC(9,"报销完成"),
    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;
    }
}
