package com.ruoyi.common.enums;

/**
 * 用户状态
 *
 * @author ruoyi
 */
public enum ProjectStatus {
    // 01待审批、02审批不通过、03审批通过、04已报价、05议价中、06已接受价格、07已成单、08已出图、9延期、10丢单
    First("01", "待审批"),
    Second("02", "审批不通过"),
    Third("03", "审批通过"),
    Fourth("04", "已报价"),
    Fifth("05", "议价中"),
    Sixth("06", "已接受价格"),
    Seventh("07", "已成单"),
    Eighth("08", "已出图"),
    Ninth("09", "延期"),
    Tenth("10", "丢单");

    private final String code;
    private final String name;

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

    /**
     * 根据 code 获取枚举
     */
    public static ProjectStatus fromCode(String code) {
        for (ProjectStatus e : values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
