package cn.hnthyy.thmz.enums;

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

/**
 * 退欠标记 0:收；1：退；2：作废； 5 处方开立-未收费
 */
public enum PayMarkEnum {
    CHARGED("0","已收"),//收费
    RETURN_PREMIUM("1","退费"),
    CANCELLATION("2","作废"),
    NO_CHARGE("5","处方开立-未收费"),
    //此状态只做收入报表统计，不展示在收费列表
    BYJZ_CHARGED_ORI_DATA("9","本院记账已收费原数据");
    public String code;
    public String name;

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

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