package com.jwipc.order.constant;

import lombok.Getter;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@Getter
public enum DeliveryType {
    //A-订单交货 B-计划交货
    ORDER("A", "订单交货"),
    PLAN("B", "计划交货");


    private String code;
    private String desc;

    DeliveryType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

   public static DeliveryType forCode(String code) {
        for (DeliveryType deliveryType : DeliveryType.values()) {
            if (deliveryType.getCode().equals(code)) {
                return deliveryType;
            }
        }
        return ORDER;
    }
}
