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

import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
import com.jeeplus.modules.sys.entity.User;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import com.jeeplus.common.persistence.DataEntity;
import com.jeeplus.common.utils.Collections3;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.common.utils.excel.annotation.ExcelField;

/**
 * 投标资格预审Entity
 * @author  mengxy
 * @version 2017-05-24
 */
public class WorkPrequalification extends DataEntity<WorkPrequalification> {
	
	private static final long serialVersionUID = 1L;
	private String number;		// 项目编号
	private String projectName;		// 项目名称
	private String projectType;		// 项目类型
	private String projectSource;		// 项目来源
	private String isExternalContacts;		//  是否外部联系人  
	private WorkClientInfo biddingCompany;		// 招标单位
	private User contacts;		// 联系人
	private String extCompany;		// 外部招标单位
	private String extContacts;		// 外部联系人
	private Date prequalificationDate;		// 预审日期
	private Date registrationDate;		// 报名日期
	private String isSubcontract;		// 是否外协
	private String projectMember;		// 项目成员
	private Date purchaseDate;		// 购买日期
	private String documentCost;		// 文件费用
	private String bindCost;		// 装订费用
	private String projectSituation;		// 项目概况
	private String status;		// 项目状态
	
	private List<WorkProjectLinkman> workProjectLinkmanList = Lists.newArrayList();		// 子表列表
	
	private List<User> masterList = Lists.newArrayList();	//负责人列表
	
	private List<User> memberList = Lists.newArrayList();	//用户列表
	
	private List<User> officeList = Lists.newArrayList();	//用户列表
	
	public WorkPrequalification() {
		super();
	}

	public WorkPrequalification(String id){
		super(id);
	}

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

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

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}
	
	@ExcelField(title="项目类型", dictType="projectType", align=2, sort=3)
	public String getProjectType() {
		return projectType;
	}

	public void setProjectType(String projectType) {
		this.projectType = projectType;
	}
	
	@ExcelField(title="项目来源", dictType="projectSource", align=2, sort=4)
	public String getProjectSource() {
		return projectSource;
	}

	public void setProjectSource(String projectSource) {
		this.projectSource = projectSource;
	}
	
	@ExcelField(title=" 是否外部联系人  ", dictType="", align=2, sort=5)
	public String getIsExternalContacts() {
		return isExternalContacts;
	}

	public void setIsExternalContacts(String isExternalContacts) {
		this.isExternalContacts = isExternalContacts;
	}
	
	@ExcelField(title="招标单位", align=2, sort=6)
	public WorkClientInfo getBiddingCompany() {
		return biddingCompany;
	}

	public void setBiddingCompany(WorkClientInfo biddingCompany) {
		this.biddingCompany = biddingCompany;
	}
	
	@ExcelField(title="联系人", fieldType=User.class, value="contacts.name", align=2, sort=7)
	public User getContacts() {
		return contacts;
	}

	public void setContacts(User contacts) {
		this.contacts = contacts;
	}
	
	@ExcelField(title="外部招标单位", align=2, sort=8)
	public String getExtCompany() {
		return extCompany;
	}

	public void setExtCompany(String extCompany) {
		this.extCompany = extCompany;
	}
	
	@ExcelField(title="外部联系人", align=2, sort=9)
	public String getExtContacts() {
		return extContacts;
	}

	public void setExtContacts(String extContacts) {
		this.extContacts = extContacts;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="预审日期", align=2, sort=10)
	public Date getPrequalificationDate() {
		return prequalificationDate;
	}

	public void setPrequalificationDate(Date prequalificationDate) {
		this.prequalificationDate = prequalificationDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="报名日期", align=2, sort=11)
	public Date getRegistrationDate() {
		return registrationDate;
	}

	public void setRegistrationDate(Date registrationDate) {
		this.registrationDate = registrationDate;
	}
	
	@ExcelField(title="是否外协", dictType="", align=2, sort=12)
	public String getIsSubcontract() {
		return isSubcontract;
	}

	public void setIsSubcontract(String isSubcontract) {
		this.isSubcontract = isSubcontract;
	}
	
	@ExcelField(title="项目成员", align=2, sort=13)
	public String getProjectMemberIds() {
		return Collections3.extractToString(memberList, "id", ",") ;
	}

	public void setProjectMemberIds(String projectMember) {
		this.memberList = Lists.newArrayList();
		for (String id : StringUtils.split(projectMember, ",")){
			this.memberList.add(new User(id));
		}
	}
	
	/**
	 * 获取通知发送记录用户Name
	 * @return
	 */
	public String getProjectMemberNames() {
		return Collections3.extractToString(memberList, "name", ",") ;
	}
	
	/**
	 * 设置通知发送记录用户Name
	 * @return
	 */
	public void setProjectMemberNames(String projectMember) {
		// 什么也不做
	}
	
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="购买日期", align=2, sort=14)
	public Date getPurchaseDate() {
		return purchaseDate;
	}

	public void setPurchaseDate(Date purchaseDate) {
		this.purchaseDate = purchaseDate;
	}
	
	@ExcelField(title="文件费用", align=2, sort=15)
	public String getDocumentCost() {
		return documentCost;
	}

	public void setDocumentCost(String documentCost) {
		this.documentCost = documentCost;
	}
	
	@ExcelField(title="装订费用", align=2, sort=16)
	public String getBindCost() {
		return bindCost;
	}

	public void setBindCost(String bindCost) {
		this.bindCost = bindCost;
	}
	
	@ExcelField(title="项目概况", align=2, sort=17)
	public String getProjectSituation() {
		return projectSituation;
	}

	public void setProjectSituation(String projectSituation) {
		this.projectSituation = projectSituation;
	}
	
	@ExcelField(title="项目状态", align=2, sort=18)
	public String getStatus() {
		return status;
	}

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

	public List<WorkProjectLinkman> getWorkProjectLinkmanList() {
		return workProjectLinkmanList;
	}

	public void setWorkProjectLinkmanList(List<WorkProjectLinkman> workProjectLinkmanList) {
		this.workProjectLinkmanList = workProjectLinkmanList;
	}

	public List<User> getMasterList() {
		return masterList;
	}

	public void setMasterList(List<User> masterList) {
		this.masterList = masterList;
	}

	public List<User> getMemberList() {
		return memberList;
	}

	public void setMemberList(List<User> memberList) {
		this.memberList = memberList;
	}
	
}