package com.goafanti.order.enums;

import java.util.HashMap;
import java.util.Map;

public enum PublicStatus {
	YGS(0,"已公示"),
	WGS(1,"未公示"),
	DGS(2,"待公示"),
	CCZ(3, "抽查中");
	private PublicStatus(Integer code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	private static Map<Integer, PublicStatus> status = new HashMap<Integer, PublicStatus>();

	static {
		for (PublicStatus value : PublicStatus.values()) {
			status.put(value.getCode(), value);
		}
	}
	public static PublicStatus getStatus(Integer code) {
		if (containsType(code)) {
			return status.get(code);
		}
		return WGS;
	}
	public static boolean containsType(Integer code) {
		return status.containsKey(code);
	}
	private Integer	code;
	private String	desc;
	public Integer getCode() {
		return code;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
}
