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

import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import com.jeeplus.common.persistence.DataEntity;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.modules.sys.entity.Judge;
import com.jeeplus.modules.sys.entity.User;
import com.jeeplus.modules.sys.utils.UserUtils;
import com.jeeplus.modules.workbidingproject.entity.WorkBidingProject;
import com.jeeplus.modules.workevaluationroom.entity.WorkEvaluationRoom;
import com.jeeplus.modules.workprojectdeposit.entity.WorkProjectDeposit;

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

/**
 * 评标管理Entity
 * @author fgy
 * @version 2017-12-28
 */
public class WorkBidingEvaluation extends DataEntity<WorkBidingEvaluation> {
	
	private static final long serialVersionUID = 1L;
	private WorkBidingProject workBidingProject; //招标项目
	private String companyId;		// 企业id
	private String officeId;		// 部门id
	private Date startTime;		// 开标时间
	private String startAddress;		// 开标地点
	private Date evaluationTime;		// 评标时间
	private String evaluationAddress;		// 评标地点
	private String judgeCount;		// 评委人数
	private String judgeLeader;      //评委组长
	private String judgeLeaderName;
	private String judgeMembers;		// 评委成员（正式组）
	private List<Judge> judgeMembersList;
	private String judgeMembersBak;		// 评委成员（备选组）
	private List<Judge> judgeMembersBakList;
	private String consultType;		// 评委咨询类型
	private String otherMembers;		// 其他相关工作人员
	private String otherMembersNames;
	private WorkEvaluationRoom workEvaluationRoom;//评标室
	private Date appointmentTimeBegin;		// 评标室预约时间（起）
	private Date appointmentTimeEnd;		// 评标室预约时间（止）
	private List<WorkProjectDeposit> workProjectDepositList; //投标企业
	private String workBidingProjectId;             //招标项目Id
	private String queryCon;
	
	public WorkBidingEvaluation() {
		super();
	}

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

	@ExcelField(title="企业id", align=2, sort=7)
	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}
	
	@ExcelField(title="部门id", align=2, sort=8)
	public String getOfficeId() {
		return officeId;
	}

	public void setOfficeId(String officeId) {
		this.officeId = officeId;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="开标时间", align=2, sort=9)
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	
	@ExcelField(title="开标地点", align=2, sort=10)
	public String getStartAddress() {
		return startAddress;
	}

	public void setStartAddress(String startAddress) {
		this.startAddress = startAddress;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="评标时间", align=2, sort=11)
	public Date getEvaluationTime() {
		return evaluationTime;
	}

	public void setEvaluationTime(Date evaluationTime) {
		this.evaluationTime = evaluationTime;
	}
	
	@ExcelField(title="评标地点", align=2, sort=12)
	public String getEvaluationAddress() {
		return evaluationAddress;
	}

	public void setEvaluationAddress(String evaluationAddress) {
		this.evaluationAddress = evaluationAddress;
	}
	
	@ExcelField(title="评委人数", align=2, sort=13)
	public String getJudgeCount() {
		return judgeCount;
	}

	public void setJudgeCount(String judgeCount) {
		this.judgeCount = judgeCount;
	}
	
	@ExcelField(title="评委成员（正式组）", align=2, sort=14)
	public String getJudgeMembers() {
		return judgeMembers;
	}

	public void setJudgeMembers(String judgeMembers) {
		this.judgeMembers = judgeMembers;
	}
	
	@ExcelField(title="评委成员（备选组）", align=2, sort=15)
	public String getJudgeMembersBak() {
		return judgeMembersBak;
	}

	public void setJudgeMembersBak(String judgeMembersBak) {
		this.judgeMembersBak = judgeMembersBak;
	}
	
	@ExcelField(title="评委咨询类型", dictType="consult_type", align=2, sort=16)
	public String getConsultType() {
		return consultType;
	}

	public void setConsultType(String consultType) {
		this.consultType = consultType;
	}
	
	@ExcelField(title="其他相关工作人员", align=2, sort=17)
	public String getOtherMembers() {
		return otherMembers;
	}

	public void setOtherMembers(String otherMembers) {
		this.otherMembers = otherMembers;
	}
	

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="评标室预约时间（起）", align=2, sort=19)
	public Date getAppointmentTimeBegin() {
		return appointmentTimeBegin;
	}

	public void setAppointmentTimeBegin(Date appointmentTimeBegin) {
		this.appointmentTimeBegin = appointmentTimeBegin;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="评标室预约时间（止）", align=2, sort=20)
	public Date getAppointmentTimeEnd() {
		return appointmentTimeEnd;
	}

	public void setAppointmentTimeEnd(Date appointmentTimeEnd) {
		this.appointmentTimeEnd = appointmentTimeEnd;
	}

	public WorkBidingProject getWorkBidingProject() {
		return workBidingProject;
	}

	public void setWorkBidingProject(WorkBidingProject workBidingProject) {
		this.workBidingProject = workBidingProject;
	}

	public String getWorkBidingProjectId() {
		return workBidingProjectId;
	}

	public void setWorkBidingProjectId(String workBidingProjectId) {
		this.workBidingProjectId = workBidingProjectId;
	}

	public String getJudgeLeader() {
		return judgeLeader;
	}

	public void setJudgeLeader(String judgeLeader) {
		this.judgeLeader = judgeLeader;
	}

	public List<Judge> getJudgeMembersList() {
		return judgeMembersList;
	}

	public void setJudgeMembersList(List<Judge> judgeMembersList) {
		this.judgeMembersList = judgeMembersList;
	}

	public List<Judge> getJudgeMembersBakList() {
		return judgeMembersBakList;
	}

	public void setJudgeMembersBakList(List<Judge> judgeMembersBakList) {
		this.judgeMembersBakList = judgeMembersBakList;
	}

	public List<WorkProjectDeposit> getWorkProjectDepositList() {
		return workProjectDepositList;
	}

	public void setWorkProjectDepositList(List<WorkProjectDeposit> workProjectDepositList) {
		this.workProjectDepositList = workProjectDepositList;
	}

	public String getQueryCon() {
		return queryCon;
	}

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

	public String getJudgeLeaderName() {
		return judgeLeaderName;
	}

	public void setJudgeLeaderName(String judgeLeaderName) {
		this.judgeLeaderName = judgeLeaderName;
	}

	public String getOtherMembersNames() {
		List<String> idList = Lists.newArrayList();
		if (StringUtils.isNotBlank(otherMembers)) {
			String ss = otherMembers.trim().replace("　", ",").replace(" ", ",").replace("，", ",").replace("'", "");
			for (String s : ss.split(",")) {
				User u = UserUtils.get(s);
				if(u!=null){
					String name = UserUtils.get(s).getName();
					idList.add(name);
				}
			}
		}
		return StringUtils.join(idList, ",");
	}

	public void setOtherMembersNames(String otherMembersNames) {
		this.otherMembersNames = otherMembersNames;
	}


	public WorkEvaluationRoom getWorkEvaluationRoom() {
		return workEvaluationRoom;
	}

	public void setWorkEvaluationRoom(WorkEvaluationRoom workEvaluationRoom) {
		this.workEvaluationRoom = workEvaluationRoom;
	}
}