lead
8 天以前 e2339db8255e350596310ab27bebe5b4a014d5aa
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
package cn.iocoder.yudao.module.mes.enums.safety;
 
import lombok.AllArgsConstructor;
import lombok.Getter;
 
/**
 * 安全生产 - 隐患状态枚举
 *
 * <p>流转顺序:上报 → 分派 → 整改中 → 待复查 → 已闭环 / 复查不通过(退回整改)。</p>
 *
 * @author 超级管理员
 */
@Getter
@AllArgsConstructor
public enum SafetyHazardStatusEnum {
 
    REPORTED("REPORTED", "已上报"),
    ASSIGNED("ASSIGNED", "已分派"),
    RECTIFYING("RECTIFYING", "整改中"),
    RECHECKING("RECHECKING", "待复查"),
    REJECTED("REJECTED", "复查不通过"),
    CLOSED("CLOSED", "已闭环");
 
    private final String status;
    private final String name;
 
    public static String getNameByStatus(String status) {
        for (SafetyHazardStatusEnum value : values()) {
            if (value.getStatus().equals(status)) {
                return value.getName();
            }
        }
        return status;
    }
 
    public static boolean isFinished(String status) {
        return CLOSED.getStatus().equals(status);
    }
 
}