package com.tofly.xrtymis.custom.em;

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

/**
 * 节点对应流程编码
 * @author BZ-DJJ
 */

@Getter
@AllArgsConstructor
public enum RejectedNodeEnum {
    /**
     *
     */
    GDDJ("1",39L),
    RZCZ("2",40L),
    GDSH("3",41L),
    GDZJ("4",42L),
    JGCZ("5",43L),
    JGSH("6",44L),
    GDGD("7",45L)
    ;
    /**
     * 节点
     */
    private String node;
    /**
     * 流程编码
     */
    private Long code;
    public static Long getNodeForCode(String node) {
        Long path = 0L;
        if (StringUtils.isEmpty(node)) {
            return path;
        }

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