package com.sw.mes.yb.pc.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * 领料详情
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name="zhxx_operate_picking_info_item")
public class PickingInfoItem {

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

    /**
     * 物料模型id
     **/
    @Column(length = 11)
    private Integer materialModelId;

    /**
     * 物料编码
     */
    @Column(length=80)
    private String materialCode;

    /**
     * 物料名称
     */
    @Column(length=80)
    private String materialName;

    /**
     * 规格
     */
    @Column(length=80)
    private String norms;

    /**
     * 数量
     */
    @Column(length=18)
    private BigDecimal count;

    /**
     * 单位
     */
    @Column(length=40)
    private String unit;

    @Column(length=19, updatable=false, insertable=false)
    private Long pickInfoId;

    @JsonIgnore
    @ManyToOne(fetch= FetchType.LAZY)
    @JoinColumn(name = "pickInfoId")
    private PickingInfo pickingInfo;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMaterialCode() {
        return materialCode;
    }

    public void setMaterialCode(String materialCode) {
        this.materialCode = materialCode;
    }

    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    public String getNorms() {
        return norms;
    }

    public void setNorms(String norms) {
        this.norms = norms;
    }

    public BigDecimal getCount() {
        return count;
    }

    public void setCount(BigDecimal count) {
        this.count = count;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public Long getPickInfoId() {
        return pickInfoId;
    }

    public void setPickInfoId(Long pickInfoId) {
        this.pickInfoId = pickInfoId;
    }

    public PickingInfo getPickingInfo() {
        return pickingInfo;
    }

    public void setPickingInfo(PickingInfo pickingInfo) {
        this.pickingInfo = pickingInfo;
    }

    public Integer getMaterialModelId() {
        return materialModelId;
    }

    public void setMaterialModelId(Integer materialModelId) {
        this.materialModelId = materialModelId;
    }
}
