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
| 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 TradeForeignOrderStatusEnum implements ArrayValuable<Integer> {
|
| DRAFT(0, "草稿"),
| APPROVING(10, "审批中"),
| APPROVED(20, "审核通过"),
| REJECTED(30, "审核不通过"),
| CANCELLED(40, "已作废"),
| COMPLETED(50, "已完结");
|
| private final Integer status;
| private final String name;
|
| public static final Integer[] ARRAYS = Arrays.stream(values()).map(TradeForeignOrderStatusEnum::getStatus).toArray(Integer[]::new);
|
| public static String getNameByStatus(Integer status) {
| if (status == null) {
| return null;
| }
| for (TradeForeignOrderStatusEnum e : values()) {
| if (e.getStatus().equals(status)) {
| return e.getName();
| }
| }
| return null;
| }
|
| @Override
| public Integer[] array() {
| return ARRAYS;
| }
|
| }
|
|