package com.goafanti.order.enums;

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

public enum TaskAttributionLogStatus {

//	状态 0管理员分配 1经理转交 2经理分配 3咨询师转交 4咨询师回退 5离职转交
		/** 管理员分配 */
		GLYFP(0,"管理员分配"),
		/** 经理转交 **/
		JLZJ(1,"经理转交"),
		/** 经理分配 **/
		JLFP(2,"经理分配"),
		/** 锁定 **/
		ZXSZJ(3,"咨询师转交"),
		/** 咨询师回退 **/
		HT(4,"咨询师回退"),
		/** 离职转交 **/
		LZZJ(5,"离职转交"),
		/** 无效 **/
		NULL(10, "");
		
		private TaskAttributionLogStatus(Integer code, String desc) {
			this.code = code;
			this.desc = desc;
		}

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

		static {
			for (TaskAttributionLogStatus value : TaskAttributionLogStatus.values()) {
				status.put(value.getCode(), value);
			}
		}
		public static TaskAttributionLogStatus getStatus(Integer code) {
			if (containsType(code)) {
				return status.get(code);
			}
			return NULL;
		}
		
		public static String getValueByCode(Integer code){
	        for(TaskAttributionLogStatus TaskAttributionLogStatus:TaskAttributionLogStatus.values()){
	            if(code.equals(TaskAttributionLogStatus.getCode())){
	                return TaskAttributionLogStatus.getDesc();
	            }
	        }
	        return  null;
	    }
		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;
		}
	}
