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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
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.ColumnDefault;
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 : jimmy.zeng
 * @CreateDate : 2019-06-17 11:57
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="WMS_CS_RANGE")
@Api("盘点范围信息")
public class WmsCSRange extends BaseBean {

    private static final long serialVersionUID = 7429676886975711828L;
    @Column(name="ORDER_NO")
    @ApiParam("单号")
    public String orderNo;

    @Column(name = "ITEM")
    @ApiParam("行号")
    public String item;

    @Column(name = "PART_NO")
    @ApiParam("物料编码")
    public String partNo;

    @Column(name="PART_NAME_RDD")
    @ApiParam("物料名称")
    public String partNameRdd;

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

    @Column(name = "ZONE_NO")
    @ApiParam("存储区编号")
    public String zoneNo;

    @Column(name = "LOCATE_NO")
    @ApiParam("库位编号")
    @AnnoOutputColumn(hidden = true)
    public String locateNo;

    @Column(name = "UNIT")
    @ApiParam("单位")
    public String unit;

    @Column(name="SRC_ORDER_NO")
    @ApiParam("原单号")
    public String srcOrderNo;

    @Column(name = "QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam(value = "库存数量", example = "0")
    public Double qty;

    @Column(name = "LOT_NO")
    @ApiParam("收货批次")
    public String lotNo;

    @Transient
    @ApiParam("存储区编号组")
    @AnnoOutputColumn(hidden = true)
    public String[] zoneNos;

    @Transient
    @ApiParam("库存地代码")
    @AnnoOutputColumn(hidden = true)
    public String areaNo;

    @Transient
    @ApiParam("存储区")
    @AnnoOutputColumn(hidden = true)
    public String basZoneNo;

    public WmsCSRange(){}

    public WmsCSRange(String zoneNo,String partNo,String partNameRdd){
        this.zoneNo = zoneNo;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
    }

    public WmsCSRange(String zoneNo, String basZoneNo, String areaNo, String partNo, String partNameRdd) {
        this.zoneNo = zoneNo;
        this.basZoneNo = basZoneNo;
        this.areaNo = areaNo;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
    }
}
