package com.cim.idm.constants.receive;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

@Getter
public enum ReceiveTypeEnums {
    Z001("Z001", "生产物资采购订单"),
    Z002("Z002", "研发采购订单"),
    Z003("Z003", "非生产物资采购订单"),
    Z004("Z004", "固定资产、在建工程采购订单"),
    ZLR1("ZLR1", "销售退货"),
    ZLF0("ZLF0", "销售退货"),
    ZLF1("ZLF1", "销售退货"),
    ZLF2("ZLF2", "销售退货"),
    ZLF3("ZLF3", "销售退货"),
    ZLF4("ZLF4", "销售退货"),
    ZLF5("ZLF5", "销售退货"),
    ZLF6("ZLF6", "销售退货"),
    ZLF7("ZLF7", "销售退货"),
    ZLF8("ZLF8", "销售退货"),
    ZLF9("ZLF9", "销售退货");

    private final String code;
    private final String info;

    ReceiveTypeEnums(String code, String info) {
        this.code = code;
        this.info = info;
    }

    /**
     * 采购订单
     */
    public static List<String> getPurchase() {
        List<String> str = new ArrayList<>();
        str.add(Z001.getCode());
        str.add(Z002.getCode());
        str.add(Z003.getCode());
        str.add(Z004.getCode());
        return str;
    }

    /**
     * 是否采购订单
     */
    public static Boolean isPurchase(String code) {
        return getPurchase().contains(code);
    }

    /**
     * 销售退货
     */
    public static List<String> getsaleReturn() {
        List<String> str = new ArrayList<>();
        str.add(ZLR1.getCode());
        str.add(ZLF0.getCode());
        str.add(ZLF1.getCode());
        str.add(ZLF2.getCode());
        str.add(ZLF3.getCode());
        str.add(ZLF4.getCode());
        str.add(ZLF5.getCode());
        str.add(ZLF6.getCode());
        str.add(ZLF7.getCode());
        str.add(ZLF8.getCode());
        str.add(ZLF9.getCode());
        return str;
    }
    /**
     * 是否使用销售退货
     */
    public static Boolean isSaleReturn(String code) {
        return getsaleReturn().contains(code);
    }
}
