package com.zt.plat.module.qms.core.sampleflow;

import java.io.Serializable;
import java.util.List;

import cn.hutool.core.collection.CollUtil;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class SampleFlowNode implements Serializable {

	private static final long serialVersionUID = 7600634660596892065L;

	/** 当前流程节点key **/
	private String nodeKey;
	
	/** 当前流程节点名称 **/
	private String nodeName;
	
	/** 是否默认流程 **/
	private Boolean isDefault = false;
	
	/** 条件 **/
	private String condition;
	
	/** 流程节点排序 **/
	private Integer sort;
	
	/** 下级流程节点 **/
	private List<SampleFlowNode> nextFlowNodeList;
	
	/** 获取下级流程节点名称 **/
	public String getNextFlowNodeName() {
		StringBuilder sb = new StringBuilder();
		if (CollUtil.isNotEmpty(this.nextFlowNodeList)) {
			for (SampleFlowNode sampleFlowNode : nextFlowNodeList) {
				sb.append(sampleFlowNode.getNodeName()).append("、");
			}
			sb.delete(sb.length() - 1, sb.length());
		}
		return sb.toString();
	}
}
