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

import com.google.common.collect.Lists;
import com.jeeplus.common.utils.Collections3;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.sys.entity.Area;
import com.jeeplus.modules.sys.entity.User;
import com.jeeplus.modules.workclientinfo.entity.WorkClientInfo;
import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
import com.jeeplus.modules.sys.entity.Office;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeeplus.common.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.modules.workproject.entity.WorkProject;

/**
 * 招标项目Entity
 * @author 杨帆
 * @version 2017-12-25
 */
public class WorkBidingProject extends DataEntity<WorkBidingProject> {
	
	private static final long serialVersionUID = 1L;
	private WorkClientInfo client;		// 客户信息Id
	private WorkContractInfo contract;		// 合同外键
	private String biddingType;		// 招标方式(邀请投标,公开招标,直接谈判,竞争性谈判,其他)
	private String companyId;		// company_id
	private Office office;		// office_id
	private String batch;		// 批次(01...30)
	private String investmentAmount;		// 投资额
	private String projectNumber;		// 项目编号
	private String projectName;		// 项目名称
	private String controlPrice;		// 标底或招标控制价
	private String isControlPrice;		// 控制价有没有
	private Office demandOffice;		// 需求部门
	private Area area;		// 施工地点/交货地
	private String supervisoryOffice;		// 监督单位
	private String capitalAttribute;		// 资金属性(国有,自筹,集体)
	private Date projectStartDate;		// 工期/交货期开始时间
	private Date projectEndDate;		// 工期/交货期结束时间
	private String scopeOfBidding;		// 招标范围
	private String bidEvaluationMethod;		// 评标办法
	private String investorQualification;		// 投资人资质要求
	private String hostProjectQualification;		// 项目负责人资质要求
	private String otherRequirement;		// 其他要求
	private String projectMaster;		// 项目组负责人
	private String projectMasterName;		// 项目组负责人
	private String projectMember;		// 项目组成员
	private String projectMemberName;		// 项目组成员
	private String inventorUser;		// 清单编制人员
	private String inventorUserName;		// 清单编制人员
	private String status;		// 状态
	private WorkClientLinkman workClientLinkman;
	private WorkProject workProject; //总项目
	private String name;
	private String psort;//行业大分类
	private String ssort; //行业详细分类
	private String queryCon;
	private List<User> masterList = Lists.newArrayList();	//负责人列表

	private List<User> memberList = Lists.newArrayList();	//用户列表

	private List<User> inventorUserList = Lists.newArrayList();	//用户列表

	public WorkProject getWorkProject() {
		return workProject;
	}

	public void setWorkProject(WorkProject workProject) {
		this.workProject = workProject;
	}

	public String getPsort() {
		return psort;
	}

	public void setPsort(String psort) {
		this.psort = psort;
	}

	public String getSsort() {
		return ssort;
	}

	public void setSsort(String ssort) {
		this.ssort = ssort;
	}

	public WorkBidingProject() {
		super();
	}

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

	public WorkClientLinkman getWorkClientLinkman() {
		return workClientLinkman;
	}

	public void setWorkClientLinkman(WorkClientLinkman workClientLinkman) {
		this.workClientLinkman = workClientLinkman;
	}

	@ExcelField(title="客户信息Id", align=2, sort=7)
	public WorkClientInfo getClient() {
		return client;
	}

	public void setClient(WorkClientInfo client) {
		this.client = client;
	}
	
	@ExcelField(title="合同外键", align=2, sort=8)
	public WorkContractInfo getContract() {
		return contract;
	}

	public void setContract(WorkContractInfo contract) {
		this.contract = contract;
	}
	
	@ExcelField(title="招标方式(邀请投标,公开招标,直接谈判,竞争性谈判,其他)", mainDictType="bidding_type", align=2, sort=9)
	public String getBiddingType() {
		return biddingType;
	}

	public void setBiddingType(String biddingType) {
		this.biddingType = biddingType;
	}
	
