/**
 * There are <a href="https://github.com/ketayao/keta-custom">keta-custom</a> code generation
 */
package com.sw.mes.yb.production.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author
 * @Description：
 * @Date: Create in
 * @Modified By:
 */
@Data
@Entity
@Table(name = "production_long_crystal")
@DynamicUpdate
@DynamicInsert
@ToString
public class LongCrystal {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 单晶编号
     */
    @Column(length = 50)
    private String crystalNo;

    /**
     * 批次号
     */
    @Column(length = 20)
    private String batchNo;

    /**
     * 设备号
     */
    @Column(length = 100)
    private String equipmentCode;

    /**
     * 炉次号
     */
    @Column(length = 100)
    private String lotNo;

    /**
     * 炉次ID(plan_processing_order.id)
     */
    private Long lotId;

    /**
     * 所属系列
     */
    @Column(length = 50)
    private String series;

    /**
     * 所属模块
     */
    @Column(length = 50)
    private String area;

    /**
     * 收尾方式
     */
    @Column(length = 50)
    private String windUp;

    /**
     * 复投次数
     */
    @Column(length = 10)
    private Integer againNum;

    /**
     * 炉数
     */
    @Column(length = 10)
    private Integer lotTimes;

    /**
     * 单晶颗数
     */
    @Column(length = 10)
    private Integer crystalNum;

    /**
     * 重量
     */
    @Column(length = 19)
    private BigDecimal weight;

    /**
     * 满锅重量
     */
    @Column(length = 19)
    private BigDecimal fullPotWeight;

    /**
     * 长度
     */
    @Column(length = 19)
    private BigDecimal length;

    /**
     * 状态【0：默认；0-未送验；1-绑定送验车；2-已送验(呼叫AGV);3-已退料;9-待确认; 4-异常（不流向送验绑定工步）;5-已划线】
     */
    @Column(nullable = false, length = 3)
    private Integer crystalStatus;

    /**
     * 炉台类型【0:默认；0-量产;1-在建;2-研发;】
     */
    @Column(nullable = false, length = 3)
    private Integer furnaceType;

    /**
     * 料号
     */
    @Column(length = 100)
    private String productCode;

    /**
     * 料号名称
     */
    @Column(length = 100)
    private String productName;

    /**
     * 产品等级
     */
    @Column(length = 50)
    private String productGrade;

    /**
     * 规格
     */
    @Column(length = 50)
    private String specs;

    /**
     * 订单号
     */
    @Column(length = 50)
    private String orderNo;

    /**
     * 产出确认订单号
     */
    @Column(length = 50)
    private String advanceOrder;

    /**
     * 订单类型
     */
    @Column(length = 50)
    private String orderType;

    /**
     * 掺杂剂
     */
    @Column(length = 10)
    private String dopant;

    /**
     * 产品简称
     */
    @Column(length = 10)
    private String simpleName;

    /**
     * 产品类别
     */
    @Column(length = 50)
    private String productType;

    // 单晶产出异常 一级
    @Column(length = 50)
    private String crystalErrorLevelOne;

    // 单晶产出异常 二级
    @Column(length = 50)
    private String crystalErrorLevelTwo;

    // 订单号id
    @Column(length = 32)
    private Long orderId;

    // 生产工单id
    @Column(length = 32)
    private Long scheduleId;

    // 投料量
    @Column(length = 32)
    private Integer feedingCount;


    @Column(length = 32)
    private String userCreate;

    @Column(length = 32)
    private String userUpdate;

