/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.workcontractinfo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;
import com.jeeplus.common.persistence.ActEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.modules.sys.entity.User;
import com.jeeplus.modules.workbidproject.entity.WorkBidProject;
import com.jeeplus.modules.workclientinfo.entity.WorkClientAttachment;
import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
import com.jeeplus.modules.workfullmanage.entity.WorkFullRecord;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 合同管理Entity
 * @author 丁旭
 * @version 2017-03-21
 */
public class WorkContractInfoCopy extends ActEntity<WorkContractInfoCopy> {
	/*新增属性*/
	private WorkBidProject project;		// 投标项目
	private String projectName;		// 项目名称
	private String ext;
	private String alterState;       //变更状态（1暂存2审批中3驳回回4已变更5撤回）
	private String alterBeforeId;     //变更前合同id
	private String alterSign;         //标记
	private String alterType;        //变更前中后（1前2中3后）
	private String times;       //变更次数
/*-----------------------------------------------------------------*/
	private static final long serialVersionUID = 1L;
	private WorkClientInfo client;		// 客户ID
	private Date contractDate;		// 签订日期
	private Date effectiveDate;		// 合同生效日期
	private Date closingDate;		// 合同终止日期
	private String name;		// 合同名称
	private String contractCategory;		// 合同类别
	private String contractNum;		// 合同编号
	private String contractPrice;		// 合同金额(元）
	private String contractOpposite;		// 对方合同编号
	private String contractType;		// 合同类型
	private String contractTypeDoc;		//合同类型说明
	private String contractFee;		// 收费标准
	private String contractFeeDoc; //收费标准说明
	private String contractSpecial;		// 合同特别条款
	private String contractState;		// 合同状态
	private Date beginContractDate;		// 开始 签订日期
	private Date endContractDate;		// 结束 签订日期
	private String chargeCompany;			//合同  负责部门或者公司
	private String chargeCompanyName;		//公司名称
	private String contractFileId;			//合同文件id
	private String contractRole;			//审批角色
	private String applyView;		 //审核意见
	private String processInstanceId;
	private String companyId;
	private String officeId;
	private String createName;
	private String createCompany;
	private String anotherContractNum;
	private String isTotal;
	private String totalContractId;
	private String totalContractName;//总合同
	private String parentIds;	//总公司
	private String isTotalName;	//直接父节点
	private String totalContractIds;	//父节点集合
	private String commonFlag; //标志各个级别同属一个总合同
	private String cnt; //标志当前合同是否有子合同
	private Integer sort = 30;
	private String status;//0履行中 1已完成
	private String investmentScale;//投资规模
	private String summaryPayment;//付款摘要
	private Double investmentAmount;//投资额
	private Integer constructionProjectType;//建设项目类别
	private String queryCon;
	private String createBys;
	private String nowDate;
	private String userName;
	private String errInfo;
	private WorkFullRecord workFullRecord;
	private WorkContractReview workContractReview;
	private List<WorkClientAttachment> workAttachments = Lists.newArrayList();//合同附件
	private List<WorkClientAttachment> workAttachmentscopy = Lists.newArrayList();//变更附件
	private String invalidateProcessInstanceId; //合同作废流程id
	private String invalidateStatus ; //合同作废状态(invalidate_status：0未开启，1进行中，2已作废)
	private String invalidateUserId ; //合同作废发起人id
	private User invalidateUser ;     //合同作废发起人
	private String auditType ;  //审批的类型：合同申请、合同作废、合同变更
	/**
	 * 合同作废状态：
	 *  当合同是通过状态（contract_state=2）时可以发起合同作废流程，当合同作废申请被批准后，合同状态更改为"已作废(contract_state=6)"
	 *  空：当前合同未发起作废申请，即：该状态下可以发起合同作废申请；
	 *  1：合同作废流程进行中，即：该状态下不能重复发起合同作废申请；
	 *  2：合同作废申请被批准，即：该状态下不能重复发起合同作废申请；
	 *  3: 合同作废申请被驳回，即：申请人可以选择撤销或重新申请；
	 *  4：合同作废申请人选择了撤销，即：可以再次申请；
	 */

