package cn.superdesk.uniorder.common.enums.thirdpart.szhtxx.electronicInvoice;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 2022/3/25 5:33 下午
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/3/25 5:33 下午
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public enum SzhtxxElectronicInvoiceResponseCodeEnum {


    SUCCESS("0000", "成功"),
    ;

    private String returnCode;
    private String returnMsg;

    SzhtxxElectronicInvoiceResponseCodeEnum(String returnCode, String returnMsg) {
        this.returnCode = returnCode;
        this.returnMsg = returnMsg;
    }

    public String getReturnCode() {
        return returnCode;
    }

    public String getReturnMsg() {
        return returnMsg;
    }

    public static String getReturnMsg(Integer key) {
        for (SzhtxxElectronicInvoiceResponseCodeEnum c : SzhtxxElectronicInvoiceResponseCodeEnum.values()) {
            if (c.returnCode.equals(key)) {
                return c.getReturnMsg();
            }
        }
        return null;
    }

    private static final Map<String, SzhtxxElectronicInvoiceResponseCodeEnum> LOOKUP = new HashMap<>();

    static {
        for (SzhtxxElectronicInvoiceResponseCodeEnum s : EnumSet.allOf(SzhtxxElectronicInvoiceResponseCodeEnum.class)) {
            LOOKUP.put(s.getReturnCode(), s);
        }
    }

    public static SzhtxxElectronicInvoiceResponseCodeEnum get(String returnCode) {
        return LOOKUP.get(returnCode);
    }
}
