package com.zy.asrs.wcs.core.model.enums; import com.zy.asrs.framework.common.SpringUtils; import com.zy.asrs.framework.exception.CoolException; import com.zy.asrs.wcs.core.entity.MotionSts; import com.zy.asrs.wcs.core.service.MotionStsService; public enum MotionStsType { INIT, WAITING, EXECUTING, COMPLETE, CANCEL, ERROR, ; MotionStsType() { } public long val() { MotionStsService service = SpringUtils.getBean(MotionStsService.class); MotionSts entity = service.selectByFlag(this.toString()); if (entity == null) { throw new CoolException("DeviceCtgType Error!"); } return entity.getId(); } }