	public List<WorkClientAttachment> getWorkAttachments() {
		return workAttachments;
	}

	public void setWorkAttachments(List<WorkClientAttachment> workAttachments) {
		this.workAttachments = workAttachments;
	}

	public WorkContractInfoCopy(WorkClientInfo clientId){
		this.client = clientId;
	}
//	public List<WorkClientAttachment> getWorkContractAnnexList() {
//		return workContractAnnexList;
//	}
//
//	public void setWorkContractAnnexList(List<WorkClientAttachment> workContractAnnexList) {
//		this.workContractAnnexList = workContractAnnexList;
//	}
//
//	private List<WorkClientAttachment> workContractAnnexList = Lists.newArrayList();		// 子表列表

	// -- 临时属性 --//
	// 流程任务
	private Task task;
	private Map<String, Object> variables;
	// 运行中的流程实例
	private ProcessInstance processInstance;
	// 历史的流程实例
	private HistoricProcessInstance historicProcessInstance;
	// 流程定义
	private ProcessDefinition processDefinition;

	public String getCreateName() {
		return createName;
	}

	public void setCreateName(String createName) {
		this.createName = createName;
	}

	public String getAlterBeforeId() {
		return alterBeforeId;
	}

	public void setAlterBeforeId(String alterBeforeId) {
		this.alterBeforeId = alterBeforeId;
	}

	public String getCreateCompany() {
		return createCompany;
	}

	public void setCreateCompany(String createCompany) {
		this.createCompany = createCompany;
	}

	public WorkContractInfoCopy() {
		super();
	}

	public WorkContractInfoCopy(String id){
		super(id);
	}
	@ExcelField(title="项目名称", align=2, sort=1)
	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	@ExcelField(title="总合同名称", align=2, sort=2)
	public String getTotalContractName() {
		return totalContractName;
	}

	public void setTotalContractName(String totalContractName) {
		this.totalContractName = totalContractName;
	}

	@ExcelField(title="合同名称", align=2, sort=3)
	public String getName() {
		return name;
	}

	public String getAlterState() {
		return alterState;
	}

