package com.wms_main.model.vo.wms;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.wms_main.model.po.TAppImage;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 图纸Vo
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ImageVo extends BaseImportVo {
    /**
     * 图纸id
     */
    @JsonProperty("imageId")
    private String imageId;
    /**
     * 成品号
     */
    @JsonProperty("productId")
    private String productId;
    /**
     * 料盒号
     */
    @JsonProperty("boxNo")
    private String boxNo;
    /**
     * 图纸存放ip
     */
    @JsonProperty("imageIp")
    private String imageIp;
    /**
     * 图纸存放地址
     */
    @JsonProperty("imagePath")
    private String imagePath;
    /**
     * 图纸名称
     */
    @JsonProperty("imageName")
    private String imageName;
    /**
     * 图纸详情
     */
    @JsonProperty("imageDetail")
    private String imageDetail;
    /**
     * 图纸对应得配料类型
     * 1：总成
     * 2：单片
     */
    @JsonProperty("imageType")
    private Integer imageType;

    /**
     * 将po对象转换为vo对象
     * @param po po对象
     * @return vo
     */
    public static ImageVo ofPo(TAppImage po)
    {
        ImageVo imageVo = new ImageVo();
        if (po == null) {
            return imageVo;
        }
        imageVo.setImageId(po.getImageId());
        imageVo.setProductId(po.getProductId());
        imageVo.setBoxNo(po.getBoxNo());
        imageVo.setImagePath(po.getImagePath());
        imageVo.setImageName(po.getImageName());
//        imageVo.setImageDetail(po.getImageDetail());
        imageVo.setImageType(po.getImageType());
        return imageVo;
    }
}
