package com.yuchen.saas.flow.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.nest.springwrap.core.tool.utils.Func;
import org.nest.springwrap.core.tool.utils.StringPool;

@Getter
@AllArgsConstructor
public enum NodeStatusEnum {

    WKS(0,"未开始"),
    JXZ(1,"进行中"),
    YJS(2,"已完成"),
    YCH(3,"已撤回"),
    YSB(4,"已驳回"),
    ;

    private final int code;

    private final String name;


    public static String getEnumByCode(Integer code) {
        NodeStatusEnum[] enumArray = NodeStatusEnum.values();
        for (NodeStatusEnum e : enumArray) {
            if (Func.equalsSafe(code,e.code)) {
                return e.getName();
            }
        }
        return StringPool.EMPTY;
    }


}
