package com.zy.acs.manager.manager.enums; import com.zy.acs.framework.common.SpringUtils; import com.zy.acs.manager.common.exception.BusinessException; import com.zy.acs.manager.manager.entity.TaskSts; import com.zy.acs.manager.manager.service.TaskStsService; public enum TaskStsType { INIT, WAITING, ASSIGN, PROGRESS, COMPLETE, ; TaskStsType() { } public long val() { TaskStsService service = SpringUtils.getBean(TaskStsService.class); TaskSts taskSts = service.selectByUuid(this.toString()); if (taskSts == null) { throw new BusinessException("TaskStsType Error!"); } return taskSts.getId(); } }