package com.engine.htsc.payment.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * k1810012
 * 总部差旅报销状态
 * 0 - 退回,RETURN
 * 1 - 拟稿提交,RUNNING
 * 2 - 办结前,FINISH
 *
 */
public enum ReiState {

	RETURN("0", "RETURN"),
	RUNNING("1", "RUNNING"),
	FINISH("2", "FINISH");


	private final String id;
	private final String state;

	ReiState(String id, String state) {
		this.id = id;
		this.state = state;
	}

	public String getId() {
		return id;
	}

	public String getState() {
		return state;
	}

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

		for (ReiState e : ReiState.values()) {
			if (e.id.equalsIgnoreCase(code)) {
				className = e.state;
				break;
			}
		}
		return className;
	}
}
