package cn.estsh.i3plus.pojo.wms.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @Description 家具实体
 * @Reference
 * @Author dragon
 * @CreateDate 2020/2/20 10:42
 * @Modify
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "WMS_FURNITURE")
@Api("家具表")
public class WmsFurniture extends BaseBean {
    private static final long serialVersionUID = -8428899843794155828L;

    @Column(name = "WH_NO")
    @ApiParam(value = "仓库代码")
    private String whNo;

    @Column(name = "ZONE_NO")
    @ApiParam(value = "存储区代码")
    private String zoneNo;

    @Column(name = "TYPE_CODE")
    @ApiParam(value = "家具类型编号")
    private String typeCode;

    @Column(name = "FURNITURE_NO")
    @ApiParam(value = "家具代码")
    private String furnitureNo;

    @Column(name = "IS_SAVE_GOODS")
    @ApiParam(value = "是否储物")
    private Integer isSaveGoods;

    @Column(name = "POSITION")
    @ApiParam(value = "三维位置")
    private String position;

    @Transient
    @ApiParam(value = "层")
    private Integer storey;

    @Transient
    @ApiParam(value = "列")
    private Integer fntCol;

    public WmsFurniture() {
    }

    public WmsFurniture(Long id,String organizeCode, String whNo, String zoneNo, String typeCode, String furnitureNo,
                        Integer isSaveGoods, String position, Integer storey, Integer fntCol) {
        this.id = id;
        this.organizeCode = organizeCode;
        this.whNo = whNo;
        this.zoneNo = zoneNo;
        this.typeCode = typeCode;
        this.furnitureNo = furnitureNo;
        this.isSaveGoods = isSaveGoods;
        this.position = position;
        this.storey = storey;
        this.fntCol = fntCol;
    }

    public Integer getIsSaveGoodsVal() {
        return this.isSaveGoods == null ? 0 : this.isSaveGoods;
    }

}
