/**
 * Node.java created on 2016年12月1日 下午2:12:05 by jiminghu
 */

package com.dgt.graphdemo.entity.fqz;

import com.google.gson.JsonObject;


import java.math.BigDecimal;
import java.util.*;

/**
 * 
 * @author: jiminghu
 * @since: 2016年12月1日
 */
public class Node extends CommonBean<Node> {

	/**
	 */
	private static final long serialVersionUID = -7436171504778022413L;
	private String ctype;
	private String ctsem;
	private String markSource;
	private BigDecimal impairmentAmount;

	private String id;

	private String weaverId;

	private String name;

	private String type;
	//新增一个存储人节点重复的字段
	private String roletype;

	private List<String> nebors;

	private Map<String,String> attr;

	private List<NodeAttr> attrs;

	private Boolean delete;

	private Boolean canEx;

	private String markStatus;
	private String markMess;
	private String markUser;

	private Date markDate;
	//欺诈时间
	private String markqzDate;
	private String markkyDate;
	private String isM6Send;
	private String markUserName;
	private String branchCode;



	private String handleCode;

	private boolean showOff=true;

    //模糊查询时展示的对象
	private List<Map<String,String>> singleProperties;

    //点扩展所展示的属性值
	private List<Map<String,String>> manyProperties;

	//查询类型
	private String entityType;

	//节点图片姓名
	private String imageName;
	//系统来源
	private String source;

	public String getRoletype() {
		return roletype;
	}

	public void setRoletype(String roletype) {
		this.roletype = roletype;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getImageName() {
		return imageName;
	}

	public void setImageName(String imageName) {
		this.imageName = imageName;
	}

	public String getEntityType() {
		return entityType;
	}

	public void setEntityType(String entityType) {
		this.entityType = entityType;
	}

	public List<Map<String, String>> getSingleProperties() {
		return singleProperties;
	}

	public void setSingleProperties(List<Map<String, String>> singleProperties) {
		this.singleProperties = singleProperties;
	}

	public List<Map<String, String>> getManyProperties() {
		return manyProperties;
	}

	public void setManyProperties(List<Map<String, String>> manyProperties) {
		this.manyProperties = manyProperties;
	}


	public String getBranchCode() {
		return branchCode;
	}

	public void setBranchCode(String branchCode) {
		this.branchCode = branchCode;
	}

	public String getHandleCode() {
		return handleCode;
	}

	public void setHandleCode(String handleCode) {
		this.handleCode = handleCode;
	}


	// 2018-4-4新增标注字段
	private String flag;// 类型   0： 系列案名称  1：人名称

	private String flagValue;// 值

	public String getMarkkyDate() {
		return markkyDate;
	}

	public String getMarkUserName() {
		return markUserName;
	}

	public void setMarkUserName(String markUserName) {
		this.markUserName = markUserName;
	}

	public void setMarkkyDate(String markkyDate) {
		this.markkyDate = markkyDate;
	}

	public String getMarkqzDate() {
		return markqzDate;
	}

	public void setMarkqzDate(String markqzDate) {
		this.markqzDate = markqzDate;
	}

	public String getIsM6Send() {
		return isM6Send;
	}

	public void setIsM6Send(String isM6Send) {
		this.isM6Send = isM6Send;
	}

	public BigDecimal getImpairmentAmount() {
		return impairmentAmount;
	}

	public void setImpairmentAmount(BigDecimal impairmentAmount) {
		this.impairmentAmount = impairmentAmount;
	}

	public String getMarkSource() {
		return markSource;
	}

	public void setMarkSource(String markSource) {
		this.markSource = markSource;
	}

	public String getCtype() {
		return ctype;
	}

	public void setCtype(String ctype) {
		this.ctype = ctype;
	}

	public String getCtsem() {
		return ctsem;
	}

	public void setCtsem(String ctsem) {
		this.ctsem = ctsem;
	}

	public boolean isShowOff() {
		return showOff;
	}

	public void setShowOff(boolean showOff) {
		this.showOff = showOff;
	}

	public Node(){}

	public List<NodeAttr> getAttrs() {
		return attrs;
	}

	public void setAttrs(List<NodeAttr> attrs) {
		this.attrs = attrs;
	}


	private int neborSize = 0;

	public Node(String id) {
		this.id = id;
		this.nebors = new ArrayList<String>();
		this.attr = new HashMap<String,String>();
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return the neibors
	 */
	public List<String> getNeibors() {
		return this.nebors;
	}

	public void addNeborNode(String id) {
		nebors.add(id);
		neborSize++;
	}


	/**
	 * @return the nebors
	 */
	public List<String> getNebors() {
		return nebors;
	}


	/**
	 * @param nebors the nebors to set
	 */
	public void setNebors(List<String> nebors) {
		this.nebors = nebors;
	}
	/**
	 * @return the neborSize
	 */
	public int getNeborSize() {
		return neborSize;
	}


	/**
	 * @param neborSize the neborSize to set
	 */
	public void setNeborSize(int neborSize) {
		this.neborSize = neborSize;
	}

	public JsonObject toJsonObject()
	{
		JsonObject n = new JsonObject();
		n.addProperty("id", this.id);
		n.addProperty("name", this.name);
		n.addProperty("type", this.type);
		for(String key:this.attr.keySet())
		{
			n.addProperty(key, this.attr.get(key));
		}

		return n;
	}


	/**
	 * @return the attr
	 */
	public Map<String, String> getAttr() {
		return attr;
	}


	/**
	 * @param attr the attr to set
	 */
	public void setAttr(Map<String, String> attr) {
		this.attr = attr;
	}

	public String getWeaverId() {
		return weaverId;
	}

	public void setWeaverId(String weaverId) {
		this.weaverId = weaverId;
	}

	/**
	 * @return the delete
	 */
	public Boolean getDelete() {
		return delete;
	}


	/**
	 * @param delete the delete to set
	 */
	public void setDelete(Boolean delete) {
		this.delete = delete;
	}


	/**
	 * @return the canEx
	 */
	public Boolean getCanEx() {
		return canEx;
	}


	/**
	 * @param canEx the canEx to set
	 */
	public void setCanEx(Boolean canEx) {
		this.canEx = canEx;
	}

	public String getMarkStatus() {
		return markStatus;
	}

	public void setMarkStatus(String markStatus) {
		this.markStatus = markStatus;
	}

	public String getMarkMess() {
		return markMess;
	}

	public void setMarkMess(String markMess) {
		this.markMess = markMess;
	}

	public String getMarkUser() {
		return markUser;
	}

	public void setMarkUser(String markUser) {
		this.markUser = markUser;
	}

	public Date getMarkDate() {
		return markDate;
	}

	public void setMarkDate(Date markDate) {
		this.markDate = markDate;
	}

	public String getFlag() {
		return flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	public String getFlagValue() {
		return flagValue;
	}

	public void setFlagValue(String flagValue) {
		this.flagValue = flagValue;
	}
}
