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_POINT("0","计划巡检"),
    PLAN_TYPE_PREVENTIVE_MAINTENANCE("1","预防性维护"),
    PLAN_TYPE_CORRECT_MAINTENANCE("2","纠正性维护"),
    PLAN_TYPE_STATE_MAINTENANCE("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;
    }
}
