package com.jwipc.finance.constant;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
public enum DEDUCTIONTYPE {
    /**
     * 单例对象
     */
    FINEDEDUCTION(4, "质量罚款"),
    QUALITYDEDUCTION(1, "返工费用"),
    OTHERDEDUCTION(3, "PCBA（PCB）报废扣款"),
    EXTENSIONDEDUCTION(2, "质量损失扣款"),
     OTHERSTYPE(5, "其他");




    private final int type;
    private final String name;

    /**
     * 默认构造函数
     */
    DEDUCTIONTYPE(int type, String name) {
        this.type = type;
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static DEDUCTIONTYPE forType(int type) {
        for (DEDUCTIONTYPE value : DEDUCTIONTYPE.values()) {
            if (value.getType() == type) {
                return value;
            }
        }
        return null;
    }
}

