package cn.estsh.i3plus.pojo.wms.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;
import javax.persistence.Transient;

/**
 * @Description : 库存初始化表
 * @Reference :
 * @Author : jimmy.zeng
 * @CreateDate : 2019-08-01 11:44
 * @Modify:
 **/

@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="WMS_STOCK_INITIALIZE")
@Api("库存初始化信息")
public class WmsStockInitialize extends BaseBean {

    private static final long serialVersionUID = -6653811290493674698L;
    @Column(name = "WH_NO")
    @ApiParam(value = "仓库代码")
    @AnnoOutputColumn(required = false)
    private String whNo;

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

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

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

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

    @Column(name = "UNIT")
    @ApiParam(value = "单位")
    @AnnoOutputColumn(required = false)
    private String unit;

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

    @Column(name = "SNP", columnDefinition = "decimal(18,8)", nullable = false)
    @ApiParam(value = "标准包装", example = "1")
    @AnnoOutputColumn(required = false)
    private Double snp;

    @Column(name = "STATUS")
    @ApiParam(value = "状态", example = "0")
    private Integer status;

    @ApiParam(value ="工厂代码")
    @AnnoOutputColumn
    private String currentOrganizeCode;

    @Column(name = "SN")
    @ApiParam(value = "工装条码")
    @AnnoOutputColumn(required = false)
    private String sn;

    @Column(name = "QC_STATUS")
    @ApiParam(value = "质检状态", example = "0")
    @ColumnDefault("10")
    @AnnoOutputColumn(refClass = WmsEnumUtil.STOCK_SN_QC_STATUS.class, refForeignKey = "value", value = "description", required = false)
    private Integer qcStatus;

    /**
     * 条码状态：1=创建，10=质检中，20=待入库，30=入库，40=配料，50=出库，60=报废，70=在途
     */
    @Column(name = "SN_STATUS")
    @ApiParam(value = "条码状态", example = "0")
    @ColumnDefault("30")
    @AnnoOutputColumn(refClass = WmsEnumUtil.STOCK_SN_STATUS.class, refForeignKey = "value", value = "description", required = false)
    private Integer snStatus;

    @Column(name = "USE_COUNT", nullable = true)
    @ApiParam(value = "领用次数", example = "0")
    @ColumnDefault("0")
    @AnnoOutputColumn(required = false)
    private Integer useCount;

    @Column(name = "SEQ_NO", nullable = true)
    @ApiParam(value = "序号", example = "0")
    @ColumnDefault("0")
    @AnnoOutputColumn(required = false)
    private Integer seqNo;

    @Transient
    @ApiParam(value = "确认标志")
    private boolean confirm;


    @Transient
    @ApiParam(value = "物料-1，器具-2")
    public String intiType;

}
