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

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

/**
 * @Description :MES_QUEUE_JIT_ACTUAL
 * @Reference :
 * @Author : joke
 * @CreateDate : 2020-03-06 10:16 上午
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@Builder
@Table(name = "MES_QUEUE_JIT_ACTUAL_DETAIL", indexes = {
        @Index(columnList = "JIS_ACTUAL_NO"),
        @Index(columnList = "ORGANIZE_CODE"),
        @Index(columnList = "PART_NO"),
        @Index(columnList = "PRODUCE_CTGY_CODE")
})
@Api("MES_客户JIT生产队列明细")
public class MesQueueJitActualDetail extends BaseBean implements Serializable {

    private static final long serialVersionUID = 3211496242571643906L;
    @Column(name = "JIS_ACTUAL_NO")
    @ApiParam("队列编号")
    private String jisActualNo;

    @Column(name = "PROD_CFG_CODE")
    @ApiParam("配置代码")
    private String prodCfgCode;

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

    @Column(name = "PRODUCE_CTGY_CODE")
    @ApiParam("产品位置代码")
    private String produceCtgyCode;

    @Column(name = "PRODUCE_CTGY_Name")
    @ApiParam("产品位置名称")
    private String produceCtgyName;

    @Transient
    @ApiParam("产品位置")
    private String prodCfgName;

    @Column(name = "PART_NAME")
    @ApiParam("产品名称")
    private String partName;

    @Column(name = "QUEUE_GROUP_NO")
    @ApiParam("分组队列编号")
    private String queueGroupNo;

    @Column(name = "GROUP_NO")
    @ApiParam("组内编号")
    private Integer groupNo;

    @Column(name = "GROUP_SEQ")
    @ApiParam("分组序号")
    private String groupSeq;

    @Column(name = "STATUS")
    @ApiParam("状态")
    private Integer status;

    @Column(name = "SEQ")
    @ApiParam("主序编号")
    private String seq;

    @Column(name = "PRODUCE_COLOR")
    @ApiParam("产品颜色")
    private String produceColor;

    @Column(name = "OPTION_CODE")
    @ApiParam("选项代码")
    private String optionCode;

    @Column(name = "FORMULA_CONTENT")
    @ApiParam("配方内容")
    private String formulaContent;

    @Column(name = "ASSY_NO")
    @ApiParam("组件编号")
    private String assyNo;

    @Column(name = "JIS_BACKFLUSH_STATUS")
    @ApiParam("回冲标识")
    private String jisBackflushStatus = "BACKFLUSH";

    @Column(name = "PRODUCT_SN")
    @ApiParam("产品条码")
    private String productSn;

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

    @Column(name = "IS_EMPTY")
    @ApiParam("是否放空")
    private Integer isEmpty = 2;

    @Transient
    @ApiParam("工单类型")
    private Integer woType;

    @Transient
    @ApiParam("子物料名称")
    private String itemPartNo;

    @Transient
    @ApiParam("数量")
    private long qty;

    @Transient
    @ApiParam("是否拆解件")
    private Integer isDisPart;

    public MesQueueJitActualDetail() {

    }

    public MesQueueJitActualDetail(String partNo, String itemPartNo, long qty) {
        this.partNo = partNo;
        this.itemPartNo = itemPartNo;
        this.qty = qty;
    }
}
