package com.tofly.xrtygis.em;

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

/**
 * 季度转换
 *
 * @author JF
 */
@Getter
@AllArgsConstructor
public enum QuarterEnum {
    /**
     *
     */
    USER_TASK_TYPE_ORDINARY_MESSAGE("1", "一"),
    USER_TASK_TYPE_ROB_MAINTENANCE("2", "二"),
    USER_TASK_TYPE_INSPECTION("3", "三"),
    USER_TASK_TYPE_BUILD("4", "四");
    /**
     * 编码
     */
    String code;
    /**
     * 内容
     */
    String value;

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

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