package com.tofly.gpsboot.common.system;

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

/**
 * 子计划状态
 * @author Zev
 */
@Getter
@AllArgsConstructor
public enum IsPlanChildStateEnum {
    /**
     *
     */
    PLAN_STATE_NOT_START("-1","未执行"),
    PLAN_STATE_BEING_PERFORMED("3","正在执行"),
    PLAN_STATE_PLAN_COMPLETE("4","计划完成"),
    PLAN_STATE_APPLY_SUSPENSION("7","申请暂停"),
    PLAN_STATE_PROJECT_SUSPENDED("8","计划已暂停"),
    PLAN_STATE_APPLY_CANCELLATION("9","申请作废"),
    PLAN_STATE_PLAN_DISUSE("10","计划已作废"),
    PLAN_STATE_EXECUTION_NOT_STARTED("5","已开始未执行"),
    PLAN_STATE_PLAN_UNFINISHED("11","计划未完成,已超时"),
    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;

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

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