package com.fjhx.wms.entity.stock.emums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;

@AllArgsConstructor
@Getter
public enum StockWaitType {

    BORDER_OF_LINE_IN(InOutType.IN, 1, "线边回仓", ""),
    COMPLETION_IN(InOutType.IN, 2, "完工入库", ""),
    PURCHASE_ARRIVAL_IN(InOutType.IN, 3, "采购到货", ""),
    BACK_OUT(InOutType.OUT, 4, "退货出库", ""),
    JD_ORDER_OUT(InOutType.OUT, 5, "京东订单出库", "jd_order"),
    SALE_ORDER_OUT(InOutType.OUT, 6, "销售订单出库", "order_info"),
    PRODUCTION_TASK_OUT(InOutType.OUT, 7, "生产任务待出库", "production_task");


    /**
     * 出入库类型
     */
    private final InOutType type;

    /**
     * 详细类型
     */
    private final Integer detailType;

    /**
     * 信息类型说明
     */
    private final String detailTypeRemark;

    /**
     * 关联业务表名
     */
    private final String linkBusinessTableName;

    private static HashMap<String, StockWaitType> hashMap = new HashMap<>();
    static {
        for (StockWaitType value : StockWaitType.values()) {
            hashMap.put(String.valueOf(value.detailType), value);
        }
    }

    public static String getEnum(String code) {
        return hashMap.get(code).getDetailTypeRemark();
    }

}
