package com.ruoyi.project.business.enums;


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

@Getter
@AllArgsConstructor
public enum AuditFlowEnum {


    QUOTATION(1, "报价", "quotation.review"),

    BARGAIN(2, "议价", "quotation.approve"),
    CONTRACT_FINANCE_YES(3, "合同(财务)", "quotation.approve"),
    CONTRACT_FINANCE_NO(4, "合同(非财务)", "quotation.approve"),
    ;

    private Integer value;

    private String name;

    private String alertMsg;

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