package com.zy.core.enums; public enum CrnStatusType { IDLE(0, "空闲,无任务"), NONE_MOVING(1, "无货行走"), FETCHING(2, "取货"), MOVING(3, "有货行走"), PUTTING(4, "放货"), PUT_COMPLETE(5, "放货完成"), ; public Integer id; public String desc; CrnStatusType(Integer id, String desc) { this.id = id; this.desc = desc; } public static CrnStatusType get(Short id) { if (null == id) { return null; } for (CrnStatusType type : CrnStatusType.values()) { if (type.id.equals(id.intValue())) { return type; } } return null; } public static CrnStatusType get(CrnStatusType type) { if (null == type) { return null; } for (CrnStatusType crnStatusType : CrnStatusType.values()) { if (crnStatusType == type) { return crnStatusType; } } return null; } }