package cn.estsh.i3plus.ext.mes.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.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @author yumingxing
 * @version 1.0
 * @date 2021/1/12 15:58
 **/
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "MES_WORK_ORDER_EXT_BIND_SN_RECORD", indexes = {
        @Index(columnList = "WORK_ORDER_NO")
})
@Api("生产工单条码绑定记录表")
public class MesWorkOrderExtBindSnRecord extends BaseBean implements Serializable {

    private static final long serialVersionUID = 4481397957849258345L;

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

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

    @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 = "WO_TYPE")
    @ApiParam("工单类型")
    private Integer workOrderType;

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

    @Column(name = "AREA_CODE")
    @ApiParam("区域代码")
    private String areaCode;

    @Column(name = "PROD_TYPE")
    @ApiParam("模式: 单个绑定=10 批量绑定=20; 单个解绑=30; 批量解绑=40")
    private Integer prodType;

    @Column(name = "SERIAL_NUMBER")
    @ApiParam("起始条码")
    private String serialNumber;

    @Column(name = "SERIAL_NUMBER_END")
    @ApiParam("截止条码")
    private String serialNumberEnd;

    @Column(
            name = "OPERATE_QTY",
            columnDefinition = "decimal(18,8)"
    )
    @ColumnDefault("0")
    @ApiParam("操作数量")
    private Double operateQty;

}
