package com.sckw.transport.model.enuma;

import lombok.Getter;

/**
 * @author zk
 * @desc 车辆运单表头状态查询枚举
 * @date 2024/3/8 0008
 */
@Getter
public enum CarWaybillTableTopEnum {
    /**
     * 待接单
     */
    TREAT_CONNECT(100, "101", "待接单"),
    /**
     * 待出车
     */
    TREAT_OUT(200, "201", "待出车"),
    /**
     * 已出车
     */
    SET_OUT(300, "203", "已出车"),
    /**
     * 到达装货点
     */
    LOAD_ADDRESS(400, "301", "到达装货点"),
    /**
     * 已装货
     */
    LOAD(500, "302", "已装货"),
    /**
     * 到达卸货点
     */
    UNLOAD_ADDRESS(600, "401", "到达卸货点"),
    /**
     * 已卸货
     */
    UNLOAD(700, "402", "已卸货"),
    /**
     * 单证审核
     */
    DOCUMENT_REVIEW(800,  "501,504,503", "单证审核"),
    /**
     * 单证审核
     */
    CPMPLETE(900,  "502", "完成"),
    /**
     * 已作废
     */
    VOIDED(1000, "102,103,202,", "已作废");


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

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

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

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

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }
}
