package com.trade.service.trade.purchasecontract.dto;

import cn.hutool.core.util.StrUtil;
import com.trade.service.enterprise.companyrelated.domain.VendorEntity;
import com.trade.service.enterprise.customer.domain.Enterprise;
import com.trade.service.enterprise.customer.domain.EnterpriseRelatedPerson;
import com.trade.service.tradingplatform.domain.TradingPlatform;

/**
 * 合同签署方信息
 */
public class SignPartyInfo {

    /**
     * 企业名称
     */
    private String enterpriseName;
    /**
     * 企业证件号码（社会统一信用代码）
     */
    private String enterpriseCertNo;
    /**
     * 企业联系人姓名
     */
    private String enterpriseContactName;
    /**
     * 企业联系人证件号
     */
    private String enterpriseContactCertNo;
    /**
     * 企业联系人手机号
     */
    private String enterpriseContactPhone;
    /**
     * 企业联系人邮箱
     */
    private String enterpriseContactEmail;
    /**
     * 企业联系人地址
     */
    private String enterpriseContactAddress;
    /**
     * 法人姓名
     */
    private String legalPersonName;
    /**
     * 法人证件号码
     */
    private String legalPersonCertNo;
    /**
     * 法人手机号
     */
    private String legalPersonPhone;
    /**
     * 法人邮箱
     */
    private String legalPersonEmail;
    /**
     * 银行名称（开户行）
     */
    private String openingBank;
    /**
     * 银行账号
     */
    private String bankAccountNo;
    /**
     * 银行账户名称
     */
    private String bankAccountName;

    /**
     * 构造函数
     * 
     * @param enterprise 企业信息
     * @param contactPerson 联系人信息
     * @param legalPerson 法人信息
     */
    public SignPartyInfo(Enterprise enterprise, EnterpriseRelatedPerson contactPerson,
            EnterpriseRelatedPerson legalPerson){
        this.enterpriseName = enterprise.getName();
        this.enterpriseCertNo = enterprise.getCertNo();
        this.enterpriseContactName = contactPerson.getName();
        this.enterpriseContactCertNo = contactPerson.getPersonalCertType();
        this.enterpriseContactPhone = contactPerson.getMobile();
        this.enterpriseContactEmail = contactPerson.getEmail();
        this.enterpriseContactAddress = StrUtil.isBlank(enterprise.getBusinessAddress())
                ? enterprise.getRegisterAddress()
                : enterprise.getBusinessAddress();
        this.legalPersonName = legalPerson.getName();
        this.legalPersonCertNo = legalPerson.getPersonalCertNo();
        this.legalPersonPhone = legalPerson.getMobile();
        this.legalPersonEmail = legalPerson.getEmail();
    }

    /**
     * 构造函数
     *
     * @param tradingPlatform 贸易平台信息
     */
    public SignPartyInfo(TradingPlatform tradingPlatform){
        this.enterpriseName = tradingPlatform.getPlatformName();
        this.enterpriseCertNo = tradingPlatform.getCertNo();
        this.enterpriseContactName = tradingPlatform.getContactName();
        this.enterpriseContactPhone = tradingPlatform.getContactMobile();
        this.enterpriseContactEmail = tradingPlatform.getContactEmail();
        this.enterpriseContactAddress = StrUtil.isBlank(tradingPlatform.getBusinessAddress())
                ? tradingPlatform.getRegisterAddress()
                : tradingPlatform.getBusinessAddress();
        this.legalPersonName = tradingPlatform.getLegalName();
        this.legalPersonCertNo = tradingPlatform.getLegalCertNo();
        this.legalPersonPhone = tradingPlatform.getLegalMobile();
        this.legalPersonEmail = tradingPlatform.getLegalEmail();
    }

    /**
     * 构造函数
     * 
     * @param vendor 供应商信息
     */
    public SignPartyInfo(VendorEntity vendor){
        this.enterpriseName = vendor.getEntityName();
        this.enterpriseCertNo = vendor.getCertNo();
        this.enterpriseContactName = vendor.getContactName();
        this.enterpriseContactPhone = vendor.getContactMobile();
        this.enterpriseContactEmail = vendor.getContactEmail();
        this.enterpriseContactAddress = vendor.getBusinessAddress();
        this.legalPersonName = vendor.getContactName();
        this.legalPersonCertNo = vendor.getContactCertNo();
        this.legalPersonPhone = vendor.getContactMobile();
        this.legalPersonEmail = vendor.getContactEmail();
    }

    public SignPartyInfo(){
    }

    public String getEnterpriseName() {
        return enterpriseName;
    }

    public void setEnterpriseName(String enterpriseName) {
        this.enterpriseName = enterpriseName;
    }

    public String getEnterpriseCertNo() {
        return enterpriseCertNo;
    }

    public void setEnterpriseCertNo(String enterpriseCertNo) {
        this.enterpriseCertNo = enterpriseCertNo;
    }

    public String getEnterpriseContactName() {
        return enterpriseContactName;
    }

    public void setEnterpriseContactName(String enterpriseContactName) {
        this.enterpriseContactName = enterpriseContactName;
    }

    public String getEnterpriseContactCertNo() {
        return enterpriseContactCertNo;
    }

    public void setEnterpriseContactCertNo(String enterpriseContactCertNo) {
        this.enterpriseContactCertNo = enterpriseContactCertNo;
    }

    public String getEnterpriseContactPhone() {
        return enterpriseContactPhone;
    }

    public void setEnterpriseContactPhone(String enterpriseContactPhone) {
        this.enterpriseContactPhone = enterpriseContactPhone;
    }

    public String getEnterpriseContactEmail() {
        return enterpriseContactEmail;
    }

    public void setEnterpriseContactEmail(String enterpriseContactEmail) {
        this.enterpriseContactEmail = enterpriseContactEmail;
    }

    public String getEnterpriseContactAddress() {
        return enterpriseContactAddress;
    }

    public void setEnterpriseContactAddress(String enterpriseContactAddress) {
        this.enterpriseContactAddress = enterpriseContactAddress;
    }

    public String getLegalPersonName() {
        return legalPersonName;
    }

    public void setLegalPersonName(String legalPersonName) {
        this.legalPersonName = legalPersonName;
    }

    public String getLegalPersonCertNo() {
        return legalPersonCertNo;
    }

    public void setLegalPersonCertNo(String legalPersonCertNo) {
        this.legalPersonCertNo = legalPersonCertNo;
    }

    public String getLegalPersonPhone() {
        return legalPersonPhone;
    }

    public void setLegalPersonPhone(String legalPersonPhone) {
        this.legalPersonPhone = legalPersonPhone;
    }

    public String getLegalPersonEmail() {
        return legalPersonEmail;
    }

    public void setLegalPersonEmail(String legalPersonEmail) {
        this.legalPersonEmail = legalPersonEmail;
    }

    public String getOpeningBank() {
        return openingBank;
    }

    public void setOpeningBank(String openingBank) {
        this.openingBank = openingBank;
    }

    public String getBankAccountNo() {
        return bankAccountNo;
    }

    public void setBankAccountNo(String bankAccountNo) {
        this.bankAccountNo = bankAccountNo;
    }

    public String getBankAccountName() {
        return bankAccountName;
    }

    public void setBankAccountName(String bankAccountName) {
        this.bankAccountName = bankAccountName;
    }
}
