package com.zy.core.enums; public enum CrnStatusType { IDLE(0), // 空闲 FETCH_POSITION(1), // 取货定位中 FETCH_REQUEST(2), // 取货请求 FETCHING(3), // 取货中 PUT_POSITION(4), // 放货定位中 PUT_REQUEST(5), // 放货请求 PUTTING(6), //放货中 WAITING(90), // 任务完成等待WCS确认 REPAIR(98), // 维修 SOS(99), // 报警 ; public Integer id; CrnStatusType(Integer id) { this.id = id; } 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; } }