package org.springblade.common.enums;

import lombok.Getter;

/**
 * 发票状态枚举类
 */
@Getter
public enum InvoiceStateEnum {
	UN_APPLY("不可申请开票", 1),
	APPLY("可申请开票", 2),
	APPLYING("已申请开票",3),
	OPENED("已开票",4);
	private String name;
	private Integer value;

	InvoiceStateEnum(String name, Integer value) {
		this.name = name;
		this.value = value;
	}

	public static String getNameByValue(Integer value) {
		for (InvoiceStateEnum orderTypeEnum : InvoiceStateEnum.values()) {
			if (orderTypeEnum.value.equals(value)) {
				return orderTypeEnum.getName();
			}
		}
		return "未知";
	}
}
