package com.dxhy.common.enums;

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

/**
 * @author peipei.li
 * @date 2019-04-29 发票签收结果
 */
public enum FpqsjgEnum {
    /**
     * 未签收
     */
    WQS("0", 1),

    /**
     * 已签收
     */
    YQS("1", 2);

    private static final String[] QSJGMC = {"未签收", "已签收"};

    private static final String[] QSJGMC_SMB = {"签收失败", "签收成功"};

    private String qsjgDm;
    private int index;

    FpqsjgEnum(String qxztDm, int index) {
        this.qsjgDm = qxztDm;
        this.index = index;
    }

    public String getQsjgMc(int index) {
        int length = QSJGMC.length;
        if (index <= length) {
            return QSJGMC[index - 1];
        }
        return null;
    }

    public String getQsjgMcSmb(int index) {
        int length = QSJGMC_SMB.length;
        if (index <= length) {
            return QSJGMC_SMB[index - 1];
        }
        return null;
    }

    /**
     * 枚举放入map中，便于取用
     * 
     */
    public static Map<String, String> getSmbEnumMap() {
        Map<String, String> enumMap = new HashMap<>(16);
        for (FpqsjgEnum en : FpqsjgEnum.values()) {
            enumMap.put(en.getQsjgDm(), en.getQsjgMcSmb(en.getIndex()));
        }
        return enumMap;
    }

    public String getQsjgDm() {
        return qsjgDm;
    }

    public void setQsjgDm(String qsjgDm) {
        this.qsjgDm = qsjgDm;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
