package com.yuchen.saas.park.api.enums.work;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @Author: caiwq
 * @Date: 2024/4/8 15:18
 * @Description: 工单大类枚举类型
 */
@Getter
@AllArgsConstructor
public enum WorkOrderCategoryEnum {
    /**
     * 报事报修
     */
    MATTER_REPAIR(1, "报事报修"),
    /**
     * 设备报修
     */
    DEVICE_REPAIR(2, "设备报修"),
    /**
     * 告警运维
     */
    ALARM_OPERATION(3, "告警运维");

    private final int value;
    private final String desc;

    public static String getDescByCode(Integer value) {
        if (Objects.isNull(value)) {
            return "";
        }
        WorkOrderCategoryEnum[] enumArray = WorkOrderCategoryEnum.values();
        for (WorkOrderCategoryEnum e : enumArray) {
            if (e.getValue() == value) {
                return e.getDesc();
            }
        }
        return "";
    }
}
