package com.tofly.gpsboot.common.system;

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

/**
 * 上报类型
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum ReportTypeEnum {

    /**
     *
     */
    REPORT_TYPE_YEAR_PLAN("0","年计划上报","REPORT_TYPE_YEAR_PLAN"),
    REPORT_TYPE_MONTHLY_PLAN("1","月计划上报","REPORT_TYPE_MONTHLY_PLAN"),
    REPORT_TYPE_HIDDEN_TROUBLE("2","隐患上报","REPORT_TYPE_HIDDEN_TROUBLE"),
    REPORT_TYPE_HIDDEN_TROUBLE_ELIMINATION("3","隐患消除上报","REPORT_TYPE_HIDDEN_TROUBLE_ELIMINATION"),
    REPORT_TYPE_CONSTRUCTION_SITE("4","工地上报","REPORT_TYPE_CONSTRUCTION_SITE"),
    REPORT_TYPE_CONSTRUCTION_SITE_ELIMINATION("5","工地监护消除上报","REPORT_TYPE_CONSTRUCTION_SITE_ELIMINATION"),
    REPORT_TYPE_PLAN_STOP("6","任务暂停上报","REPORT_TYPE_PLAN_STOP"),
    REPORT_TYPE_PLAN_DISUSE("7","任务作废上报","REPORT_TYPE_PLAN_DISUSE"),
    REPORT_REPAIR_YEAR_PLAN("8","抢维修年计划上报","REPORT_REPAIR_YEAR_PLAN"),
    REPORT_REPAIR_MONTH_PLAN("11","抢维修月计划上报","REPORT_REPAIR_MONTH_PLAN"),
    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;

    /**
     * 注入服务名称
     */
    private String injectionServerType;

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

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