package com.uas.finance.erp.model;

import com.uas.finance.model.Attach;
import com.uas.finance.model.FinancingApply;
import com.uas.finance.util.CollectionUtils;
import com.uas.finance.util.DateUtils;

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

/**
 * 金融服务申请数据
 * 
 * @author hejq
 * @time 创建时间：2017年11月24日
 */
public class Apply {

	/**
	 * ID
	 */
	private Long id;

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

	/**
	 * 企业名
	 */
	private String fa_enname;

	/**
	 * 联系人
	 */
	private String fa_contact;

	/**
	 * 联系方式1
	 */
	private String fa_telphone;
	
	/**
	 * 联系方式2
	 */
	private String fa_phone;
	
	/**
	 * 申请金额
	 */
	private Long fa_appamount;
	
	/**
	 * 申请人
	 */
	private String fa_applyman;
	
	/**
	 * 申请日期
	 */
	private String fa_applydate;
	
	/**
	 * 申请得分
	 */
	private Double fa_score;
	
	/**
	 * 融资申请单号
	 */
	private String fa_busincode;
	
	/**
	 * 保理公司名称
	 */
	private String fa_facorpname;
	
	/**
	 * 保理公司
	 */
	private String fa_facorpcode;

	/**
	 * 客户信息表
	 */
	private CustInfo customerInfo;

	/**
	 * 附件
	 * @return
	 */
	private List<AttachInfo> attachList;

	public Long getId() {
		return id;
	}

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

	public Long getEnuu() {
		return enuu;
	}

	public void setEnuu(Long enuu) {
		this.enuu = enuu;
	}

	public String getFa_contact() {
		return fa_contact;
	}

	public void setFa_contact(String fa_contact) {
		this.fa_contact = fa_contact;
	}

	public String getFa_telphone() {
		return fa_telphone;
	}

	public void setFa_telphone(String fa_telphone) {
		this.fa_telphone = fa_telphone;
	}

	public String getFa_phone() {
		return fa_phone;
	}

	public void setFa_phone(String fa_phone) {
		this.fa_phone = fa_phone;
	}

	public Long getFa_appamount() {
		return fa_appamount;
	}

	public void setFa_appamount(Long fa_appamount) {
		this.fa_appamount = fa_appamount;
	}

	public String getFa_applyman() {
		return fa_applyman;
	}

	public void setFa_applyman(String fa_applyman) {
		this.fa_applyman = fa_applyman;
	}

	public String getFa_applydate() {
		return fa_applydate;
	}

	public void setFa_applydate(String fa_applydate) {
		this.fa_applydate = fa_applydate;
	}

	public Double getFa_score() {
		return fa_score;
	}

	public void setFa_score(Double fa_score) {
		this.fa_score = fa_score;
	}

	public String getFa_busincode() {
		return fa_busincode;
	}

	public void setFa_busincode(String fa_busincode) {
		this.fa_busincode = fa_busincode;
	}

	public String getFa_facorpname() {
		return fa_facorpname;
	}

	public void setFa_facorpname(String fa_facorpname) {
		this.fa_facorpname = fa_facorpname;
	}

	public String getFa_facorpcode() {
		return fa_facorpcode;
	}

	public void setFa_facorpcode(String fa_facorpcode) {
		this.fa_facorpcode = fa_facorpcode;
	}

	public CustInfo getCustomerInfo() {
		return customerInfo;
	}

	public void setCustomerInfo(CustInfo customerInfo) {
		this.customerInfo = customerInfo;
	}

	public List<AttachInfo> getAttachList() {
		return attachList;
	}

	public void setAttachList(List<AttachInfo> attachList) {
		this.attachList = attachList;
	}

	public String getFa_enname() {
		return fa_enname;
	}

	public void setFa_enname(String fa_enname) {
		this.fa_enname = fa_enname;
	}

	public Apply(FinancingApply apply) {
		this.id = apply.getId();
		this.enuu = apply.getEnuu();
		this.fa_appamount = apply.getFa_appamount();
		this.fa_applydate = apply.getFa_applydate() == null ? null : DateUtils.DateInfo(apply.getFa_applydate());
		this.fa_applyman = apply.getFa_applyman();
		this.fa_busincode = apply.getFa_busincode();
		this.fa_contact = apply.getFa_contact();
		this.fa_facorpcode = apply.getFa_facorpcode();
		this.fa_facorpname = apply.getFa_facorpname();
		this.fa_phone = apply.getFa_phone();
		this.fa_score = apply.getFa_score();
		this.fa_telphone = apply.getFa_telphone();
		this.fa_enname = apply.getFa_enname();
		if (null != apply.getCustomerInfo()) {
			CustInfo customerInfo = new CustInfo(apply.getCustomerInfo());
			this.customerInfo=customerInfo;
		}
		if (!CollectionUtils.isEmpty(apply.getAttachList())) {
			List<AttachInfo> attachs = new ArrayList<AttachInfo>();
			for (Attach attach : apply.getAttachList()) {
				attachs.add(new AttachInfo(attach));
			}
			this.attachList = attachs;
		}
	}

}
