package com.uas.platform.b2b.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 审核流程节点
 * 
 * @author hejq
 * @time 创建时间：2017年3月15日
 */
@Entity
@Table(name = "office$flownode")
public class FlowNode implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "fn_id")
	private Long id;
	
	/**
	 * enuu
	 */
	@Column(name = "fn_enuu")
	private Long enuu;
	
	/**
	 * emcode
	 */
	@Column(name = "fn_emcode")
	private Long emcode;

	/**
	 * 审核人姓名
	 */
	@Column(name = "fn_emname")
	private String emname;

	/**
	 * 节点等级<br>
	 * 从0开始，数字越大等级越高(可能一个有很多相同的节点等级，因为一个节点可能会有几个人）<br>
	 * 0代表最低，不参与审核操作
	 */
	@Column(name = "fn_nodelev")
	private Integer nodelev;
	
	/**
	 * 审批流节点名称
	 */
	@Column(name = "fn_nodename")
	private String nodename;

	/**
	 * 是否是审核人<br>
	 * 1.是<br>
	 * 0.不是
	 */
	@Column(name = "fn_auditor")
	private Short auditor;
	
	/**
	 * 
	 * 先判断审核，再判断抄送
	 */
	@Column(name = "fn_iscopy")
	private Short iscopy;

	/**
	 * 审批流程
	 */
	@ManyToOne(cascade = CascadeType.ALL, optional = true)
	@JoinColumn(name = "fn_appid", nullable = false)
	private ApprovalFlow approvalflow;

	/**
	 * 职位、角色
	 */
	@Column(name = "fn_position")
	private String position;

	/**
	 * 审批条件最小值
	 * 
	 * @return
	 */
	@Column(name = "fn_minnum")
	private Integer minnum;

	/**
	 * 审批条件最大值
	 */
	@Column(name = "fn_maxnum")
	private Integer maxnum;

	/**
	 * 审批条件，类型
	 */
	@Column(name = "fn_genre")
	private Long genre;

	/**
	 * appname(方便查找)
	 * 
	 * @return
	 */
	@Column(name = "fn_appname")
	private String appname;

	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 Long getEmcode() {
		return emcode;
	}

	public void setEmcode(Long emcode) {
		this.emcode = emcode;
	}

	public Integer getNodelev() {
		return nodelev;
	}

	public void setNodelev(Integer nodelev) {
		this.nodelev = nodelev;
	}

	public String getNodename() {
		return nodename;
	}

	public void setNodename(String nodename) {
		this.nodename = nodename;
	}

	public Short getAuditor() {
		return auditor;
	}

	public void setAuditor(Short auditor) {
		this.auditor = auditor;
	}

	public Short getIscopy() {
		return iscopy;
	}

	public void setIscopy(Short iscopy) {
		this.iscopy = iscopy;
	}

	@JsonIgnore
	@JSONField(serialize = false)
	public ApprovalFlow getApprovalflow() {
		return approvalflow;
	}

	public void setApprovalflow(ApprovalFlow approvalflow) {
		this.approvalflow = approvalflow;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public Integer getMinnum() {
		return minnum;
	}

	public void setMinnum(Integer minnum) {
		this.minnum = minnum;
	}

	public Integer getMaxnum() {
		return maxnum;
	}

	public void setMaxnum(Integer maxnum) {
		this.maxnum = maxnum;
	}

	public Long getGenre() {
		return genre;
	}

	public void setGenre(Long genre) {
		this.genre = genre;
	}

	public String getAppname() {
		return appname;
	}

	public void setAppname(String appname) {
		this.appname = appname;
	}

	public String getEmname() {
		return emname;
	}

	public void setEmname(String emname) {
		this.emname = emname;
	}

}
