package com.sckw.transport.model.enuma;

import lombok.Getter;

/**
 * @author zk
 * @desc 车辆运单看板表头状态查询枚举
 * @date 2024/3/8 0008
 */
@Getter
public enum CarWaybillNdexTopEnum {
    /**
     * 待接单
     */
    TREAT_CONNECT(100, "101,102,103", "待接单"),
    /**
     * 待出车
     */
    TREAT_OUT(200, "201", "待出车"),
    /**
     * 已出车
     */
    SET_OUT(300, "203,202", "已出车"),
    /**
     * 运输中
     */
    IN_TRANSIT(400, "301,302,401,402", "运输中"),
    /**
     * 待审核
     */
    WAIT_APPROVAL(500, "501,504,503", "待审核"),
    /**
     * 核单
     */
    APPROVAL_PASS(600, "502", "核单");

    private final Integer code;
    private final String value;
    private final String name;

    CarWaybillNdexTopEnum(Integer code, String value, String name) {
        this.code = code;
        this.value = value;
        this.name = name;
    }

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

    public static String getName1(Integer code) {
        for (CarWaybillTableTopEnum entity : CarWaybillTableTopEnum.values()) {
            if (entity.getValue().contains(String.valueOf(code))) {
                return entity.getValue();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }
}
