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;

/**
 * @Description :
 * @Reference :
 * @Author : joke
 * @CreateDate : 2020-03-06 9:58 上午
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_QUEUE_JIT_PLAN_DETAIL", indexes = {
        @Index(columnList = "JIS_PLAN_NO"),
        @Index(columnList = "ORGANIZE_CODE"),
        @Index(columnList = "PRODUCE_CTGY_CODE"),
        @Index(columnList = "PART_NO")
})
@Api("MES_客户JIT预装队列明细")
public class MesQueueJitPlanDetail extends BaseBean implements Serializable {

    private static final long serialVersionUID = 1263996676519565026L;

    @Column(name = "JIS_PLAN_NO")
    @ApiParam("队列编号")
    private String jisPlanNo;

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

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

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

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

    @Column(name = "CUST_PART_NO")
    @ApiParam("客户物料号")
    private String custPartNo;

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

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

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

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

    public MesQueueJitPlanDetail() {

    }

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