package cn.estsh.i3plus.pojo.mes.pcn.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
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.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @Description:
 * @Reference:
 * @Author: joke.wang
 * @CreateDate: 2019\10\16 15:03
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_DISMANTLE_RECORD", indexes = {
        @Index(columnList = "SN"),
        @Index(columnList = "CREATE_DATE_TIME")
})
@Api("物料拆解记录表")
public class MesDismantleRecord extends BaseBean implements Serializable {

    private static final long serialVersionUID = -7924346039878218038L;
    @Column(name = "DISMANTLE_ID")
    @ApiParam("拆解编号")
    private String dismantleId;

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("工作中心代码")
    private String workCenterCode;

    @Column(name = "WORK_CELL_CODE")
    @ApiParam("工作单元代码")
    private String workCellCode;

    @Column(name = "PARENT_PART_NO")
    @ApiParam("产品物料编码")
    private String parentPartNo;

    @Column(name = "PARENT_PART_NAME")
    @ApiParam("产品物料名称")
    private String parentPartName;

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

    @Column(name = "QTY")
    @ApiParam("产品数量")
    private Double qty;

    @Column(name = "DISMANTLE_QTY")
    @ApiParam("拆解数")
    private BigDecimal dismantleQty;

    @Column(name = "ITEM_PART_NO")
    @ApiParam("子物料编码")
    private String itemPartNo;

    @Column(name = "ITEM_PART_NAME")
    @ApiParam("子物料名称")
    private String itemPartName;

    @Column(name = "OK_QTY")
    @ApiParam("合格数")
    private BigDecimal okQty;

    @Column(name = "MISS_QTY")
    @ApiParam("缺失数")
    private BigDecimal missQty;

    @Column(name = "SCRAP_QTY")
    @ApiParam("报废数")
    private BigDecimal scrapQty;

    @Column(name = "MEMO")
    @ApiParam("备注")
    private String memo;

    @Column(name = "LOT_NO")
    @ApiParam("关联批次")
    private String lotNo;

    @Transient
    private String serialNumber;
}
