| | |
| | | import com.zy.acs.manager.manager.service.BusStsService; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.EnumMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | public enum BusStsType implements DataFieldSortFunc { |
| | |
| | | this.dataSort = dataSort; |
| | | } |
| | | |
| | | private static final Map<BusStsType, Long> cache = new EnumMap<>(BusStsType.class); |
| | | |
| | | 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(); |
| | | return cache.computeIfAbsent(this, key -> { |
| | | BusStsService service = SpringUtils.getBean(BusStsService.class); |
| | | BusSts busSts = service.selectByUuid(this.toString()); |
| | | if (busSts == null) { |
| | | throw new BusinessException("BusStsType Error!"); |
| | | } |
| | | return busSts.getId(); |
| | | }); |
| | | } |
| | | |
| | | @Override |