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.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @Description : BH库存条码扩展表
 * @Reference :
 * @Author : jimmy.zeng
 * @CreateDate : 2020-05-22 13:22
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="QMS_STOCK_SN_EXT_BH")
@Api("BH库存条码扩展表")
public class QmsStockSnExtBh extends BaseBean {

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

    @Column(name="BATCH_NO")
    @ApiParam("BATCH号")
    private String batchNo;

    @Column(name="BH_TYPE")
    @ApiParam("BH类型")
    @AnnoOutputColumn(refClass = WmsEnumUtil.FG_INSTOCK_SN_TYPE.class, refForeignKey = "value", value = "description")
    private Integer bhType;

    @Transient
    @ApiParam("处理状态")
    @AnnoOutputColumn(refClass = WmsEnumUtil.BH_WORK_STATUS.class, refForeignKey = "value", value = "description")
    private Integer workStatus;

    /*****汇总查询结果信息****/
    @Transient
    @ApiParam("产线代码")
    public String workCenterCode;

    @Transient
    @ApiParam("是否合格")
    @AnnoOutputColumn(refClass = WmsEnumUtil.TRUE_OR_FALSE.class, refForeignKey = "value", value = "description")
    public Integer isQualified;


    @Transient
    @ApiParam("返修状态")
    @AnnoOutputColumn(refClass = WmsEnumUtil.REWORK_STATUS.class, refForeignKey = "value", value = "description")
    public Integer reworkStatus;

    @Transient
    @ApiParam("返修结果")
    @AnnoOutputColumn(refClass = WmsEnumUtil.TRUE_OR_FALSE.class, refForeignKey = "value", value = "description")
    public Integer reworkResult;

    @Transient
    @ApiParam("挑选状态")
    @AnnoOutputColumn(refClass = WmsEnumUtil.REWORK_STATUS.class, refForeignKey = "value", value = "description")
    public Integer pickStatus;

    @Transient
    @ApiParam("挑选状态")
    public Integer pickResult;

    @Transient
    @ApiParam("物料号")
    public String partNo;

    @Transient
    @ApiParam("物料名称")
    public String partName;

    @Transient
    @ApiParam("客户发往地")
    public String flagNo;



    @Transient
    @ApiParam("二维码")
    public String serialSn;


    public QmsStockSnExtBh(String organizeCode, String bhCode,
                           String workCenterCode, String partNo,
                           String partName, String flagNo, Integer isQualified,
                           Integer reworkStatus, Integer reworkResult, Integer pickStatus, Integer pickResult, Integer bhType) {
        this.organizeCode = organizeCode;
        this.batchNo = bhCode;
        this.workCenterCode = workCenterCode;
        this.partNo = partNo;
        this.partName = partName;
        this.flagNo = flagNo;
        this.isQualified = isQualified;
        this.reworkStatus = reworkStatus;
        this.reworkResult = reworkResult;
        this.pickStatus = pickStatus;
        this.pickResult = pickResult;
        this.bhType = bhType;
    }

    public QmsStockSnExtBh(String batchNo, Integer bhType) {
        this.batchNo = batchNo;
        this.bhType = bhType;
    }
    public QmsStockSnExtBh() {
    }

}
