package com.prolog.rdc.tms.constant.enums;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * 日志类型枚举
 * @author hongbo.pan
 * @date 2023/4/11
 */
@AllArgsConstructor
@Getter
public enum LogTypeEnum {

    SHIP_BILL(1, "运单"),
    SHIPPER(2, "合同"),
    STATEMENT(3, "对账单"),
    SETTLEMENT(4, "结算单"),
    FEE(5, "收入费用单"),
    LOADING_BILL(10, "派车单"),
    PAY_FEE(20, "支出费用单"),
    PAY_SETTLEMENT(30, "支出结算单"),
    ;

    private static Map<Integer, LogTypeEnum> enumMap = Maps.newHashMap();
    private Integer code;
    private String desc;

    static {
        for(LogTypeEnum as : LogTypeEnum.values()) {
            enumMap.put(as.code, as);
        }
    }

    public static LogTypeEnum getByCode(Integer code) {
        return  enumMap.get(code);
    }

}
