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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
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 : jason.niu
 * @CreateDate : 2020-05-28
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "SWEB_MOVEMENT_TO_WMS")
@Api("库存移动单处理成功后的记录")
public class SwebMovementToWms extends BaseBean {
    private static final long serialVersionUID = -8089219927352225317L;

    @Column(name = "ORDER_NO")
    @ApiParam("单号")
    public String orderNo;

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

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

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

    @Column(name = "PART_NAME")
    @ApiParam("物料名称")
    private String partName;

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

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

    @Column(name = "SRC_WH_NO")
    @ApiParam("源仓库代码")
    public String srcWhNo;

    @Column(name = "DEST_ZONE_NO")
    @ApiParam("目标存储区代码")
    public String destZoneNo;

    /**
     * 移动类型:IN=入库,OUT=出库,MOVE=移库
     */
    @Column(name = "MOVE_TYPE")
    @ApiParam("移动类型")
    @AnnoOutputColumn(refClass = WmsEnumUtil.OUT_MOVEMENT_MOVE_TYPE.class, refForeignKey = "value", value = "description")
    public Integer moveType;
    /**
     * 业务类型:RC=收货,QC=质检,IN=入库,ZI=杂收,ZO=杂发,
     * VJ=供应商退货,CJ=客户退货,WP=工单领料,WJ=工单退料,
     * MI=移库入库,MO=移库出库,SO=发运
     */
    @Column(name = "BUSI_TYPE")
    @ApiParam("业务类型")
    @AnnoOutputColumn(refClass = WmsEnumUtil.OUT_MOVEMENT_BUSI_TYPE.class, refForeignKey = "value", value = "description")
    public Integer busiType;

    /**
     * 状态:1=创建,10=待处理,20=已处理
     */
    @Column(name="ITEM_STATUS")
    @ApiParam(value = "状态", example = "0")
    public Integer itemStatus;

    @Column(name = "SYNC_STATUS")
    @ApiParam("同步状态")
    private Integer syncStatus;
}
