package com.ruoyi.finance;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author caifc
 * @date 2021-10-18 14:39
 */
@Getter
@AllArgsConstructor
public enum WarehouseType {

    // 库存总帐
    KCZZ("KCZZ"),

    // 出库
    SJCK("SJCK"),

    // 货转
    HQZY("HQZY"),

    // 调拨
    CKDB("CKDB"),

    ;

    private final String type;


    public static WarehouseType fromType(Integer tp) {
        for (WarehouseType type : WarehouseType.values()) {
            if (Objects.equals(type.getType(), tp)) {
                return type;
            }
        }
        throw new IllegalArgumentException("warehouse type not exist");
    }

}
