package cn.estsh.i3plus.pojo.mes.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.util.List;

/**
 * @Description:
 * @Reference:
 * @Author: joke.wang
 * @CreateDate: 2019\10\16 14:33
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_REPAIR_RECORD", indexes = {
        @Index(columnList = "SERIAL_NUMBER"),
        @Index(columnList = "CREATE_DATE_TIME"),
        @Index(columnList = "PART_NO")
})
@Api("维修信息记录表")
public class MesRepairRecord extends BaseBean implements Serializable {
    private static final long serialVersionUID = -1758374702271940323L;

    @Column(name = "SERIAL_NUMBER")
    @ApiParam("产品条码")
    private String serialNumber;

    @Column(name = "PART_NO")
    @ApiParam("产品物料号")
    private String partNo;

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

    @Column(name = "DEFECT_CODE")
    @ApiParam("缺陷代码")
    private String defectCode;

    @Column(name = "DEFECT_NAME")
    @ApiParam("缺陷名称")
    private String defectName;

    @Column(name = "SIDE_LOCATION")
    @ApiParam("产品面位")
    private String sideLocation;

    @Column(name = "DEFECT_LOCATION")
    @ApiParam("缺陷位置")
    private String defectLocation;

    @Column(name = "REPAIR_CODE")
    @ApiParam("维修代码")
    private String repairCode;

    @Column(name = "REPAIR_NAME")
    @ApiParam("维修名称")
    private String repairName;

    @Column(name = "DC_CODE")
    @ApiParam("缺陷原因代码")
    private String dcCode;

    @Column(name = "DC_NAME")
    @ApiParam("缺陷原因描述")
    private String dcName;

    @Column(name = "WORK_CENTER_CODE")
    @ApiParam("生产线")
    private String workCenterCode;

    @Column(name = "WORK_CELL_CODE")
    @ApiParam("工位")
    private String workCellCode;

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

    @Transient
    @ApiParam("备注")
    private String spareMemo;

    @Transient
    @ApiParam("不良记录id")
    private Long defectRecordId;

    @Transient
    @ApiParam("缺陷集合")
    private List<MesDefect> mesDefectList;

    @Transient
    @ApiParam("质量状态")
    private Integer qcStatus;
}
