package com.ankaibei.workFlow.webadmin.ankaibei.enums;

/**
 * @ClassName: ProjectPeriodEnum
 * @author: LWQ
 * @date:2022/09/14
 * @Copyright: 2022
 */
public enum ProjectPeriodEnum {

    BUSINESS_RESEARCHB("1", "商机调研"),
    PRE_SALES("2", " 售前"),
    PROJECT_START("3", " 立项启动(中标)"),
    DELIVERY("4", " 交付(实习阶段)"),
    CHECK_AND_ACCEPT("5", " 验收"),
    POST_PROJECT_THE_RECEIVABLE("6", " 结项回款"),
    CLOSE("7", " 关闭");

    /**
     * 状态码
     */
    private final String code;
    /**
     * 信息
     */
    private final String reason;

    /**
     * 666666
     */
    ProjectPeriodEnum(String code, String reason) {
        this.code = code;
        this.reason = reason;
    }

    public String getCode() {
        return code;
    }

    public String getReason() {
        return reason;
    }

    /**
     * 通过枚举的code,查询对应的枚举项
     *
     * @param code
     * @return
     */
    public static ProjectPeriodEnum getEnumByCode(String code) {
        ProjectPeriodEnum[] values = ProjectPeriodEnum.values();
        for (ProjectPeriodEnum statusEnums : values) {
            if (statusEnums.getCode().equals(code)) {
                return statusEnums;
            }
        }
        return null;
    }
}
