package com.sckw.transport.model.enuma;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zk
 * @desc 车辆运单详情状态查询枚举
 * @date 2024/3/8 0008
 */
@Getter
public enum CarWaybillAppEnum {
    /**
     * 详情-全部
     */
    TOTAL(10, "", "全部", "total"),
    /**
     * 详情-进行
     */
    PROCEED(20, "101, 201, 203, 301, 302, 401, 402, 501, 503, 504", "进行", "proceed"),
    /**
     * 详情-完成
     */
    FINISH(30, "502", "完成", "finish"),
    /**
     * 详情-退回
     */
    CANCEL(40, "102, 103, 202", "退回", "cancel"),
    /**
     * 看板-运输中
     */
    NDEX_PROCEED(50, "101, 201, 203, 301, 302, 401, 402, 501, 503, 504", "运输中", "ndexProceed"),
    /**
     * 看板-完成
     */
    NDEX_FINISH(60, "102, 103, 202, 502", "完成", "ndexFinish");

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

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

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

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

    public static CarWaybillAppEnum getRemark(String remark) {
        for (CarWaybillAppEnum entity : CarWaybillAppEnum.values()) {
            if (entity.getRemark().equals(remark)) {
                return entity;
            }
        }
        return null;
    }

}
