#
vincentlu
2025-01-13 89c7f6e5bcc21b0e8f83a2bc6d680e2ffe431e6f
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/enums/ActionTypeType.java
@@ -5,6 +5,9 @@
import com.zy.acs.manager.manager.entity.ActionType;
import com.zy.acs.manager.manager.service.ActionTypeService;
import java.util.EnumMap;
import java.util.Map;
public enum ActionTypeType {
    TurnCorner("转弯"), // 转弯
@@ -25,13 +28,17 @@
    }
    public String desc;
    private static final Map<ActionTypeType, Long> cache = new EnumMap<>(ActionTypeType.class);
    public long val() {
        ActionTypeService service = SpringUtils.getBean(ActionTypeService.class);
        ActionType actionType = service.selectByUuid(this.toString());
        if (actionType == null) {
            throw new BusinessException("ActionTypeType Error!");
        }
        return actionType.getId();
        return cache.computeIfAbsent(this, key -> {
            ActionTypeService service = SpringUtils.getBean(ActionTypeService.class);
            ActionType actionType = service.selectByUuid(this.toString());
            if (actionType == null) {
                throw new BusinessException("ActionTypeType Error!");
            }
            return actionType.getId();
        });
    }
    public static ActionTypeType get(String el) {