package cn.iocoder.yudao.module.pms.enums.common;

import cn.hutool.core.util.StrUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 设备状态枚举
 *
 * @Auther ruiqi
 * @Date
 */
public enum IotDeviceStatusEnum {
    fc("封存"), dby("待保养"), wxz("维修中"), bf("报废"), xz("闲置"), sg("施工"), dq("动迁"), dm("待命"),zddm("驻地待命"),wg("完工"),xcdm("现场待命"),zb("准备"),dwx("待维修"),gcsy("观察使用");
    private String msg;

    IotDeviceStatusEnum(String msg) {
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }


    public static IotDeviceStatusEnum nameOf(String name) {
        IotDeviceStatusEnum deviceStatusEnum = null;
        if(!StrUtil.isEmpty(name)) {
	        try {
                deviceStatusEnum = IotDeviceStatusEnum.valueOf(name);
	        } catch (Exception e) {
	            LOGGER.warn("设备状态不存在", e);
	        }
        }
        return deviceStatusEnum;
    }

    private static Logger LOGGER = LoggerFactory.getLogger(IotDeviceStatusEnum.class);

}
