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

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.annotation.JsonFormat;
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.Index;
import javax.persistence.Table;

/**
 * @Description : 质检单条码质检不良清单表
 * @Reference :
 * @Author : rock.yu
 * @CreateDate : 2020-09-01 14:37
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="WMS_QC_SN_ERROR_LIST",
        indexes = {
                @Index(columnList = "ORGANIZE_CODE"),
                @Index(columnList = "ORDER_NO"),
                @Index(columnList = "PART_NO"),
                @Index(columnList = "SN")
})
@Api("质检单条码质检不良清单表")
public class WmsQCSNErrorList extends BaseBean {
    private static final long serialVersionUID = 4905945381732744790L;

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

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

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

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

    @Column(name="SAMPLE_QTY", nullable = false)
    @ApiParam("检验数量")
    @ColumnDefault("0")
    private double sampleQty;

    @Column(name="REJECT_QTY", nullable = false)
    @ApiParam("不合格数量")
    @ColumnDefault("0")
    private double rejectQty;

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

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

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

    @Column(name="SN")
    @ApiParam("条码")
    private String sn;

    @Column(name = "QC_USER")
    @ApiParam("检验员")
    private String qcUser;

    @Column(name = "QC_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiParam(value = "检验时间", example = "2000-01-01 01:00:00")
    private String qcTime;

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

    @Column(name = "ERROR_CODE")
    @ApiParam("不良代码")
    private String errorCode;

    @Column(name = "ERROR_DESC_RDD")
    @ApiParam("不良描述")
    private String errorDescRdd;

    @Column(name = "RC_QTY", columnDefinition = "decimal(18,8)", nullable = false)
    @ColumnDefault("0")
    @ApiParam(value = "收货数量", example = "0")
    public Double rcQty;

    @Column(name = "QC_SCALE", columnDefinition = "decimal(18,8)", nullable = false)
    @ColumnDefault("0")
    @ApiParam(value = "质检比例", example = "0")
    public String qcScale;
}
