package com.sw.mes.stocktaking;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * 实物盘账的Entity
 *
 * @Author：wanjia
 * @Date：2024/3/15 08:51
 */
@Entity
@Table(name = "wip_storage_stocktaking")
@DynamicUpdate
@DynamicInsert
@Data
public class Stocktaking {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ExcelIgnore
    private Long id;

    /**
     * 导出时是用，不写到数据库里
     */
    @Transient
    @ExcelProperty(value = "序号")
    private Long no;

    /**
     * 晶编号（SN）
     */
    @Column(length = 100)
    @ExcelProperty(value = "晶编号")
    private String sectionNo;

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

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

    /**
     * 等级
     */
    @Column(length = 100)
    @ExcelProperty(value = "产品等级")
    private String productLevel;

    /**
     * 物料编号
     */
    @Column(length = 100)
    @ExcelProperty(value = "物料编号")
    private String materialCode;

    /**
     * 物料类型名称
     */
    @Column(length = 100)
//    @ExcelProperty(value = "物料类型")
    @ExcelIgnore
    private String materialType;

    /**
     * 操作人
     */
    @Column(length = 100)
    @ExcelProperty(value = "操作人")
    private String username;

    /**
     * 记录时间
     */
    @Column(length = 19)
    @ExcelProperty(value = "记录时间")
    @Temporal(TemporalType.TIMESTAMP)
    private Date gmtCreate;


    /**
     * 所在站点
     */
    @ExcelProperty(value = "所在站点")
    @Column(length = 100)
    private String wipStorageStation;
}
