package cn.pluss.platform.entitiy;

import cn.pluss.platform.exception.MsgException;
import lombok.AllArgsConstructor;
import lombok.Getter;


/**
 * 结算类型枚举
 * @author Administrator
 * @date 2021/07/12
 */
@Getter
@AllArgsConstructor
public enum SettleTypeEnum {

    D0("D0",0,"D0实时结算"),
    D1("D1",1,"D1次日结算");

    private String code;

    private Integer value;

    private String name;

    public static boolean checkValues(String code) {
        SettleTypeEnum[] settleTypeEnums = values();
        boolean flag = false;
        for (SettleTypeEnum businessModeEnum : settleTypeEnums) {
            if(businessModeEnum.getCode().equals(code)){
                flag = true;
            }
        }
        if(!flag){
            MsgException.throwException("结算参数有误！");
        }
        return true;
    }

}
