package cn.estsh.i3plus.pojo.wms.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;

/**
 * @Description : MES_生产计划主明细表
 * @Reference :
 * @Author : jessica.chen
 * @CreateDate : 2019-11-09 14:21
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="MES_PP_DETAILS")
@Api("MES_生产计划明细表")
public class MesPpDetails extends BaseBean{

    private static final long serialVersionUID = 9214639813072592727L;

    @Column(name="WROKORDER_NO")
    @ApiParam("工单号")
    private String woekorderNo;

    @Column(name="ITEM")
    @ApiParam("行号")
    private Integer item;

    @Column(name="PART_NO")
    @ApiParam("零件号")
    private String partNo;

    @Column(name="PART_NAME_RDD")
    @ApiParam("零件名称")
    private String partNameRdd;

    @Column(name = "QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam(value = "工单数量", example = "0")
    public Double qty;

    @Column(name = "TRANS_QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam(value = "处理数量", example = "0")
    public Double transQty = 0D;

    @Column(name="PART_GROUP_NO")
    @ApiParam("零件组号")
    public String partGroupNo;

    public Integer getItem() {
        return item == null ? 0 : this.item.intValue();
    }

    public Double getQty() {
        return qty == null ? 0D : this.qty.doubleValue();
    }
}