package cn.superdesk.uniorder.common.enums.accounting.operator;

import cn.superdesk.uniorder.common.enums.accounting.supplier.AccountingOrderSupplierAccountingStatusEnum;

public enum AccountingOrderOperatorAccountStatusEnum {
    //1-生成中,2-待提交,3-未确认,4-已确认,5-已驳回,6-已取消,7-已作废
    生成中(1,1, "生成中"),
    待提交(1,2, "待提交"),
    未确认(2,3, "未确认"),
    已确认(2,4, "已确认"),
    已驳回(2,5, "已驳回"),
    已取消(2,6, "已取消"),
    已作废(1,7, "已作废"),
    ;
    private Integer type;
    private Integer key;
    private String  desc;

    AccountingOrderOperatorAccountStatusEnum(Integer type, Integer key, String desc) {
        this.type = type;
        this.key = key;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public Integer getKey() {
        return key;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDescByKey(Integer key) {
        for (AccountingOrderOperatorAccountStatusEnum c : AccountingOrderOperatorAccountStatusEnum.values()) {
            if (c.key.equals(key)) {
                return c.getDesc();
            }
        }
        return "";
    }
}
