tuqin
2026-11-03 9494075e6d9d2a4b2b884b4ed740dee0c434734c
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
package cn.iocoder.yudao.module.trade.enums.foreign;
 
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
 
import java.util.Arrays;
 
/**
 * 外贸单据类型枚举
 *
 * @author mom
 */
@Getter
@AllArgsConstructor
public enum TradeForeignDocTypeEnum implements ArrayValuable<String> {
 
    CONTRACT("contract", "外销合同"),
    PACKING_LIST("packing_list", "装箱单"),
    PRODUCT_OUTBOUND("product_outbound", "成品出库单"),
    PORT_INBOUND("port_inbound", "港口入库单据"),
    CUSTOMS_DECLARATION("customs_declaration", "报关单"),
    RELEASE_NOTICE("release_notice", "放行通知书"),
    EXPORT_INVOICE("export_invoice", "出口发票"),
    OTHER("other", "其他");
 
    private final String type;
    private final String name;
 
    public static final String[] ARRAYS = Arrays.stream(values()).map(TradeForeignDocTypeEnum::getType).toArray(String[]::new);
 
    public static String getNameByType(String type) {
        if (type == null) {
            return null;
        }
        for (TradeForeignDocTypeEnum e : values()) {
            if (e.getType().equals(type)) {
                return e.getName();
            }
        }
        return null;
    }
 
    @Override
    public String[] array() {
        return ARRAYS;
    }
 
}