刘光辉
昨天 bb638871a7fb692d80f1b7a758f991dc0879002c
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
package jnpf.limsService.support;
 
import java.util.Optional;
 
/**
 * 水系统取样计划的流程状态到表单业务状态映射。
 */
public final class LimsSxtFlowStatusResolver {
 
    public static final String PENDING = "pending";
    public static final String PROCESSING = "processing";
    public static final String COMPLETED = "completed";
 
    private static final Integer PASSED = 2;
 
    private LimsSxtFlowStatusResolver() {
    }
 
    public static Optional<String> resolveBizStatus(Integer flowState) {
        if (flowState == null) {
            return Optional.empty();
        }
        switch (flowState) {
            case 0:
                return Optional.of(PENDING);
            case 1:
            case 5:
            case 6:
            case 8:
                return Optional.of(PROCESSING);
            case 2:
            case 3:
            case 4:
            case 7:
            case 9:
                return Optional.of(COMPLETED);
            default:
                return Optional.empty();
        }
    }
 
    public static boolean isApproved(Integer flowState) {
        return PASSED.equals(flowState);
    }
}