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 : 2018-11-07 14:21
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name="BAS_VENDOR")
@Api("供应商信息")
public class BasVendor extends BaseBean{

    private static final long serialVersionUID = 9214639813072592779L;
    @Column(name="VENDOR_NO")
    @ApiParam("供应商编号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String vendorNo;

    @Column(name="VENDOR_NAME")
    @ApiParam("供应商简称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String vendorName;

    @Column(name="VENDOR_DESC")
    @ApiParam("供应商全称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String vendorDesc;

    @Column(name = "USER_NAME")
    @ApiParam("用户名")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST,  getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.URL,
            dataSrc = "/impp/operate/sys-user/query-user-by-pager",
            searchColumnName = "userName",listColumnName = "userLoginName,userName", explicitColumnName = "userName")
    private String userName;

    @Column(name="VENDOR_ADDR")
    @ApiParam("供应商地址")
    private String vendorAddr;

    @Column(name="VENDOR_OWNER")
    @ApiParam("联系人")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String vendorOwner;

    @Column(name="VENDOR_EMAIL")
    @ApiParam("邮箱")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String vendorEmail;

    @Column(name = "IS_ASN")
    @ApiParam(value = "是否发ASN", example = "0")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, dataSrc = "TRUE_OR_FALSE")
    private Integer isAsn;

    @Column(name = "PASSWORD")
    @ApiParam(value = "密码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String password;

    @Column(name = "VENDOR_CALL")
    @ApiParam("供应商电话")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String vendorCall;

    @Column(name = "VENDOR_FAX")
    @ApiParam("传真")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String vendorFax;

    @Column(name = "VENDOR_PHONE")
    @ApiParam("手机")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String vendorPhone;

    @Column(name = "KILOBIT")
    @ApiParam("千位符号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String kilobit;

    @Column(name = "DECIMALS")
    @ApiParam("小数位符号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String decimals;

    @Column(name = "VENDOR_TYPE")
    @ApiParam("供应商类型")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, dataSrc = "VENDOR_TYPE")
    private Integer vendorType;

    @Column(name = "MAP_LOCATION")
    @ApiParam("经纬度")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String mapLocation;

    public BasVendor() {
    }

    public BasVendor(Long id,String userName) {
        this.id = id;
        this.userName = userName;
    }
}