package com.wd.workoffice.bean.workEnum;

import android.text.TextUtils;

/**
 * author : flexible
 * email : lgd19940421@163.com
 * github: https://github.com/FlexibleXd
 **/
public enum WorkOrder {
    DRAFT("草稿", 1), PENDING("待审批", 2),
    PROCESSING("处理中", 3), FINISH("已完成", 4), CLOSE("已关闭", 5)
    , REFUSE("已驳回", 6);

    private String name;
    private Integer code;

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

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

    public  static String  getNameByCode(int code){
        String name = "";
        for (WorkOrder value : WorkOrder.values()) {
            if (value.getCode() == code) {
                name = value.getName();
            }
        }
        return name;
    }
}
