package com.tofly.xrtygis.em;

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

/**
 * 考核内容转换
 *
 * @author JF
 */
@Getter
@AllArgsConstructor
public enum AssessContentEnum {
    /**
     *
     */
    KPI_TASK_ONE("1", "巡线效率"),
    KPI_TASK_TWO("2", "区域漏损率"),
    KPI_TASK_THREE("3", "处漏效率"),
    KPI_TASK_FOUR("4", "区域漏损指标任务"),
    KPI_TASK_FIVE("5", "绩效任务");
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;

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

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