package com.tofly.gpsboot.common.system;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.StringUtils;

/**
 * 计划类型
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum PlanTypeEnum {
    /**
     *
     */
    PLAN_TYPE_MONTH("0","月计划"),
    PLAN_TYPE_TROUBLE("1","隐患"),
    PLAN_TYPE_BUILD("2","工地"),
    PLAN_TYPE_ORDINARY("3","临时性任务"),
    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;

    public static String getCodeForValue(String code) {
        String path = "";
        if (StringUtils.isEmpty(code)) {
            return path;
        }

        for (PlanTypeEnum e : PlanTypeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                path = e.value;
                break;
            }
        }
        return path;
    }
}
