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

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

    NORMAL("1","正常"),
    POSTPONE("2"," 延期"),
    CANCEL("3"," 取消"),
    RISKY("4"," 有风险"),
    OUT_OF_CONTROL("5"," 失控"),
    ;

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

    /**
     * 666666
     */
    ProjectStatusEnum(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 ProjectStatusEnum getEnumByCode(String code){
        ProjectStatusEnum[] values = ProjectStatusEnum.values();
        for(ProjectStatusEnum statusEnums : values){
            if(statusEnums.getCode().equals(code)){
                return statusEnums;
            }
        }
        return null;
    }
}
