package com.gx.obe.management.thread;

import java.io.File;
import java.util.List;

import org.apache.log4j.Logger;

import com.gx.obe.business.http.UploadListener;
import com.gx.obe.management.webservice.IUploadEvaluateResult;
import com.gx.obe.management.webservice.UploadEvaluationResultAndFile;
import com.gx.obe.web.entity.auth.Menu;
import com.gx.obe.web.entity.tender.TenderProjectEntity;

/**
 * @Description: 上传评标结果
 * @author guoyr
 */
public class UploadEvaluationResultThread extends Thread{
	
	private UploadListener callBack;
	private Logger LOG = Logger.getLogger(UploadEvaluationResultThread.class);	
	private TenderProjectEntity tenderProjectEntity;
	private List<File> reportFileList;
	private List<File> attachmentFileList;
	private Menu menu;
	
	public UploadEvaluationResultThread(Menu menu,TenderProjectEntity tenderProjectEntity, List<File> reportFileList, List<File> attachmentFileList, UploadListener callBack){
		this.menu = menu;
		this.tenderProjectEntity = tenderProjectEntity;
		this.callBack = callBack;
		this.reportFileList = reportFileList;
		this.attachmentFileList = attachmentFileList;
	}
	
	public void run() {
		try {
			IUploadEvaluateResult uploadEvaluateResult = null;
			if("01".equals(menu.getParam("withBlockChain"))){
				uploadEvaluateResult = new com.gx.obe.management.webservice.UploadEvaluationResultAndFileWithBlockchain();
			}else{
				uploadEvaluateResult = new UploadEvaluationResultAndFile();
			}
			uploadEvaluateResult.uploadEvaluateResult(tenderProjectEntity, reportFileList, attachmentFileList, callBack);
		} catch (Exception e) {
			LOG.error("", e);
		}finally{
		}
	}
}
