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

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

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @Description : 供应商零件关系
 * @Reference :
 * @Author : amy
 * @CreateDate : 2019-06-11 13:47
 * @Modify:
 **/
@Data
@Entity
@Table(name = "WMS_VENDOR_PART")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value = "供应商零件关系", description = "供应商零件关系")
public class WmsVendorPart extends BaseBean {

    private static final long serialVersionUID = 7339520734918140529L;
    @Column(name = "VENDOR_NO")
    @ApiParam(value = "供应商编号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.BasVendor",
            searchColumnName = "vendorNo,vendorName", listColumnName = "vendorNo,vendorName", explicitColumnName = "vendorNo")
    private String vendorNo;

    @Column(name = "PART_NO")
    @ApiParam(value = "物料号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsPart",
            searchColumnName = "partNo,partName", listColumnName = "partNo,partName", explicitColumnName = "partNo")
    private String partNo;

    @Column(name = "VENDOR_PART_NO")
    @ApiParam(value = "供应商物料号")
    private String vendorPartNo;

    @Column(name = "MAX_AMOUNT")
    @ApiParam(value = "供应商月提供最大数量")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
    private Double maxAmount;

    @Column(name = "PART_NO_NAME")
    @ApiParam("物料名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsPart",
            searchColumnName = "partNo,partName", listColumnName = "partNo,partName", explicitColumnName = "partName")
    private String partName;

    @Column(name = "VENDOR_NAME")
    @ApiParam("供应商名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.BasVendor",
            searchColumnName = "vendorNo,vendorName", listColumnName = "vendorNo,vendorName", explicitColumnName = "vendorName")
    private String vendorName;
}
