package cn.estsh.i3plus.pojo.mes.bean;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @Description:
 * @Reference:
 * @Author: Crish
 * @CreateDate:2019-04-16-17:36
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_PART_SCHEDULE_BOM")
@Api("生产排程清单")
public class MesPartScheduleBom extends BaseBean implements Serializable {
    private static final long serialVersionUID = -1189509386674221628L;
    @Column(name = "PART_NO")
    @ApiParam("排程物料号")
    private String partNo;

    @Column(name = "ITEM_PART_NO")
    @ApiParam("关联物料号")
    private String itemPartNo;

    @Column(name = "ITEM_QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("用量")
    private Double itemQty;

    @Column(name = "SCHEDULE_TYPE")
    @ApiParam("排程类型")
    private Integer scheduleType;

    public double getItemQtyVal() {
        return this.itemQty == null ? 0.0d : this.itemQty;
    }

    public double getScheduletTypeVal() {
        return this.scheduleType == null ? 0 : this.scheduleType;
    }
}
