package com.uas.platform.b2b.erp.model;

import com.uas.platform.b2b.model.Enterprise;
import com.uas.platform.b2b.model.Vendor; /**
 * Created by dongbw
 * 17/07/12 17:22.
 */
public class B2BVendor {

    /**
     * id
     */
    private Integer ve_id;

    /**
     * 供应商编号
     */
    private String ve_code;

    /**
     * 供应商名称
     */
    private String ve_name;

    /**
     * 供应商地址
     */
    private String ve_add1;

    /**
     * 供应商联系人
     */
    private String ve_contact;

    /**
     * 供应商电话
     */
    private String ve_tel;

    /**
     * 供应商简称
     */
    private String ve_shortname;

    /**
     * 是否启用b2b
     */
    private Short ve_b2benable;

    /**
     * 营业执照号
     */
    private String ve_webserver;

    /**
     * 供应商uu
     */
    private String ve_uu;

    /**
     * 供应商邮箱
     */
    private String ve_email;

    /**
     * B2B vendorId
     */
    private Long b2b_vendor_id;

    /**
     * 供应商开关
     */
    private Short vendorSwitch;

    /**
     * 服务商开关
     */
    private Short servicerSwitch;

    /**
     * 经营范围
     */
    private String ve_businessrange;

    /**
     * 行业
     */
    private String ve_industry;

    public B2BVendor(Vendor vendor) {
        this.setB2b_vendor_id(vendor.getId());
        this.setVendorSwitch(vendor.getVendswitch());
        this.setServicerSwitch(vendor.getServicerswitch());
        if (vendor.getVendorEnterprise() != null) {
            this.setVe_name(vendor.getVendorEnterprise().getEnName());
            this.setVe_add1(vendor.getVendorEnterprise().getEnAddress());
            this.setVe_shortname(vendor.getVendorEnterprise().getEnShortname());
            this.setVe_webserver(vendor.getVendorEnterprise().getEnBussinessCode());
            this.setVe_tel(vendor.getVendorEnterprise().getEnTel());
            this.setVe_industry(vendor.getVendorEnterprise().getProfession());
            this.setVe_businessrange(vendor.getVendorEnterprise().getTags());
        }
        this.setVe_uu(String.valueOf(vendor.getVendEnUU()));
        if (vendor.getVendorUser() != null) {
            this.setVe_contact(vendor.getVendorUser().getUserName());
            this.setVe_email(vendor.getVendorUser().getUserEmail());
        }
    }

    public B2BVendor(Enterprise vendor) {
        this.setVe_name(vendor.getEnName());
        this.setVe_add1(vendor.getEnAddress());
        this.setVe_shortname(vendor.getEnShortname());
        this.setVe_webserver(vendor.getEnBussinessCode());
        this.setVe_tel(vendor.getEnTel());
        this.setVe_industry(vendor.getProfession());
        this.setVe_businessrange(vendor.getTags());
        this.setVe_uu(String.valueOf(vendor.getUu()));
        if (vendor.getAdmin() != null) {
            this.setVe_contact(vendor.getAdmin().getUserName());
            this.setVe_email(vendor.getAdmin().getUserEmail());
        }
    }

    public Integer getVe_id() {
        return ve_id;
    }

    public void setVe_id(Integer ve_id) {
        this.ve_id = ve_id;
    }

    public String getVe_code() {
        return ve_code;
    }

    public void setVe_code(String ve_code) {
        this.ve_code = ve_code;
    }

    public String getVe_name() {
        return ve_name;
    }

    public void setVe_name(String ve_name) {
        this.ve_name = ve_name;
    }

    public String getVe_add1() {
        return ve_add1;
    }

    public void setVe_add1(String ve_add1) {
        this.ve_add1 = ve_add1;
    }

    public String getVe_contact() {
        return ve_contact;
    }

    public void setVe_contact(String ve_contact) {
        this.ve_contact = ve_contact;
    }

    public String getVe_tel() {
        return ve_tel;
    }

    public void setVe_tel(String ve_tel) {
        this.ve_tel = ve_tel;
    }

    public String getVe_shortname() {
        return ve_shortname;
    }

    public void setVe_shortname(String ve_shortname) {
        this.ve_shortname = ve_shortname;
    }

    public Short getVe_b2benable() {
        return ve_b2benable;
    }

    public void setVe_b2benable(Short ve_b2benable) {
        this.ve_b2benable = ve_b2benable;
    }

    public String getVe_webserver() {
        return ve_webserver;
    }

    public void setVe_webserver(String ve_webserver) {
        this.ve_webserver = ve_webserver;
    }

    public String getVe_uu() {
        return ve_uu;
    }

    public void setVe_uu(String ve_uu) {
        this.ve_uu = ve_uu;
    }

    public Long getB2b_vendor_id() {
        return b2b_vendor_id;
    }

    public void setB2b_vendor_id(Long b2b_vendor_id) {
        this.b2b_vendor_id = b2b_vendor_id;
    }

    public Short getVendorSwitch() {
        return vendorSwitch;
    }

    public void setVendorSwitch(Short vendorSwitch) {
        this.vendorSwitch = vendorSwitch;
    }

    public Short getServicerSwitch() {
        return servicerSwitch;
    }

    public void setServicerSwitch(Short servicerSwitch) {
        this.servicerSwitch = servicerSwitch;
    }

    public String getVe_email() {
        return ve_email;
    }

    public void setVe_email(String ve_email) {
        this.ve_email = ve_email;
    }

    public String getVe_businessrange() {
        return ve_businessrange;
    }

    public void setVe_businessrange(String ve_businessrange) {
        this.ve_businessrange = ve_businessrange;
    }

    public String getVe_industry() {
        return ve_industry;
    }

    public void setVe_industry(String ve_industry) {
        this.ve_industry = ve_industry;
    }
}
