package com.tofly.gpsboot.common.system;

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

/**
 * 工单来源
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum OrderSourceEnum {
    /**
     *
     */
    ORDER_SOURCE_PLAN("0","计划"),
    ORDER_SOURCE_SELF_BUILT("1","自建"),
    ORDER_SOURCE_HOTLINE("2","热线"),
    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;

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

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