| 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.common.utils.DataFieldSortFunc; | 
| import com.zy.acs.manager.manager.entity.BusSts; | 
| import com.zy.acs.manager.manager.service.BusStsService; | 
|   | 
| import java.util.Arrays; | 
| import java.util.List; | 
| import java.util.stream.Collectors; | 
|   | 
| public enum BusStsType implements DataFieldSortFunc { | 
|   | 
|     RECEIVE(1), | 
|     PROGRESS(2), | 
|     FINISH(3), | 
|     CANCEL(4), | 
|     ; | 
|   | 
|     public int dataSort; | 
|   | 
|     BusStsType(int dataSort) { | 
|         this.dataSort = dataSort; | 
|     } | 
|   | 
|     public long val() { | 
|         BusStsService service = SpringUtils.getBean(BusStsService.class); | 
|         BusSts busSts = service.selectByUuid(this.toString()); | 
|         if (busSts == null) { | 
|             throw new BusinessException("BusStsType Error!"); | 
|         } | 
|         return busSts.getId(); | 
|     } | 
|   | 
|     @Override | 
|     public List<String> getDataFieldSort() { | 
|         return Arrays.stream(BusStsType.values()) | 
|                 .sorted((e1, e2) -> Integer.compare(e1.dataSort, e2.dataSort)) | 
|                 .map(Enum::name) | 
|                 .collect(Collectors.toList()); | 
|     } | 
|   | 
| } |