package com.sckw.fleet.model.vo;


import com.sckw.fleet.model.TmsTruckAxleNum;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * Author: donglang
 * Time: 2025-10-23
 * Des: 车辆轴数
 * Version: 1.0
 */

@Data
public class TruckAxleNumVO implements Serializable {

    @Serial
    private static final long serialVersionUID = -9020028380990215890L;

    /**
     * 主键ID
     */
    private Integer id;

    /**
     * 车辆轴数名称
     */
    private String name;

    /**
     * 轴数（如：2轴、3轴）
     */
    private String num;

    /**
     * 默认准载量
     */
    private BigDecimal standardLoad;

    /**
     * 货车法定载重
     */
    private BigDecimal legalLoad;

    /**
     * 牵引车法定载重
     */
    private BigDecimal tractorLegalLoad;

    /**
     * 状态（1正常，2禁用）
     */
    private Integer status;

    private static TruckAxleNumVO getInstance(){
        return new TruckAxleNumVO();
    }

    public static TruckAxleNumVO toTruckAxleNumVO(TmsTruckAxleNum axleNum){
        if (axleNum == null) {
            return TruckAxleNumVO.getInstance();
        }
        TruckAxleNumVO devicePageResp = TruckAxleNumVO.getInstance();
        devicePageResp.setId(axleNum.getId());
        devicePageResp.setName(axleNum.getName());
        devicePageResp.setStandardLoad(axleNum.getStandardLoad());
        devicePageResp.setLegalLoad(axleNum.getLegalLoad());
        devicePageResp.setTractorLegalLoad(axleNum.getTractorLegalLoad());
        return devicePageResp;
    }


}
