自动化立体仓库 - WMS系统
#
yxFwq
2025-04-01 74fd6eb7fb0322078f7946f51073f20e90231df1
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
42
43
44
45
46
47
48
49
50
package com.zy.common.model.enums;
 
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
 
public enum WrkMastExecuteType {
 
    DEVP_NO_CRN_THREE(3, "DEVP_NO_CRN_THREE", linearSmallToBig(nonlinearSmallToBig(new Integer[]{261}),255,257)),
    DEVP_NO_CRN_FOUR(4,"DEVP_NO_CRN_FOUR", linearSmallToBig(nonlinearSmallToBig(new Integer[]{260}),246,248)),
    DEVP_NO_CRN_FIVE(5,"DEVP_NO_CRN_FIVE", linearSmallToBig(nonlinearSmallToBig(new Integer[]{259}),237,239))
    ;
    private final Integer id;
    private final String code;
    private List<Integer> siteList;
    WrkMastExecuteType(Integer id,String code,List<Integer> siteList){
        this.id = id;
        this.code = code;
        this.siteList = siteList;
    }
 
    public static List<Integer> get(Integer id) {
        for (WrkMastExecuteType type : WrkMastExecuteType.values()){
            if (type.id.equals(id)){
                return type.siteList;
            }
        }
        return new ArrayList<>();
    }
 
    public static List<Integer> get(String code) {
        for (WrkMastExecuteType type : WrkMastExecuteType.values()){
            if (type.code.equals(code)){
                return type.siteList;
            }
        }
        return new ArrayList<>();
    }
 
    private static List<Integer> nonlinearSmallToBig(Integer[] sites){
        return new ArrayList<>(Arrays.asList(sites));
    }
 
    private static List<Integer> linearSmallToBig(List<Integer> integers,Integer smallSta,Integer bigSta){
        for (int i = smallSta;i<bigSta;i++){
            integers.add(i);
        }
        return integers;
    }
}