package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * @description: 个人结算方式
 * @author: DingJie
 * @create: 2021/7/2216:31
 */
public enum PsnSetlWay {

    SETTLE_BY_ITEMS("01", "按项目结算"),

    SETTLE_BY_QUOTA("02", "按定额结算");

    private final String code;
    private final String name;

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

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static PsnSetlWay get(String code) {
        if (StringUtil.isBlank(code)) {
            return null;
        }
        for (PsnSetlWay psnSetlWay : PsnSetlWay.values()) {
            if (code.trim().equals(psnSetlWay.getCode())) {
                return psnSetlWay;
            }
        }
        return null;
    }
}
