package com.sckw.core.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.EnumSet;

/**
 * @author lfdc
 * @description 物流订单-单据状态
 * @date 2023-07-07 14:07:23
 */
@Getter
@AllArgsConstructor
public enum LogisticsOrderV1Enum {

    /**
     * 物流订单-待接单
     */
  //  PENDING_ORDER(1, "pendingOrder", "1", "待处理"),
    /**
     * 物流订单-待派车
     */
    WAIT_DELIVERY(5, "waitDelivery", "5", "待派车"),
    /**
     * 物流订单-运输中
     */
    IN_TRANSIT(10, "inTransit", "10", "运输中"),
    /**
     * 物流订单-完结中
     */
    NEARING_COMPLETION(15, "haveFinished", "15", "完结中"),
    /**
     * 物流订单-已完成
     */
    COMPLETED(20, "haveReconciled", "20", "已完成"),

    //REJECT_ORDER(99, "rejectOrder", "99", "已拒单"),

    ;

    private final Integer code;
    private final String value;
    private final String status;
    private final String destination;


    public static String getDesc(int code) {
        if (code == 0) {
            return null;
        }
        for (LogisticsOrderV1Enum logisticsOrderV1Enum : EnumSet.allOf(LogisticsOrderV1Enum.class)) {
            if (logisticsOrderV1Enum.code.equals(code)) {
                return logisticsOrderV1Enum.destination;
            }
        }
        return StringUtils.EMPTY;

    }
}
