package com.sckw.core.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.EnumSet;

/**
 * @author lfdc
 * @desc 车辆运单状态枚举
 * @date 2023-07-14 14:07:23
 */
@Getter
@AllArgsConstructor
public enum LoadingTypeEnum {

    /**
     * 装载
     */
    LOADING(0,  "装载任务"),

    /**
     * 补货
     */
    SUPPLEMENT(1, "补货任务"),

    ;

    private final Integer code;

    private final String destination;


    public static String geDesc(Integer status) {
        if (status == null) {
            return null;
        }
        for (LoadingTypeEnum loadingTypeEnum : EnumSet.allOf(LoadingTypeEnum.class)) {
            if (loadingTypeEnum.code.equals(status)) {
                return loadingTypeEnum.destination;
            }
        }
        return null;
    }

}
