package cn.estsh.i3plus.ext.mes.pcn.pojo.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.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @Author: wangjie
 * @CreateDate: 2019/7/30 9:30 AM
 * @Description:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "MES_SUBASSEMBLY_REMADE_RECORD", indexes = {
        @Index(columnList = "SN"),
        @Index(columnList = "PACKAGE_NO"),
        @Index(columnList = "CT_NO"),
        @Index(columnList = "WORK_ORDER_NO"),
        @Index(columnList = "WORK_CENTER_CODE"),
        @Index(columnList = "PART_NO"),
        @Index(columnList = "WORK_TIME"),
        @Index(columnList = "SHIFT_CODE"),
        @Index(columnList = "SN, WORK_ORDER_NO")
})
@Api("组件返工表")
public class MesSubassemblyRemadeRecord extends BaseBean implements Serializable {

    private static final long serialVersionUID = 5175216329499242570L;

    @Column(name = "SYSTEM_SYNC_STATUS")
    @ColumnDefault("2")
    @ApiParam(value = "系统同步标志")
    public Integer systemSyncStatus = 2;

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

    @Column(name = "PACKAGE_NO")
    @ApiParam("包装条码")
    private String packageNo;

    @Column(name = "CT_NO")
    @ApiParam("容器条码")
    private String ctNo;

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

    @Column(name = "WORK_ORDER_NO")
    @ApiParam("返工工单号")
    private String workOrderNo;

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

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

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

    @Column(name = "QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("返工数量")
    private Double qty;

    @Column(name = "SHIFT_CODE")
    @ApiParam("班次代码")
    private String shiftCode;

    @Column(name = "WORK_TIME")
    @ApiParam("作业时间")
    private String workTime;

    @Column(name = "INIT_WORK_ORDER_NO")
    @ApiParam("初始工单号")
    private String initWorkOrderNo;

    @Column(name = "INIT_WORK_CENTER_CODE")
    @ApiParam("初始生产线")
    private String initWorkCenterCode;

    @Column(name = "INIT_QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("初始包装数量")
    private Double initQty;

}
