package com.gx.obe.evaluation.step.entity;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 商务否决汇总结果
 * @author chenxw
 */
public class BusinessSummariseResult {
	
	private final String EVAL_QUALIFIED = "合格";
	private final String EVAL_UNQUALIFIED = "不合格";
	
	/**
	 * 供应商名称
	 */
	private String supplierName;
	
	/**
	 * 专家结果
	 */
	private Map<String, String> expertResultMap = new HashMap<String, String>();
	
	/**
	 * 通过数量
	 */
	private int accessYesCount;
	
	/**
	 * 不通过数量
	 */
	private int accessNoCount;
	
	/**
	 * 结果
	 */
	private String summariseResult;
	
	public String getSupplierName() {
		return supplierName;
	}
	
	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}
	
	public Map<String, String> getExpertResultMap() {
		return expertResultMap;
	}
	
	public String getExpertResultStr(String expertId) {
		String expertResult = expertResultMap.get(expertId);
		if (com.gx.obe.components.core.enumeration.EvaluationStepEnum.UNQUALIFIED.equals(expertResult)) {
			return EVAL_UNQUALIFIED;
		} else if (com.gx.obe.components.core.enumeration.EvaluationStepEnum.QUALIFIED.equals(expertResult)) {
			return EVAL_QUALIFIED;
		}
		return "";
	}
	
	public void setExpertResultMap(Map<String, String> expertResultMap) {
		this.expertResultMap = expertResultMap;
	}
	
	public int getAccessYesCount() {
		return accessYesCount;
	}
	
	public void setAccessYesCount(int accessYesCount) {
		this.accessYesCount = accessYesCount;
	}
	
	public int getAccessNoCount() {
		return accessNoCount;
	}
	
	public void setAccessNoCount(int accessNoCount) {
		this.accessNoCount = accessNoCount;
	}
	
	public String getSummariseResult() {
		return summariseResult;
	}
	
	public void setSummariseResult(String summariseResult) {
		this.summariseResult = summariseResult;
	}

	public String getSummariseResultStr() {
		if (com.gx.obe.components.core.enumeration.EvaluationStepEnum.UNQUALIFIED.equals(summariseResult)) {
			return EVAL_UNQUALIFIED;
		} else if (com.gx.obe.components.core.enumeration.EvaluationStepEnum.QUALIFIED.equals(summariseResult)) {
			return EVAL_QUALIFIED;
		}
		return "";
	}
	
	public String getStatisticResult() {
		StringBuilder msg = new StringBuilder();
		if (accessYesCount > 0 || accessNoCount > 0) {
			if (accessYesCount > 0) {
				msg.append(accessYesCount).append("位专家评审").append(EVAL_QUALIFIED);
			}
			if (accessNoCount > 0) {
				if (accessYesCount > 0) {
					msg.append("；");
				}
				msg.append(accessNoCount).append("位专家评审").append(EVAL_UNQUALIFIED);
			}
			msg.append("。");
		}
		return msg.toString();
	}

}
