package com.tax.file.utils;

public enum FplxEnum {
    /**
     * 专票代码
     */
    ZP("01",1),
    /**
     * 机动车代码
     */
    JDC("03",2),
    /**
     * 普票代码
     */
    PP("04",3),
    /**
     * 电子票代码
     */
    DZP("10",4),
    /**
     * 卷式发票代码
     */
    JSP("11",5),
    /**
     * 通行费发票代码
     */
    TXF("14",6),
    /**
     * 二手车发票代码
     */
    ESC("15",6);

    private final String[] FPLXMC = {"增值税专用发票","机动车销售统一发票","增值税普通发票","增值税电子普通发票","增值税普通发票（卷票）","增值税电子普通发票（通行费）","二手车销售统一发票"};

    private String fplxDm;
    private int index;

    private FplxEnum(String fplxDm,int index) {
        this.fplxDm = fplxDm;
        this.index = index;
    }

    public String getFplxDm(int index) {
        for(FplxEnum fplx:FplxEnum.values()) {
            if(fplx.getIndex()==index) {
                return fplx.fplxDm;
            }
        }
        return null;
    }

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

    public String getFplxDm() {
        return fplxDm;
    }

    public void setFplxDm(String fplxDm) {
        this.fplxDm = fplxDm;
    }

    public int getIndex() {
        return index;
    }

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