    @Column(nullable = false, length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date gmtCreate;

    @Column(nullable = false, length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date gmtUpdate;

    /**
     *创建时间(增加时长)
     */
    @Column(nullable = false, length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date gmtCreateAdd;

    /**
     * 导电型号/型号(P/N)
     */
    @Column(length = 40)
    private String conductiveType;

    /**
     * 送验任务编号
     **/
    @Column(length = 50)
    private String agvTaskCode;

    /**
     * 是否确认信息
     **/
    @Column(length = 50)
    private Boolean confirmInfo;

    /**
     * 头长
     */
    @Column(length = 10)
    private BigDecimal headLen;

    /**
     * 尾长
     */
    @Column(length = 10)
    private BigDecimal tailLen;
    /**
     * 最大直径
     */
    private BigDecimal maxDiam;
    /**
     * 最小直径
     */
    private BigDecimal minDiam;

    /**
     * 圆棒计划工单
     */
    @Column(length = 50)
    private String ybWorkOrder;

    /**
     * 上月订单号
     */
    @Column
    private String lastOrderNo;

    /**
     * 上月订单类型
     */
    @Column
    private String lastOrderType;

    // 上月订单号id
    @Column
    private Long lastOrderId;

    //划线开始时间
    @Column
    private Date lineStartTime;

    //等径长度
    @Column(length = 10)
    private BigDecimal isometricLength;

    /**
     * 是否完结(0未完结，1完结复投）
     */
    @Column(length = 2)
    private Integer isDone = 0;

    /**
     * 是否为单晶(0：否，1：是）
     */
    @Column(length = 2)
    private Integer isCrystal = 1;

    /**
     * 完结标识:
     * W 完结尾
     * V 完结棒
     */
    @Column(length = 50)
    private String closureIdentification;

    @Column(length = 50)
    private String sideLengthRange;

    private BigDecimal lastWeight;

    @ApiModelProperty(value = "车间")
    private String workShop;

    @ApiModelProperty(value = "基地")
    private String baseMark;
    /**
     * 溯源标识
     */
    @ApiModelProperty(value = "溯源标识")
    @Column(length = 50)
    private String fromMark;
    /**
     * 产品类型
     */
    @Column(length = 50)
    private String productCategory;

    @ApiModelProperty(value = "发料编码")
    String deliveryNo;

    @ApiModelProperty(value = "是否上报erp 0 未上报，1已上报【圆棒订单】")
    @Column(length = 2)
    private Integer pushed = 0;

    @ApiModelProperty(value = "是否上报erp 0 未上报，1已上报【方棒订单】")
    @Column(length = 2)
    private Integer squarePushed = 0;

    @ApiModelProperty(value = "是否拉取 0 未拉取，1已拉取【圆棒订单】")
    @Column(length = 2)
    private Integer rodPulled = 0;

    @ApiModelProperty(value = "是否拉取 0 未拉取，1已拉取【方棒订单】")
    @Column(length = 2)
    private Integer squarePulled = 0;

    /**
     * 棒次时间
     */
    @Column(length = 10)
    private BigDecimal rodProductionTime;

    /**
     *产出确认时间
     */
    @Column(nullable = false, length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date outputConfirmationTime;

    /**
     * 划线上报状态：0：默认值，未进行划线；1：已上报SAP
     */
    private Integer reportStatus;

    /**
     * 划线记录删除时间
     */
    private Date deleteTime;

    /**
     * 取晶车任务编号
     **/
    @Column(length = 50)
    private String takeCrystalAgvTaskCode;

    /**
     * 自动取晶响应
     **/
    @Column(length = 50)
    private String takeCrystalAgvTaskMsg;

    /**
     * 取晶车任务状态1运行中2运行至目标炉台5已取消9已结束
     **/
    @Column(length = 5)
    private Integer crystalAgvTaskState;

    /**
     * 呼叫取晶时间
     */
    @Column(nullable = false, length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date takeCrystalTime;

    /**
     * 是否呼叫取晶车0未呼叫1人工呼叫2自动呼叫
     */
    @Column(nullable = false, length = 19)
    private Integer hasCall;

    /**
     * 引晶埚转
     */
    @Column(length = 10)
    private BigDecimal crystalCrucibleRotation;

    public LongCrystal() {
    }

    public LongCrystal(Long id) {
        this.id = id;
    }
}
