#
Junjie
2025-04-21 edf5eb33c88d88062e295db466a654ac0a646ded
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
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.TaskCtg;
import com.zy.asrs.wcs.core.service.TaskCtgService;
 
public enum TaskCtgType {
 
    IN,//入库
    OUT,//出库
    CHARGE,//充电
    MOVE,//迁移
    MANUAL,//手动
    ;
 
    TaskCtgType() {
    }
 
    public long val() {
        TaskCtgService service = SpringUtils.getBean(TaskCtgService.class);
        TaskCtg entity = service.selectByFlag(this.toString());
        if (entity == null) {
            throw new CoolException("TaskCtgType Error!");
        }
        return entity.getId();
    }
 
 
    public static TaskCtgType get(String el) {
        for (TaskCtgType value : TaskCtgType.values()) {
            if (el.equals(value.toString())) {
                return value;
            }
        }
        return null;
    }
 
}