package com.ruoyi.project.business.enums;


import com.ruoyi.common.exception.ServiceErrorException;
import lombok.Getter;

@Getter
public enum AuditFlowEnum {


    QUOTATION(1, "报价"),

    BARGAIN(2, "议价"),
    ;

    private Integer value;

    private String name;

    private ModuleEnum module = ModuleEnum.COMMON;

    AuditFlowEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static AuditFlowEnum from(Integer value) {
        for (AuditFlowEnum auditFlowEnum : values()) {
            if (auditFlowEnum.getValue().equals(value)) {
                return auditFlowEnum;
            }
        }
        throw new ServiceErrorException("非法的审批类型");
    }
}
