package thyyxxk.webserver.constants;

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

/**
 * 账页状态:0 未结算  1是出院结算  3是中间结算  4是已出纳
 */
public enum SettleTypeEnum {
    UNBALANCED_ACCOUNT("0","未结算"),
    OUT_SETTLEMENT("1","出院结算"),
    MIDDLE_SETTLEMENT("3","中间结算"),
    TELLER("4","已出纳");

    public String code;
    public String name;

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

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