	public void setAlterState(String alterState) {
		this.alterState = alterState;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAlterSign() {
		return alterSign;
	}

	public String getAlterType() {
		return alterType;
	}

	public void setAlterType(String alterType) {
		this.alterType = alterType;
	}

	public String getTimes() {
		return times;
	}

	public void setTimes(String times) {
		this.times = times;
	}

	public void setAlterSign(String alterSign) {
		this.alterSign = alterSign;
	}

	public List<WorkClientAttachment> getWorkAttachmentscopy() {
		return workAttachmentscopy;
	}

	public void setWorkAttachmentscopy(List<WorkClientAttachment> workAttachmentscopy) {
		this.workAttachmentscopy = workAttachmentscopy;
	}

	@ExcelField(title="合同金额(元）", align=2, sort=4)
	public String getContractPrice() {
		return contractPrice;
	}

	public void setContractPrice(String contractPrice) {
		this.contractPrice = contractPrice;
	}


	@ExcelField(title="合同编号", align=2, sort=5)
	public String getContractNum() {
		return contractNum;
	}

	public void setContractNum(String contractNum) {
		this.contractNum = contractNum;
	}


	@ExcelField(title="业务类型", mainDictType="contract_type", align=2, sort=6)
	public String getContractType() {
		return contractType;
	}

	public void setContractType(String contractType) {
		this.contractType = contractType;
	}

	@JsonIgnore
	@ExcelField(title="客户名称", align=2, sort=7)
	public WorkClientInfo getClient() {
		return client;
	}

	public void setClient(WorkClientInfo client) {
		this.client = client;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="签订日期", align=2, sort=8)
	public Date getContractDate() {
		return contractDate;
	}

	public void setContractDate(Date contractDate) {
		this.contractDate = contractDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="合同生效日期", align=2, sort=9)
	public Date getEffectiveDate() {
		return effectiveDate;
	}

	public void setEffectiveDate(Date effectiveDate) {
		this.effectiveDate = effectiveDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="合同终止日期", align=2, sort=10)
	public Date getClosingDate() {
		return closingDate;
	}

	public void setClosingDate(Date closingDate) {
		this.closingDate = closingDate;
	}
	
	public String getContractCategory() {
		return contractCategory;
	}

	public void setContractCategory(String contractCategory) {
		this.contractCategory = contractCategory;
	}

	@ExcelField(title="对方合同编号", align=2, sort=12)
	public String getContractOpposite() {
		return contractOpposite;
	}

	public void setContractOpposite(String contractOpposite) {
		this.contractOpposite = contractOpposite;
	}

	@ExcelField(title="收费标准", dictType="contract_fee", align=2, sort=13)
	public String getContractFee() {
		return contractFee;
	}

	public void setContractFee(String contractFee) {
		this.contractFee = contractFee;
	}
	
	@ExcelField(title="合同特别条款", align=2, sort=14)
	public String getContractSpecial() {
		return contractSpecial;
	}

	public void setContractSpecial(String contractSpecial) {
		this.contractSpecial = contractSpecial;
	}
	
	@ExcelField(title="合同状态", dictType="contract_state", align=2, sort=15)
	public String getContractState() {
		return contractState;
	}

	public void setContractState(String contractState) {
		this.contractState = contractState;
	}
	
	public Date getBeginContractDate() {
		return beginContractDate;
	}

	public void setBeginContractDate(Date beginContractDate) {
		this.beginContractDate = beginContractDate;
	}
	
	public Date getEndContractDate() {
		return endContractDate;
	}

	public void setEndContractDate(Date endContractDate) {
		this.endContractDate = endContractDate;
	}

	public String getChargeCompany() {
		return chargeCompany;
	}

	public void setChargeCompany(String chargeCompany) {
		this.chargeCompany = chargeCompany;
	}

	public String getContractFileId() {
		return contractFileId;
	}

	public void setContractFileId(String contractFileId) {
		this.contractFileId = contractFileId;
	}

	public String getContractRole() {
		return contractRole;
	}

	public void setContractRole(String contractRole) {
		this.contractRole = contractRole;
	}

	public WorkBidProject getProject() {
		return project;
	}

	public void setProject(WorkBidProject project) {
		this.project = project;
	}

	public String getExt() {
		return ext;
	}

	public void setExt(String ext) {
		this.ext = ext;
	}

	public String getApplyView() {
		return applyView;
	}

	public void setApplyView(String applyView) {
		this.applyView = applyView;
	}

	public Task getTask() {
		return task;
	}

	public void setTask(Task task) {
		this.task = task;
	}

	public Map<String, Object> getVariables() {
		return variables;
	}

	public void setVariables(Map<String, Object> variables) {
		this.variables = variables;
	}

	public ProcessInstance getProcessInstance() {
		return processInstance;
	}

	public void setProcessInstance(ProcessInstance processInstance) {
		this.processInstance = processInstance;
	}

	public HistoricProcessInstance getHistoricProcessInstance() {
		return historicProcessInstance;
	}

	public void setHistoricProcessInstance(HistoricProcessInstance historicProcessInstance) {
		this.historicProcessInstance = historicProcessInstance;
	}

	public ProcessDefinition getProcessDefinition() {
		return processDefinition;
	}

	public void setProcessDefinition(ProcessDefinition processDefinition) {
		this.processDefinition = processDefinition;
	}

	public String getProcessInstanceId() {
		return processInstanceId;
	}

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

	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	public String getContractTypeDoc() {
		return contractTypeDoc;
	}

	public void setContractTypeDoc(String contractTypeDoc) {
		this.contractTypeDoc = contractTypeDoc;
	}

	public String getContractFeeDoc() {
		return contractFeeDoc;
	}

	public void setContractFeeDoc(String contractFeeDoc) {
		this.contractFeeDoc = contractFeeDoc;
	}

	public String getChargeCompanyName() {
		return chargeCompanyName;
	}

	public void setChargeCompanyName(String chargeCompanyName) {
		this.chargeCompanyName = chargeCompanyName;
	}

	public String getAnotherContractNum() {
		return anotherContractNum;
	}

	public void setAnotherContractNum(String anotherContractNum) {
		this.anotherContractNum = anotherContractNum;
	}

	public WorkFullRecord getWorkFullRecord() {
		return workFullRecord;
	}

	public void setWorkFullRecord(WorkFullRecord workFullRecord) {
		this.workFullRecord = workFullRecord;
	}

	public String getOfficeId() {
		return officeId;
	}

	public void setOfficeId(String officeId) {
		this.officeId = officeId;
	}

	public String getIsTotal() {
		return isTotal;
	}

	public void setIsTotal(String isTotal) {
		this.isTotal = isTotal;
	}

	public String getTotalContractId() {
		return totalContractId;
	}

	public void setTotalContractId(String totalContractId) {
		this.totalContractId = totalContractId;
	}

	public String getParentIds() {
		return parentIds;
	}

	public void setParentIds(String parentIds) {
		this.parentIds = parentIds;
	}

	public String getIsTotalName() {
		return isTotalName;
	}

	public void setIsTotalName(String isTotalName) {
		this.isTotalName = isTotalName;
	}

	public String getTotalContractIds() {
		return totalContractIds;
	}

	public void setTotalContractIds(String totalContractIds) {
		this.totalContractIds = totalContractIds;
	}

	public String getCommonFlag() {
		return commonFlag;
	}

	public void setCommonFlag(String commonFlag) {
		this.commonFlag = commonFlag;
	}

	public String getCnt() {
		return cnt;
	}

	public void setCnt(String cnt) {
		this.cnt = cnt;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public String getStatus() {
		return status;
	}

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

	public String getInvestmentScale() {
		return investmentScale;
	}

	public void setInvestmentScale(String investmentScale) {
		this.investmentScale = investmentScale;
	}

	public String getSummaryPayment() {
		return summaryPayment;
	}

	public void setSummaryPayment(String summaryPayment) {
		this.summaryPayment = summaryPayment;
	}

	public Double getInvestmentAmount() {
		return investmentAmount;
	}

	public void setInvestmentAmount(Double investmentAmount) {
		this.investmentAmount = investmentAmount;
	}

	public Integer getConstructionProjectType() {
		return constructionProjectType;
	}

	public void setConstructionProjectType(Integer constructionProjectType) {
		this.constructionProjectType = constructionProjectType;
	}

	public String getQueryCon() {
		return queryCon;
	}

	public void setQueryCon(String queryCon) {
		this.queryCon = queryCon;
	}

	public String getCreateBys() {
		return createBys;
	}

	public void setCreateBys(String createBys) {
		this.createBys = createBys;
	}

	public WorkContractReview getWorkContractReview() {
		return workContractReview;
	}

	public void setWorkContractReview(WorkContractReview workContractReview) {
		this.workContractReview = workContractReview;
	}


	public String getInvalidateProcessInstanceId() {
		return invalidateProcessInstanceId;
	}

	public void setInvalidateProcessInstanceId(String invalidateProcessInstanceId) {
		this.invalidateProcessInstanceId = invalidateProcessInstanceId;
	}

	public String getInvalidateStatus() {
		return invalidateStatus;
	}

	public void setInvalidateStatus(String invalidateStatus) {
		this.invalidateStatus = invalidateStatus;
	}

	public String getInvalidateUserId() {
		return invalidateUserId;
	}

	public void setInvalidateUserId(String invalidateUserId) {
		this.invalidateUserId = invalidateUserId;
	}

	public User getInvalidateUser() {
		return invalidateUser;
	}

	public void setInvalidateUser(User invalidateUser) {
		this.invalidateUser = invalidateUser;

	}
	@ExcelField(title="导入时间", align=2, sort=16)
	public String getNowDate() {
		return nowDate;
	}

	public void setNowDate(String nowDate) {
		this.nowDate = nowDate;
	}

	@ExcelField(title="导入用户", align=2, sort=17)
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@ExcelField(title="失败原因", align=2, sort=18)
	public String getErrInfo() {
		return errInfo;
	}

	public void setErrInfo(String errInfo) {
		this.errInfo = errInfo;

	}

	public String getAuditType() {
		return auditType;
	}

	public void setAuditType(String auditType) {
		this.auditType = auditType;
	}
}