package com.fourdage.dingding.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * 审批实例
 * @author ajay peng
 *
 */
public class ProcessInstance implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -3592333141742977489L;
	
	/**
	 * 审批实例id
	 */
	private String processInstanceId;
	
	/**
	 * 标题
	 */
	private String title;
	
	/**
	 * 开始时间
	 */
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;
	
	/**
	 * 结束时间
	 */
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	@Temporal(TemporalType.TIMESTAMP)
	private Date finishTime;
	
	/**
	 * 发起人userid
	 */
	private String originatorUserId;
	
	/**
	 * 发起人名称
	 */
	private String originatorUserName;
	
	/**
	 * 发起人部门id
	 */
	private String originatorDeptId;
	
	/**
	 * 审批状态，分为NEW（刚创建）|RUNNING（运行中）|TERMINATED（被终止）|COMPLETED（完成）|CANCELED（取消）
	 */
	private String status;
	
	/**
	 * 审批人列表
	 */
	private String[] approverUserIds;
	
	/**
	 * 抄送人列表
	 */
	private String[] ccUserIds;
	
	/**
	 * 审批结果，分为agree和refuse
	 */
	private String result;
	
	/**
	 * 流程实例业务编号
	 */
	private String businessId;
	
	/**
	 * 发起部门
	 */
	private String originatorDeptName;
	
	/**
	 * 审批实例业务动作,
	 * MODIFY表示该审批实例是基于原来的实例修改而来
	 * REVOKE表示该审批实例是由原来的实例撤销后重新发起的
	 * NONE表示正常发起
	 */
	private String bizAction;
	
	/**
	 * 审批附属实例列表，当已经通过的审批实例被修改或撤销，会生成一个新的实例，作为原有审批实例的附属。
	 * 如果想知道当前已经通过的审批实例的状态，可以依次遍历它的附属列表，查询里面每个实例的biz_action
	 */
	private String attachedProcessInstanceIds;
	
	/**
	 * 表单详情列表 
	 */
	private Set<FormComponentValue> formComponentValues;
	
	/**
	 * 操作记录列表
	 */
	private Set<OperationRecords> operationRecords;
	
	/**
	 * 任务列表
	 */
	private Set<TaskTop> tasks;

	public String getProcessInstanceId() {
		return processInstanceId;
	}

	public String getTitle() {
		return title;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public Date getFinishTime() {
		return finishTime;
	}

	public String getOriginatorUserId() {
		return originatorUserId;
	}

	public String getOriginatorDeptId() {
		return originatorDeptId;
	}

	public String getStatus() {
		return status;
	}

	public String[] getApproverUserIds() {
		return approverUserIds;
	}

	public String[] getCcUserIds() {
		return ccUserIds;
	}

	public String getResult() {
		return result;
	}

	public String getBusinessId() {
		return businessId;
	}

	public String getOriginatorDeptName() {
		return originatorDeptName;
	}

	public String getBizAction() {
		return bizAction;
	}

	public String getAttachedProcessInstanceIds() {
		return attachedProcessInstanceIds;
	}

	public Set<FormComponentValue> getFormComponentValues() {
		return formComponentValues;
	}

	public Set<OperationRecords> getOperationRecords() {
		return operationRecords;
	}

	public Set<TaskTop> getTasks() {
		return tasks;
	}

	public void setProcessInstanceId(String processInstanceId) {
		this.processInstanceId = processInstanceId;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public void setFinishTime(Date finishTime) {
		this.finishTime = finishTime;
	}

	public void setOriginatorUserId(String originatorUserId) {
		this.originatorUserId = originatorUserId;
	}

	public void setOriginatorDeptId(String originatorDeptId) {
		this.originatorDeptId = originatorDeptId;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public void setApproverUserIds(String[] approverUserIds) {
		this.approverUserIds = approverUserIds;
	}

	public void setCcUserIds(String[] ccUserIds) {
		this.ccUserIds = ccUserIds;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public void setBusinessId(String businessId) {
		this.businessId = businessId;
	}

	public void setOriginatorDeptName(String originatorDeptName) {
		this.originatorDeptName = originatorDeptName;
	}

	public void setBizAction(String bizAction) {
		this.bizAction = bizAction;
	}

	public void setAttachedProcessInstanceIds(String attachedProcessInstanceIds) {
		this.attachedProcessInstanceIds = attachedProcessInstanceIds;
	}

	public void setFormComponentValues(Set<FormComponentValue> formComponentValues) {
		this.formComponentValues = formComponentValues;
	}

	public void setOperationRecords(Set<OperationRecords> operationRecords) {
		this.operationRecords = operationRecords;
	}

	public void setTasks(Set<TaskTop> tasks) {
		this.tasks = tasks;
	}

	public String getOriginatorUserName() {
		return originatorUserName;
	}

	public void setOriginatorUserName(String originatorUserName) {
		this.originatorUserName = originatorUserName;
	}

}
