package cn.hnthyy.thmz.enums;

import java.util.Arrays;
import java.util.List;

/**
 * socket发送方类型
 */
public enum SocketSenderTypeEnum {
    PAY("JF","缴费"),
    DISPENSING_MEDICINE("PY","配药"),
    SEND_MEDICINE("FY","发药"),
    CALL_NUMBER("JH","叫号");

    public String code;
    public String name;

    SocketSenderTypeEnum(String code, String name){
        this.code=code;
        this.name=name;
    }

    /**
     * 根据编码查询对应的类型
     * @param code
     * @return
     */
    public static SocketSenderTypeEnum geteBedStatusByCode(String code){
        List<SocketSenderTypeEnum> classCodeEnums= Arrays.asList(values());
        for (SocketSenderTypeEnum classCode:classCodeEnums){
            if(classCode.code.equals(code)){
                return classCode;
            }
        }
        return null;
    }
}
