⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gbs_presentationaction.java

📁 对日软件外包 为东芝做的一个全球商业管理系统
💻 JAVA
字号:

package ACTION;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import COMMON.BaseDispatchAction;
import COMMON.MessageList;
import COMMON.ReturnValue;
import COMMON.SystemConstants;
import DataBean.GBS_File_stBean;
import DataBean.GBS_RFP_stBean;
import LOGIC.GBS_PresentationActionLogic;

/**
 * GBS_PresentationAction	extends BaseDispatchAction implements SystemConstants
 * created on 11-08-2004
 * @author mxx
 * @version  1.0
 */

public class GBS_PresentationAction	extends BaseDispatchAction
									implements SystemConstants {
/**
 * method init  
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return
 * @throws Exception
 */	
public ActionForward init(
						  ActionMapping mapping,
						  ActionForm form,
						  HttpServletRequest request,
						  HttpServletResponse response)
						  throws Exception {	   	
		log.info("[location info]GBS_PresentationAction.init method!");
		GBS_PresentationForm thisForm = (GBS_PresentationForm) form;
		this.setUserInfoFromSession( request, thisForm);

		GBS_PresentationActionLogic logic = new GBS_PresentationActionLogic(
												this.getDataSource(request));
												
		List searchList = new ArrayList();
		String strCustomerId = thisForm.getCustomerId();
		String strRfpNo = thisForm.getRfpNo();
		ReturnValue returnValue = logic.getCustomerName(strCustomerId);			
		if ( returnValue.isError() ){
			if(returnValue.isBussinessError()){
				MessageList errorMsg = returnValue.getMessageList();
				this.setMessage( errorMsg );	
			}						
		}
		String OriginatingSubsidiaryCode = "";
		ReturnValue returnValue2 = logic.getSubsidiaryCode(strCustomerId,strRfpNo);
		GBS_RFP_stBean gBS_RFP_stBean = new GBS_RFP_stBean();
		gBS_RFP_stBean = (GBS_RFP_stBean)returnValue2.getDataValue();
		OriginatingSubsidiaryCode = gBS_RFP_stBean.getRfpSubsidiaryCode();
		ReturnValue returnValue3 = logic.getSubsidiaryName(gBS_RFP_stBean.getRfpSubsidiaryCode());

		ReturnValue returnValue1 = logic.getPresentationList(strCustomerId,strRfpNo);

		//Get data list			
		searchList =(List) returnValue1.getDataValue();		
		//put data
		thisForm.setLstPresentationList(searchList);
		thisForm.setSubsidiaryName(returnValue3.getDataValue()==null?"":returnValue3.getDataValue().toString());
		thisForm.setCustomerName(returnValue.getDataValue()==null?"":returnValue.getDataValue().toString());
		//whether Edit Button can show or not 
		if (thisForm.getLoginSubsidiaryCode2().equals(OriginatingSubsidiaryCode)) {
			thisForm.setEditflag(true);
		}else{
			thisForm.setEditflag(false);
		}
		return (mapping.findForward(nextview));

	}

	/**
	 * method download  
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */	
	public ActionForward download(
								  ActionMapping mapping,
								  ActionForm form,
								  HttpServletRequest request,
								  HttpServletResponse response)	throws Exception {
			log.info("[location info]GBS_PresentationAction.download method!");
			GBS_PresentationForm thisForm = (GBS_PresentationForm) form;
			this.setUserInfoFromSession( request, thisForm);

			// read data 
			String strCustomerId = thisForm.getCustomerId();
			String strRfpNo = thisForm.getRfpNo();
			String strLineNo = thisForm.getLineNo();
			GBS_PresentationActionLogic logic = new GBS_PresentationActionLogic(this.getDataSource(request));
			ReturnValue returnValue = logic.getAttachmentFile(strCustomerId,strRfpNo,strLineNo,response);		
			//BLOB blob = new BLOB();
			GBS_File_stBean gbsFilestBean = (GBS_File_stBean) returnValue.getDataValue();
		

			// set response data
//			response.reset();
//			response.setContentType("application");
//			response.setHeader("Content-disposition",
//							   "attachment;filename=" + gbsFilestBean.getFileName() );
//			OutputStream os=response.getOutputStream();
//			os.write( gbsFilestBean.getFileData() );	
//			os.close();
			return (null);
		}
										
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -