package com.uas.finance.erp.model;

import com.uas.finance.model.*;
import com.uas.finance.util.CollectionUtils;
import com.uas.finance.util.DateUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by hejq on 2017-12-21.
 */
public class CustInfo {

    /**
     * ID
     */
    private Long id;

    /**
     * 公司中文名
     */
    private String cu_name;

    /**
     * 公司英文名
     */
    private String cu_engname;

    /**
     * 公司类型
     */
    private String cu_enterptype;

    /**
     * 成立时间
     */
    private String cu_licensedate;

    /**
     * 证件类型
     */
    private String cu_paperstype;

    /**
     * 机构类型
     */
    private String cu_institutype;

    /**
     * 证件号码
     */
    private String cu_paperscode;

    /**
     * 证件到期日
     */
    private String cu_ctfduedate;

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

    /**
     * 国标行业分类
     */
    private String cu_nastdinducls;

    /**
     * 注册资本币种
     */
    private String cu_capcurrency;

    /**
     * 注册资本
     */
    private Double cu_regcapital;

    /**
     * 实缴资本
     */
    private Double cu_paidincapital;
    /**
     * 公司注册地
     */
    private String cu_regadd;
    /**
     * 办公地址
     */
    private String cu_officeadd;

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

    /**
     * 其他情况说明
     */
    private String cu_others;

    /**
     * 企业uu
     *
     * @return
     */
    private Long cu_enuu;

    /**
     * 最高权力机构
     *
     * @return
     */
    private String cu_highestauthority;

    /**
     * 员工人数
     *
     * @return
     */
    private Long cu_employeesnum;

    /**
     * 部门设置概况
     *
     * @return
     */
    private String cu_departsituation;


    /**
     * 财务数据表
     */
    private List<AccountInfo> accountInfoList;

    /**
     * 关联企业
     */
    private List<AssociateCompanyInfo> associateCompanies;

    /**
     * 情况描述
     */
    private BusinessConditionInfo businessCondition;

    /**
     * 变更内容
     */
    private List<ChangesInstructionInfo> changesInstructions;

    /**
     * 管理层信息
     */
    private List<CustomerExcutiveInfo> customerExcutives;

    /**
     * 财务情况说明
     */
    private FinanceConditionInfo financeConditions;

    /**
     * 买方客户资料
     */
    private List<PurcCustInfo> mfCustInfos;

    /**
     * 经营情况表
     */
    private List<ProductMixInfo> productMixes;

    /**
     * 股东信息表
     */
    private List<ShareholdersInfo> shareholders;

    /**
     * 供应商客户
     */
    private List<UpdowncastInfo> updowncasts;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCu_name() {
        return cu_name;
    }

    public void setCu_name(String cu_name) {
        this.cu_name = cu_name;
    }

    public String getCu_engname() {
        return cu_engname;
    }

    public void setCu_engname(String cu_engname) {
        this.cu_engname = cu_engname;
    }

    public String getCu_enterptype() {
        return cu_enterptype;
    }

    public void setCu_enterptype(String cu_enterptype) {
        this.cu_enterptype = cu_enterptype;
    }

    public String getCu_licensedate() {
        return cu_licensedate;
    }

    public void setCu_licensedate(String cu_licensedate) {
        this.cu_licensedate = cu_licensedate;
    }

    public String getCu_paperstype() {
        return cu_paperstype;
    }

    public void setCu_paperstype(String cu_paperstype) {
        this.cu_paperstype = cu_paperstype;
    }

    public String getCu_institutype() {
        return cu_institutype;
    }

    public void setCu_institutype(String cu_institutype) {
        this.cu_institutype = cu_institutype;
    }

    public String getCu_paperscode() {
        return cu_paperscode;
    }

    public void setCu_paperscode(String cu_paperscode) {
        this.cu_paperscode = cu_paperscode;
    }

    public String getCu_ctfduedate() {
        return cu_ctfduedate;
    }

    public void setCu_ctfduedate(String cu_ctfduedate) {
        this.cu_ctfduedate = cu_ctfduedate;
    }

    public String getCu_businesscode() {
        return cu_businesscode;
    }

    public void setCu_businesscode(String cu_businesscode) {
        this.cu_businesscode = cu_businesscode;
    }

    public String getCu_nastdinducls() {
        return cu_nastdinducls;
    }

    public void setCu_nastdinducls(String cu_nastdinducls) {
        this.cu_nastdinducls = cu_nastdinducls;
    }

    public String getCu_capcurrency() {
        return cu_capcurrency;
    }

    public void setCu_capcurrency(String cu_capcurrency) {
        this.cu_capcurrency = cu_capcurrency;
    }

    public Double getCu_regcapital() {
        return cu_regcapital;
    }

    public void setCu_regcapital(Double cu_regcapital) {
        this.cu_regcapital = cu_regcapital;
    }

    public Double getCu_paidincapital() {
        return cu_paidincapital;
    }

    public void setCu_paidincapital(Double cu_paidincapital) {
        this.cu_paidincapital = cu_paidincapital;
    }

    public String getCu_regadd() {
        return cu_regadd;
    }

    public void setCu_regadd(String cu_regadd) {
        this.cu_regadd = cu_regadd;
    }

    public String getCu_officeadd() {
        return cu_officeadd;
    }

    public void setCu_officeadd(String cu_officeadd) {
        this.cu_officeadd = cu_officeadd;
    }

    public String getCu_businsscope() {
        return cu_businsscope;
    }

    public void setCu_businsscope(String cu_businsscope) {
        this.cu_businsscope = cu_businsscope;
    }

    public String getCu_others() {
        return cu_others;
    }

    public void setCu_others(String cu_others) {
        this.cu_others = cu_others;
    }

    public Long getCu_enuu() {
        return cu_enuu;
    }

    public void setCu_enuu(Long cu_enuu) {
        this.cu_enuu = cu_enuu;
    }

    public String getCu_highestauthority() {
        return cu_highestauthority;
    }

    public void setCu_highestauthority(String cu_highestauthority) {
        this.cu_highestauthority = cu_highestauthority;
    }

    public Long getCu_employeesnum() {
        return cu_employeesnum;
    }

    public void setCu_employeesnum(Long cu_employeesnum) {
        this.cu_employeesnum = cu_employeesnum;
    }

    public String getCu_departsituation() {
        return cu_departsituation;
    }

    public void setCu_departsituation(String cu_departsituation) {
        this.cu_departsituation = cu_departsituation;
    }

    public List<AccountInfo> getAccountInfoList() {
        return accountInfoList;
    }

    public void setAccountInfoList(List<AccountInfo> accountInfoList) {
        this.accountInfoList = accountInfoList;
    }

    public List<AssociateCompanyInfo> getAssociateCompanies() {
        return associateCompanies;
    }

    public void setAssociateCompanies(List<AssociateCompanyInfo> associateCompanies) {
        this.associateCompanies = associateCompanies;
    }

    public BusinessConditionInfo getBusinessCondition() {
        return businessCondition;
    }

    public void setBusinessCondition(BusinessConditionInfo businessCondition) {
        this.businessCondition = businessCondition;
    }

    public List<ChangesInstructionInfo> getChangesInstructions() {
        return changesInstructions;
    }

    public void setChangesInstructions(List<ChangesInstructionInfo> changesInstructions) {
        this.changesInstructions = changesInstructions;
    }

    public List<CustomerExcutiveInfo> getCustomerExcutives() {
        return customerExcutives;
    }

    public void setCustomerExcutives(List<CustomerExcutiveInfo> customerExcutives) {
        this.customerExcutives = customerExcutives;
    }

    public FinanceConditionInfo getFinanceConditions() {
        return financeConditions;
    }

    public void setFinanceConditions(FinanceConditionInfo financeConditions) {
        this.financeConditions = financeConditions;
    }

    public List<PurcCustInfo> getMfCustInfos() {
        return mfCustInfos;
    }

    public void setMfCustInfos(List<PurcCustInfo> mfCustInfos) {
        this.mfCustInfos = mfCustInfos;
    }

    public List<ProductMixInfo> getProductMixes() {
        return productMixes;
    }

    public void setProductMixes(List<ProductMixInfo> productMixes) {
        this.productMixes = productMixes;
    }

    public List<ShareholdersInfo> getShareholders() {
        return shareholders;
    }

    public void setShareholders(List<ShareholdersInfo> shareholders) {
        this.shareholders = shareholders;
    }

    public List<UpdowncastInfo> getUpdowncasts() {
        return updowncasts;
    }

    public void setUpdowncasts(List<UpdowncastInfo> updowncasts) {
        this.updowncasts = updowncasts;
    }

    public CustInfo(com.uas.finance.model.CustomerInfo info) {
        this.cu_businesscode = info.getCu_businesscode();
        this.cu_businsscope = info.getCu_businsscope();
        this.cu_capcurrency = info.getCu_capcurrency();
        this.cu_ctfduedate = info.getCu_ctfduedate() == null ? null : DateUtils.DateInfo(info.getCu_ctfduedate());
        this.cu_departsituation = info.getCu_departsituation();
        this.cu_employeesnum = info.getCu_employeesnum();
        this.cu_engname = info.getCu_engname();
        this.cu_enterptype = info.getCu_enterptype();
        this.cu_highestauthority = info.getCu_highestauthority();
        this.cu_institutype = info.getCu_institutype();
        this.cu_licensedate = info.getCu_licensedate() == null ? null : DateUtils.DateInfo(info.getCu_licensedate());
        this.cu_name = info.getCu_name();
        this.cu_nastdinducls = info.getCu_nastdinducls();
        this.cu_officeadd = info.getCu_officeadd();
        this.cu_others = info.getCu_others();
        this.cu_paidincapital = info.getCu_paidincapital();
        this.cu_paperscode = info.getCu_paperscode();
        this.cu_paperstype = info.getCu_paperstype();
        this.cu_regadd = info.getCu_regadd();
        this.cu_regcapital = info.getCu_regcapital();
        this.cu_enuu = info.getEnuu();
        this.id = info.getId();
        if (null != info.getFinanceCondition()) {
            FinanceConditionInfo financeConditionInfo = new FinanceConditionInfo(info.getFinanceCondition());
            this.financeConditions = financeConditionInfo;
        }
        if (!CollectionUtils.isEmpty(info.getAccountInfoList())) {
            List<AccountInfo> accountInfos = new ArrayList<AccountInfo>();
            for (com.uas.finance.model.AccountInfo accountInfo : info.getAccountInfoList()) {
                accountInfos.add(new AccountInfo(accountInfo));
            }
            this.accountInfoList = accountInfos;
        }
        if (!CollectionUtils.isEmpty(info.getAssociateCompanies())) {
            List<AssociateCompanyInfo> associateCompanyInfos = new ArrayList<AssociateCompanyInfo>();
            for (AssociateCompany company : info.getAssociateCompanies()) {
                associateCompanyInfos.add(new AssociateCompanyInfo(company));
            }
            this.associateCompanies = associateCompanyInfos;
        }

        if (!CollectionUtils.isEmpty(info.getChangesInstructions())) {
            List<ChangesInstructionInfo> changesInstructionInfos = new ArrayList<ChangesInstructionInfo>();
            for (ChangesInstruction instruction : info.getChangesInstructions()) {
                changesInstructionInfos.add(new ChangesInstructionInfo(instruction));
            }
            this.changesInstructions = changesInstructionInfos;
        }
        if (!CollectionUtils.isEmpty(info.getCustomerExcutives())) {
            List<CustomerExcutiveInfo> excutiveInfos = new ArrayList<CustomerExcutiveInfo>();
            for (CustomerExcutive excutive : info.getCustomerExcutives()) {
                excutiveInfos.add(new CustomerExcutiveInfo(excutive));
            }
            this.customerExcutives = excutiveInfos;
        }

        if (null != info.getBusinessCondition()) {
            BusinessConditionInfo conditionInfo = new BusinessConditionInfo(info.getBusinessCondition());
            this.businessCondition = conditionInfo;
        }
        if (!CollectionUtils.isEmpty(info.getMfCustInfos())) {
            List<PurcCustInfo> custInfos = new ArrayList<PurcCustInfo>();
            for (MFCustInfo custInfo : info.getMfCustInfos()) {
                custInfos.add(new PurcCustInfo(custInfo));
            }
            this.mfCustInfos = custInfos;
        }
        if (!CollectionUtils.isEmpty(info.getProductMixes())) {
            List<ProductMixInfo> mixInfos = new ArrayList<ProductMixInfo>();
            for (ProductMix productMix : info.getProductMixes()) {
                mixInfos.add(new ProductMixInfo(productMix));
            }
            this.productMixes = mixInfos;
        }
        if (!CollectionUtils.isEmpty(info.getShareholders())) {
            List<ShareholdersInfo> shareholdersInfos = new ArrayList<ShareholdersInfo>();
            for (com.uas.finance.model.Shareholders shareholders : info.getShareholders()) {
                shareholdersInfos.add(new ShareholdersInfo(shareholders));
            }
            this.shareholders = shareholdersInfos;
        }
        if (!CollectionUtils.isEmpty(info.getUpdowncasts())) {
            List<UpdowncastInfo> updowncastInfos = new ArrayList<UpdowncastInfo>();
            for (Updowncast updowncast : info.getUpdowncasts()) {
                updowncastInfos.add(new UpdowncastInfo(updowncast));
            }
            this.updowncasts = updowncastInfos;
        }
    }

}
