提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.module.bpm.enums.task; |
H |
2 |
|
|
3 |
import com.iailab.framework.common.core.IntArrayValuable; |
bb2880
|
4 |
import com.iailab.framework.common.util.object.ObjectUtils; |
e7c126
|
5 |
import lombok.AllArgsConstructor; |
H |
6 |
import lombok.Getter; |
|
7 |
|
|
8 |
import java.util.Arrays; |
|
9 |
|
|
10 |
/** |
|
11 |
* 流程实例 ProcessInstance 的状态 |
|
12 |
* |
|
13 |
* @author iailab |
|
14 |
*/ |
|
15 |
@Getter |
|
16 |
@AllArgsConstructor |
|
17 |
public enum BpmProcessInstanceStatusEnum implements IntArrayValuable { |
|
18 |
|
bb2880
|
19 |
NOT_START(-1, "未开始"), |
e7c126
|
20 |
RUNNING(1, "审批中"), |
H |
21 |
APPROVE(2, "审批通过"), |
|
22 |
REJECT(3, "审批不通过"), |
|
23 |
CANCEL(4, "已取消"); |
|
24 |
|
|
25 |
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmProcessInstanceStatusEnum::getStatus).toArray(); |
|
26 |
|
|
27 |
/** |
|
28 |
* 状态 |
|
29 |
*/ |
|
30 |
private final Integer status; |
|
31 |
/** |
|
32 |
* 描述 |
|
33 |
*/ |
|
34 |
private final String desc; |
|
35 |
|
|
36 |
@Override |
|
37 |
public int[] array() { |
4a47e4
|
38 |
return ARRAYS; |
e7c126
|
39 |
} |
H |
40 |
|
bb2880
|
41 |
public static boolean isRejectStatus(Integer status) { |
H |
42 |
return REJECT.getStatus().equals(status); |
|
43 |
} |
|
44 |
|
|
45 |
public static boolean isProcessEndStatus(Integer status) { |
|
46 |
return ObjectUtils.equalsAny(status, |
|
47 |
APPROVE.getStatus(), REJECT.getStatus(), CANCEL.getStatus()); |
|
48 |
} |
|
49 |
|
|
50 |
|
e7c126
|
51 |
} |