2026-06-29 940c8481d2fdcf51341db4ccd6fd6fcc2d43debb
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package cn.iocoder.yudao.module.wms.enums.inventory;
 
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
 
import java.util.Arrays;
 
/**
 * WMS 库存业务类型枚举
 *
 * 用于区分库存操作的业务来源
 *
 * @author 芋道源码
 */
@Getter
@AllArgsConstructor
public enum WmsInventoryBizTypeEnum implements ArrayValuable<Integer> {
 
    // ========== 入库类型 [100, 150) ==========
 
    PURCHASE_RECEIPT(100, "ERP 采购入库"),
    PRODUCE_RECEIPT(101, "MES 生产入库"),
    RETURN_RECEIPT(102, "退货入库"),
    OTHER_RECEIPT(103, "其他入库"),
    OTHER(104, "其他"),
 
    // ========== 出库类型 [150, 200) ==========
 
    SALE_SHIPMENT(150, "ERP 销售出库"),
    PRODUCE_MATERIAL(151, "MES 生产领料"),
    RETURN_SHIPMENT(152, "退货出库"),
    OTHER_SHIPMENT(153, "其他出库"),
 
    ;
 
    public static final Integer[] ARRAYS = Arrays.stream(values())
            .map(WmsInventoryBizTypeEnum::getType).toArray(Integer[]::new);
 
    /**
     * 类型
     */
    private final Integer type;
    /**
     * 名称
     */
    private final String name;
 
    @Override
    public Integer[] array() {
        return ARRAYS;
    }
 
    /**
     * 判断是否为入库类型
     */
    public static boolean isReceiptType(Integer type) {
        return type != null && type >= 100 && type < 150;
    }
 
    /**
     * 判断是否为出库类型
     */
    public static boolean isShipmentType(Integer type) {
        return type != null && type >= 150 && type < 200;
    }
 
}