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 14:50
 * @Modify:
 **/
@Data
@Entity
@Table(name="WMS_CUSTOMER_PART")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="客户零件关系表",description = "客户零件关系表")
public class WmsCustomerPart extends BaseBean {

    private static final long serialVersionUID = 3903166651913139058L;
    @Column(name = "CUSTOMER_CODE")
    @ApiParam(value = "客户代码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.BasCustomer",
            searchColumnName = "custNo,custDesc", listColumnName = "custNo,custDesc", explicitColumnName = "custNo")
    private String customerCode;

    @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 = "CUSTOMER_PART_NO")
    @ApiParam(value = "客户零件号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String customerPartNo;

    @Column(name = "CUSTOMER_DESC")
    @ApiParam(value = "客户全称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.BasCustomer",
            searchColumnName = "custNo,custDesc", listColumnName = "custNo,custDesc", explicitColumnName = "custDesc")
    private String custDesc;

    @Column(name = "PART_NAME")
    @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 = "partName")
    private String partName;
}
