package com.jwipc.finance.constant;

/**
 * <p> </p>
 *
 * @author AL
 * @version 1.0
 * @since JDK 1.8
 */
public enum STATUS {
    /**
     * 单例对象
     */
    NEWBUILD(0, "新建"),
    OAAUDIT(1, "OA审批中"),
    OAREFUSE(2, "OA审批拒绝"),
    COMPLATE(3, "完成"),
    PURCHASECONFIRM(4, "待采购确认"),
    REFUSE(5, "驳回"),
    SUPPLIERCONFIRM(6, "待供方确认");



    private final int type;
    private final String name;

    /**
     * 默认构造函数
     */
    STATUS(int type, String name) {
        this.type = type;
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static STATUS forType(int type) {
        for (STATUS value : STATUS.values()) {
            if (value.getType() == type) {
                return value;
            }
        }
        return null;
    }
}

