package com.sckw.core.model.enums;

/**
 * @author lfdc
 * @description 车辆运单状态枚举
 * @date 2023-07-14 14:07:23
 */
public enum CarWaybillEnum {
    /**
     * 待接单
     */
    PENDING_ORDER(1, "pendingOrder", "1", "待接单"),
    /**
     * 待出车
     */
    PENDING_VEHICLE(2, "pendingVehicle", "2", "待出车"),
    /**
     * 已出车
     */
    EXIT_COMPLETED(3, "exitCompleted", "3", "已出车"),
    /**
     * 到达装货点
     */
    WAIT_LOADING(4, "waitLoading", "4", "到达装货点"),
    /**
     * 已装货
     */
    COMPLETION_LOADING(5, "completionLoading", "5", "已装货"),
    /**
     * 到达卸货点
     */
    WAIT_UNLOADING(6, "waitUnloading", "6", "到达卸货点"),
    /**
     * 已卸货
     */
    COMPLETION_UNLOADING(7, "completionUnloading", "7", "已卸货"),
    /**
     * 已核单
     */
    APPROVAL_COMPLETED(8, "approvalCompleted", "8", "已核单"),
    /**
     * 拒接单
     */
    REJECT_ORDER(9, "rejectOrder", "9", "拒接单"),
    /**
     * 拒出车
     */
    REFUSE_TRAFFIC(10, "refuseTraffic", "10", "拒出车"),
    /**
     * 已撤销
     */
    REVOKED(11, "revoked", "11", "已撤销"),
    ;

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

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public String getStatus() {
        return status;
    }

    public String getDestination() {
        return destination;
    }

    CarWaybillEnum(Integer code, String value, String status, String destination) {
        this.code = code;
        this.value = value;
        this.status = status;
        this.destination = destination;
    }

    public static String getLogisticsOrderValue(Integer code) {
        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
            if (waybillEnum.getCode().equals(code)) {
                return waybillEnum.getValue();
            }
        }
        return null;
    }

    public static String getName(Integer code) {
        for (CarWaybillEnum waybillEnum : CarWaybillEnum.values()) {
            if (waybillEnum.getCode().equals(code)) {
                return waybillEnum.getDestination();
            }
        }
        return null;
    }
}
