package com.sw.mes.agv.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * 复投 物料搭配方案 记录
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "zhxx_recharge_art_bag")
public class RechargeArtBag {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 设备名称
     */
    @Column(length = 40)
    private String deviceNo;

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

    /**
     * 物料信息详情
     */
    @Column
    private String techBomItem;

    /**
     * 预计复投时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date preSlingTime;

    /**
     * 当前复投状态
     */
    @Column(length = 40)
    private String slingState;

    /**
     * 复投桶数-呼叫桶数
     */
    @Column(length = 10)
    private Integer rechargeNum;

    /**
     * 复投重量-呼叫重量
     */
    @Column
    private Double rechargeWeight;

    /**
     * 已备料桶数-灌料桶数
     */
    @Column(length = 10)
    private Integer pareNum;

    /**
     * 已备料数量-灌料重量
     */
    @Column
    private Double pareWeight;

    /**
     * 剩料重量
     */
    @Column
    private Double leftWeight;

    /**
     * 初始炉内投料量
     */
    @Column
    private Double initWeight;

    /**
     * 实际复投桶数
     */
    @Column(length = 10)
    private Integer prepareNum;

    /**
     * 已复投重量-实际重量
     */
    @Column
    private Double preRechargeWeight;

    /**
     * 复投类型
     * 初始复投、复投
     */
    @Column
    private String rechargeType;

    /**
     * 区域
     */
    @Column(length = 80)
    private String area;

    /**
     * 设置总重量
     */
    @Column
    private Double setNum;

    /**
     * 重量设置时间
     */
    @Column(length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date numTime;

    /**
     * 搭配操作人
     */
    @Column
    private String mixUser;

    /**
     * 搭配操作时间
     */
    @Column(length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date mixTime;

    /**
     * 导电型号
     */
    @Column(length = 20)
    private String pn;

    /**
     * 复投次数
     */
    @Column
    private Integer rechargeTimes;

    @Column
    private String backoffReason;

    @Column
    private BigDecimal backoffWeight;


    public RechargeArtBag() {
    }

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

}
