#
Junjie
2024-05-20 4d8bb57c9eb3fda399fd7b9e9de7ecbf754244f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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.LocSts;
import com.zy.asrs.wcs.core.service.LocStsService;
 
public enum LocStsType {
 
    D,//空板
    F,//在库
    O,//空库
    X,//禁用
    E,//不可放货通道
    W,//母轨道
    C,//充电桩
    ;
 
    LocStsType() {
    }
 
    public long val() {
        LocStsService service = SpringUtils.getBean(LocStsService.class);
        LocSts entity = service.selectByFlag(this.toString());
        if (entity == null) {
            throw new CoolException("LocStsType Error!");
        }
        return entity.getId();
    }
 
 
    public static LocStsType get(String el) {
        for (LocStsType value : LocStsType.values()) {
            if (el.equals(value.toString())) {
                return value;
            }
        }
        return null;
    }
 
}