package cn.iocoder.yudao.module.mes.enums.collect; import lombok.AllArgsConstructor; import lombok.Getter; /** * MES 数采报文类型 * * @author 超级管理员 */ @Getter @AllArgsConstructor public enum MesCollectMsgTypeEnum { REALTIME("realtime", "实时数据"), SPC("spc", "周期过程数据"), TECH("tech", "工艺参数"), OP_LOG("opLog", "参数变更日志"), ALARM("alarm", "报警"), CONNECT("connect", "设备上线"), DISCONNECT("disconnect", "设备离线"), UNKNOWN("unknown", "未知类型"); private final String type; private final String name; public static MesCollectMsgTypeEnum getByType(String type) { for (MesCollectMsgTypeEnum value : values()) { if (value.type.equalsIgnoreCase(type)) { return value; } } return UNKNOWN; } }