package com.dxhy.common.enums;

/**
 * 统计表操作记录枚举
 * 
 * @author kangzq
 * @date 2019年5月24日
 */
public enum OperaTypeEnum {

    /**
     * 申请统计
     */
    SQTJ("0", 1),
    /**
     * 确认统计
     */
    QRTJ("1", 2),
    /**
     * 撤销统计
     */
    CXTJ("2", 3);

    private final String[] OPERATYPEDMMC = {"申请统计", "确认统计", "撤销统计"};

    private String operaTypeDm;
    private int index;

    OperaTypeEnum(String operaTypeDm, int index) {
        this.operaTypeDm = operaTypeDm;
        this.index = index;
    }

    public String getOperaTypeDmDm(int index) {
        for (OperaTypeEnum fplx : OperaTypeEnum.values()) {
            if (fplx.getIndex() == index) {
                return fplx.operaTypeDm;
            }
        }
        return null;
    }

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

    public String getOperaTypeDm() {
        return operaTypeDm;
    }

    public void setOperaTypeDm(String operaTypeDm) {
        this.operaTypeDm = operaTypeDm;
    }

    public int getIndex() {
        return index;
    }

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