package com.wms.entity.app.request;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.wms.entity.table.Vehicle;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 载具查询
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class VehicleQuery extends PageQuery {
    /**
     * 载具编号
     */
    @JsonProperty("vehicleId")
    private String vehicleId;
    /**
     * 载具状态
     */
    @JsonProperty("vehicleStatus")
    private Integer vehicleStatus;
    /**
     * 是否为空
     */
    @JsonProperty("isEmpty")
    private Integer isEmpty;
    /**
     * 料箱类型
     */
    @JsonProperty("vehicleType")
    private String vehicleType;
    /**
     * 当前位置
     */
    @JsonProperty("currentLocation")
    private String currentLocation;

    /**
     * 将VehicleQuery转化为VehiclePO
     * @return VehiclePO
     */
    public Vehicle toVehiclePO() {
        Vehicle vehiclePO = new Vehicle();
        vehiclePO.setVehicleId(vehicleId);
        vehiclePO.setVehicleStatus(vehicleStatus);
        vehiclePO.setIsEmpty(isEmpty);
        vehiclePO.setCurrentLocation(currentLocation);
        vehiclePO.setVehicleType(vehicleType);

        return vehiclePO;
    }
}
