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 javax.persistence.Transient;
import java.io.Serializable;

/**
 * @Description :物料信息
 * @Reference :
 * @Author : jack.jia
 * @CreateDate : 2019-04-02
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_PART")
@Api("物料信息")
public class MesPart extends BaseBean implements Serializable {
    private static final long serialVersionUID = -7731182105899332283L;

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

    @Column(name = "PART_NAME")
    @ApiParam("零件名称")
    private String partName;

    @Column(name = "BRIEF_TEXT")
    @ApiParam("零件简称")
    private String briefText;

    @Column(name = "PART_SPEC")
    @ApiParam("零件规格")
    private String partSpec;

    @Column(name = "PART_SPEC_QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("标准包规数量")
    private Double partSpecQty = 0d;

    @Column(name = "CATEGORY_CODE1")
    @ApiParam("分类1")
    private String categoryCode1;

    @Column(name = "CATEGORY_CODE2")
    @ApiParam("分类2")
    private String categoryCode2;

    @Column(name = "CATEGORY_CODE3")
    @ApiParam("分类3")
    private String categoryCode3;

    @Column(name = "UNIT")
    @ApiParam("单位")
    private String unit;

    @Column(name = "PACK_SPEC_CODE")
    @ApiParam("包装规格代码")
    private String packSpecCode;

    @Column(name = "DEFAULT_WORK_CENTER")
    @ApiParam("默认工作中心")
    private String defaultWorkCenter;

    @Column(name = "PRODUCE_CTGY_CODE",columnDefinition = "default ''")
    @ApiParam("产品类型代码")
    private String produceCategoryCode;

    @Column(name = "PROCESS_MATCH_TYPE")
    @ApiParam("过程编码匹配类型")
    private Integer processMatchType = 0;

    @Column(name = "PACKAGE_MATCH_TYPE")
    @ApiParam("包装编码匹配类型")
    private Integer packageMatchType = 0;

    @Column(name = "PRODUCT_MATCH_TYPE")
    @ApiParam("产品编码匹配类型")
    private Integer productMatchType = 0;

    @Column(name = "PPT_CODE")
    @ApiParam("产品类型代码")
    private String pptCode;

    @Column(name = "PART_TRAIT")
    @ApiParam("物料特性")
    private Integer partTrait = 0;

    @Column(name = "COLOR_CODE")
    @ApiParam("颜色代码")
    private String colorCode;

    @Column(name = "COLOR_NAME")
    @ApiParam("颜色名称")
    private String colorName;

    @Column(name = "SHELVES_AMOUNT")
    @ApiParam("挂架数")
    private Integer shelvesAmount = 0;

    @Column(name = "QUANTITY_PER_RACK")
    @ApiParam("挂架可放零件数")
    private Integer quantityPerRack = 0;

    @Column(name = "PAINT_TANK_CODE")
    @ApiParam("供漆罐代码")
    private String paintTankCode;

    @Column(name = "PRE_PART_NO")
    @ApiParam("打磨件物料号")
    private String prePartNo;

    @Column(name = "IS_SMALL_SIZE")
    @ApiParam("是否小尺寸物料")
    private Integer isSmallSize = 1;

    @Column(name = "QTY2", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam(value = "包装数量")
    private Double qty2;

    @Transient
    @ApiParam("产品类型名称")
    private String produceCategoryName;

    @Transient
    @ApiParam("过程编码匹配类型名称")
    private String processMatchTypeName;

    @Transient
    @ApiParam("包装编码匹配类型")
    private String packageMatchTypeName;

    @Transient
    @ApiParam("产品编码匹配类型")
    private String productMatchTypeName;

    @Transient
    @ApiParam("分类名称")
    private String categoryName;

    @Transient
    @ApiParam("拉动数量")
    private Double pullQty;

    @Transient
    @ApiParam("BOM用量")
    private Double bomQty = 0d;

    @Transient
    @ApiParam("客户零件号")
    private String custPartNo;
}
