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

import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import com.jeeplus.common.persistence.ActEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
import com.jeeplus.modules.sys.entity.Office;
import com.jeeplus.modules.sys.entity.User;
import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
import com.jeeplus.modules.workinvoicedetail.entity.WorkInvoiceDetail;
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
 */
public class WorkInvoiceAlter extends ActEntity<WorkInvoiceAlter> {

    public static final String SERIAL_BIZCODE = "3";//编号模板类型

	private static final long serialVersionUID = 1L;
	private String number;		// 发票申请编号
	private String processInstanceId; // 流程实例编号
	private WorkClientInfo client;		// 实际开票单位
	private ProjectRecords project;		// 开票项目(来源项目登记)
	private String projectName;		// 项目名称
	private Double money;		// 价税合计
	private String invoiceType;		// 发票类型
	private String chargeType;		// 收款类型
	private String content;		// 开票内容要求
	private User drawer;		// 开票经办人（暂时弃用）
	private Office office;		// 所属部门
	private Integer invoiceNumber;		// 发票编号（暂时弃用）
	private Date invoiceDate;		// 开票日期
	private Date takeDate;          //领票日期
	private String drawerName;      //开票人（发票管理员名称）
	private String invoiceRemarks;		// 开票备注
	private String isInvoice;		// 是否开票
	private String isCharge;		// 是否收款
	private String isInvalid;		// 是否作废
	private String invoiceState;    //发票状态
	private String orUnicode;       //纳税人识别号
	private String address;         //地址
	private String telephone;        //电话
	private String bank;              //开户银行
	private String bankNumber;        //银行账号
	private String cancleReason; //作废原因
	private String companyId; //提交人的公司编号
	private String officeId;
	private String ext;//1总公司0分公司
	private String contractDate;
	private String province; //省份
	private String home;
	private WorkInvoice workInvoice;     //变更前数据主键
	private Date beginContractDate;		// 开始
	private Date endContractDate;		// 结束
	private List<WorkInvoiceDetail> workAccountList = Lists.newArrayList();//发票明细
	public String getOfficeId() {
		return officeId;
	}

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

	public String getCompanyId() {
		return companyId;
	}

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

	public String getCancleReason() {
		return cancleReason;
	}

	public void setCancleReason(String cancleReason) {
		this.cancleReason = cancleReason;
	}

	public String getBank() {
		return bank;
	}

	public void setBank(String bank) {
		this.bank = bank;
	}

	public String getBankNumber() {
		return bankNumber;
	}

	public void setBankNumber(String bankNumber) {
		this.bankNumber = bankNumber;
	}

	@ExcelField(title="发票状态", align=2, sort=12)
	public String getInvoiceState() {
		return invoiceState;
	}

	public void setInvoiceState(String invoiceState) {
		this.invoiceState = invoiceState;
	}
	// 流程任务
	private Task task;
	private Map<String, Object> variables;
	// 运行中的流程实例
	private ProcessInstance processInstance;
	// 历史的流程实例
	private HistoricProcessInstance historicProcessInstance;
	// 流程定义
	private ProcessDefinition processDefinition;

	public Date getTakeDate() {
		return takeDate;
	}

	public String getHome() {
		return home;
	}

	public void setHome(String home) {
		this.home = home;
	}

	public void setTakeDate(Date takeDate) {
		this.takeDate = takeDate;
	}

	public String getDrawerName() {
		return drawerName;
	}

	public void setDrawerName(String drawerName) {
		this.drawerName = drawerName;
	}

	public WorkInvoiceAlter() {
		super();
	}

	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 WorkInvoiceAlter(String id){
		super(id);
	}

	@ExcelField(title="开票号", align=2, sort=1)
	public String getNumber() {
		return number;
	}

	public String getContractDate() {
		return contractDate;
	}

	public void setContractDate(String contractDate) {
		this.contractDate = contractDate;
	}

	public void setNumber(String number) {
		this.number = number;
	}
	
	@ExcelField(title="开票单位", fieldType=WorkClientInfo.class, value="client.name",align=2, sort=4)
	public WorkClientInfo getClient() {
		return client;
	}

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

	public WorkInvoice getWorkInvoice() {
		return workInvoice;
	}

	public void setWorkInvoice(WorkInvoice workInvoice) {
		this.workInvoice = workInvoice;
	}

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

	public ProjectRecords getProject() {
		return project;
	}

	public List<WorkInvoiceDetail> getWorkAccountList() {
		return workAccountList;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public void setWorkAccountList(List<WorkInvoiceDetail> workAccountList) {
		this.workAccountList = workAccountList;
	}

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

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

	public String getOrUnicode() {
		return orUnicode;
	}

	public void setOrUnicode(String orUnicode) {
		this.orUnicode = orUnicode;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	@ExcelField(title="开票金额", align=2, sort=7)
	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}
	
	@ExcelField(title="发票类型", dictType="invoice_type", align=2, sort=10)
	public String getInvoiceType() {
		return invoiceType;
	}

	public void setInvoiceType(String invoiceType) {
		this.invoiceType = invoiceType;
	}
	
	@ExcelField(title="收款类型", dictType="charge_type", align=2, sort=9)
	public String getChargeType() {
		return chargeType;
	}

	public void setChargeType(String chargeType) {
		this.chargeType = chargeType;
	}
	
	@ExcelField(title="开票内容", dictType="invoice_type", align=2, sort=8)
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	@ExcelField(title="开票经办人", fieldType=User.class, value="drawer.name", align=2, sort=5)
	public User getDrawer() {
		return drawer;
	}

	public void setDrawer(User drawer) {
		this.drawer = drawer;
	}
	
	@ExcelField(title="开票经办人部门", fieldType=Office.class, value="office.name", align=2, sort=6)
	public Office getOffice() {
		return office;
	}

	public void setOffice(Office office) {
		this.office = office;
	}
	
	@ExcelField(title="发票编号", align=2, sort=3)
	public Integer getInvoiceNumber() {
		return invoiceNumber;
	}

	public void setInvoiceNumber(Integer invoiceNumber) {
		this.invoiceNumber = invoiceNumber;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="开票日期", align=2, sort=11)
	public Date getInvoiceDate() {
		return invoiceDate;
	}

	public void setInvoiceDate(Date invoiceDate) {
		this.invoiceDate = invoiceDate;
	}
	
	//@ExcelField(title="开票备注", align=2, sort=13)
	public String getInvoiceRemarks() {
		return invoiceRemarks;
	}

	public void setInvoiceRemarks(String invoiceRemarks) {
		this.invoiceRemarks = invoiceRemarks;
	}
	
	//@ExcelField(title="是否开票", align=2, sort=14)
	public String getIsInvoice() {
		return isInvoice;
	}

	public void setIsInvoice(String isInvoice) {
		this.isInvoice = isInvoice;
	}
	
	@ExcelField(title="收款状态", align=2, sort=13)
	public String getIsCharge() {
		return isCharge;
	}

	public void setIsCharge(String isCharge) {
		this.isCharge = isCharge;
	}
	
	//@ExcelField(title="是否作废", align=2, sort=16)
	public String getIsInvalid() {
		return isInvalid;
	}

	public void setIsInvalid(String isInvalid) {
		this.isInvalid = isInvalid;
	}

	public String getProcessInstanceId() {
		return processInstanceId;
	}

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

	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 getExt() {
		return ext;
	}

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