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.util.Date;

/**
 * 物料搭配状态监控
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "monitor_equipment_charge")
public class MonitorEquipmentCharge {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

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

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

    /**
     * 搭配方案
     */
    @Column(length = 80)
    private String techBom;

    /**
     * 搭配方案详情
     */
    @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 = 40)
    private String equipmentState;

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

    /**
     * 库位编号
     */
    @Column(length = 40)
    private String storeCode;

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

    /**
     * 新增配料标识
     * 0未配料，1已配料
     */
    @Column
    private Integer sixInfo;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(length = 19)
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;

    public MonitorEquipmentCharge() {}

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