	@ExcelField(title="company_id", align=2, sort=10)
	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}
	
	@ExcelField(title="office_id", fieldType=Office.class, value="office.name", align=2, sort=11)
	public Office getOffice() {
		return office;
	}

	public void setOffice(Office office) {
		this.office = office;
	}
	
	@ExcelField(title="批次(01...30)", dictType="bidding_batch", align=2, sort=12)
	public String getBatch() {
		return batch;
	}

	public void setBatch(String batch) {
		this.batch = batch;
	}

	@ExcelField(title="投资额(元)", dictType="investment_amount", align=2, sort=10)
	public String getInvestmentAmount() {
		return investmentAmount;
	}

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

	@ExcelField(title="项目编号", align=2, sort=13)
	public String getProjectNumber() {
		return projectNumber;
	}

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

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}
	
	@ExcelField(title="标底或招标控制价", align=2, sort=15)
	public String getControlPrice() {
		return controlPrice;
	}

	public void setControlPrice(String controlPrice) {
		this.controlPrice = controlPrice;
	}
	
	@ExcelField(title="控制价有没有", align=2, sort=16)
	public String getIsControlPrice() {
		return isControlPrice;
	}

	public void setIsControlPrice(String isControlPrice) {
		this.isControlPrice = isControlPrice;
	}
	
	@ExcelField(title="需求部门", align=2, sort=17)
	public Office getDemandOffice() {
		return demandOffice;
	}

	public void setDemandOffice(Office demandOffice) {
		this.demandOffice = demandOffice;
	}

	@ExcelField(title="施工地点/交货地", align=2, sort=18)
	public Area getArea() {
		return area;
	}

	public void setArea(Area area) {
		this.area = area;
	}

	@ExcelField(title="监督单位", align=2, sort=19)
	public String getSupervisoryOffice() {
		return supervisoryOffice;
	}

	public void setSupervisoryOffice(String supervisoryOffice) {
		this.supervisoryOffice = supervisoryOffice;
	}
	
	@ExcelField(title="资金属性(国有,自筹,集体)", align=2, sort=20)
	public String getCapitalAttribute() {
		return capitalAttribute;
	}

	public void setCapitalAttribute(String capitalAttribute) {
		this.capitalAttribute = capitalAttribute;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="工期/交货期开始时间", align=2, sort=21)
	public Date getProjectStartDate() {
		return projectStartDate;
	}

	public void setProjectStartDate(Date projectStartDate) {
		this.projectStartDate = projectStartDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="工期/交货期结束时间", align=2, sort=22)
	public Date getProjectEndDate() {
		return projectEndDate;
	}

	public void setProjectEndDate(Date projectEndDate) {
		this.projectEndDate = projectEndDate;
	}
	
	@ExcelField(title="招标范围", align=2, sort=23)
	public String getScopeOfBidding() {
		return scopeOfBidding;
	}

	public void setScopeOfBidding(String scopeOfBidding) {
		this.scopeOfBidding = scopeOfBidding;
	}
	
	@ExcelField(title="评标办法", align=2, sort=24)
	public String getBidEvaluationMethod() {
		return bidEvaluationMethod;
	}

	public void setBidEvaluationMethod(String bidEvaluationMethod) {
		this.bidEvaluationMethod = bidEvaluationMethod;
	}
	
	@ExcelField(title="投资人资质要求", align=2, sort=25)
	public String getInvestorQualification() {
		return investorQualification;
	}

	public void setInvestorQualification(String investorQualification) {
		this.investorQualification = investorQualification;
	}
	
	@ExcelField(title="项目负责人资质要求", align=2, sort=26)
	public String getHostProjectQualification() {
		return hostProjectQualification;
	}

	public void setHostProjectQualification(String hostProjectQualification) {
		this.hostProjectQualification = hostProjectQualification;
	}
	
	@ExcelField(title="其他要求", align=2, sort=27)
	public String getOtherRequirement() {
		return otherRequirement;
	}

	public void setOtherRequirement(String otherRequirement) {
		this.otherRequirement = otherRequirement;
	}
	
	@ExcelField(title="项目组负责人", align=2, sort=28)
	public String getProjectMaster() {
		return projectMaster;
	}

	public void setProjectMaster(String projectMaster) {
		this.projectMaster = projectMaster;
	}
	
	@ExcelField(title="项目组成员", align=2, sort=29)
	public String getProjectMember() {
		return projectMember;
	}

	public void setProjectMember(String projectMember) {
		this.projectMember = projectMember;
	}
	
	@ExcelField(title="清单编制人员", align=2, sort=30)
	public String getInventorUser() {
		return inventorUser;
	}

	public void setInventorUser(String inventorUser) {
		this.inventorUser = inventorUser;
	}

	public String getStatus() {
		return status;
	}

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

	@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));
		}
	}

	@ExcelField(title="项目负责人", align=2, sort=13)
	public String getProjectMasterIds() {
		return Collections3.extractToString(masterList, "id", ",") ;
	}

	public void setProjectMasterIds(String projectMaster) {
		this.masterList = Lists.newArrayList();
		for (String id : StringUtils.split(projectMaster, ",")){
			this.masterList.add(new User(id));
		}
	}

	@ExcelField(title="清单编制人员", align=2, sort=13)
	public String getInventorUserIds() {
		return Collections3.extractToString(inventorUserList, "id", ",") ;
	}

	public void setInventorUserIds(String inventorUser) {
		this.inventorUserList = Lists.newArrayList();
		for (String id : StringUtils.split(inventorUser, ",")){
			this.inventorUserList.add(new User(id));
		}
	}

	public String getName() {
		return name;
	}

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

	public String getQueryCon() {
		return queryCon;
	}

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

	public String getProjectMasterName() {
		return projectMasterName;
	}

	public void setProjectMasterName(String projectMasterName) {
		this.projectMasterName = projectMasterName;
	}

	public String getProjectMemberName() {
		return projectMemberName;
	}

	public void setProjectMemberName(String projectMemberName) {
		this.projectMemberName = projectMemberName;
	}

	public String getInventorUserName() {
		return inventorUserName;
	}

	public void setInventorUserName(String inventorUserName) {
		this.inventorUserName = inventorUserName;
	}
}