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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.annotation.DynamicField;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil;
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;

/**
 * @Description : 条码操作记录表
 * @Reference :
 * @Author : jimmy.zeng
 * @CreateDate : 2019-09-27 16:58
 * @Modify:
 **/
@Data
@Entity
@Table(name="WMS_SN_OPERATE_RECORD")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="条码操作记录表",description = "条码操作记录表")
public class WmsSnOperateRecord extends BaseBean {

    private static final long serialVersionUID = -8163029081131228416L;
    @Column(name = "SN")
    @ApiParam(value = "条码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String sn;

    @Column(name = "LINE_CODE")
    @ApiParam(value = "产线代码")
    private String lineCode;

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

    @Column(name = "LOCATE_NO")
    @ApiParam(value = "库位代码")
    private String locateNo;

    @Column(name = "QTY", columnDefinition = "decimal(18,8)", nullable = false)
    @ApiParam(value = "数量", example = "0")
    @ColumnDefault("0")
    private Double qty = 0d;

    @Column(name = "PART_NO")
    @ApiParam(value = "物料编号")
    private String partNo;

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

    @Column(name = "CUST_NO")
    @ApiParam(value = "客户编码")
    private String custNo;

    @Column(name = "VENDOR_NO")
    @ApiParam(value = "供应商编码")
    public String vendorNo;

    @Column(name = "SHIPPING_FLAG")
    @ApiParam(value = "发往地")
    private String shippingFlag;

    @Column(name = "OPERATE_TYPE")
    @ApiParam(value = "操作类型")
    @AnnoOutputColumn(refClass = WmsEnumUtil.SN_OPERATE_TYPE.class, refForeignKey = "value", value = "description")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, dataSrc = "SN_OPERATE_TYPE")
    private Integer operateType;

	@Column(name = "ref_sn")
	@ApiParam(value = "关联二维码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String refSN;

    @Column(name = "REMARK")
    @ApiParam(value = "备注")
    private String remark;

}
