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

📄 gbs_replyfromaction.java

📁 对日软件外包 为东芝做的一个全球商业管理系统
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
						mailPasswd = BaseCommonCheck.convertNullToSpace(stBean.getString3());
						break;
					}
				}
			}

			//Get mail server
			String url = "";
			returnValue = logic.getWideUse("URL");
			if (returnValue.isError()) {
				if (returnValue.isBussinessError()) {
					this.setMessage(returnValue.getMessageList());
				}
				return (mapping.findForward(nextview));
			} else {
				ArrayList tmpList = (ArrayList) returnValue.getDataValue();
				if (tmpList != null && tmpList.size() > 0) {
					GBS_MWideUse_stBean stBean = (GBS_MWideUse_stBean) tmpList.get(0);
					url = BaseCommonCheck.convertNullToSpace(stBean.getString1());
				}
			}
			if (!url.equals("")) {
				//http://localhost:8080/gbs/GBS_login.do?method=init&customerId=marine&rfpNo=2&jumpTo=request
				url += "GBS_login.do?method=init&jumpTo=reply&customerId=";
				url += thisform.getCustomerID();
				url += "&rfpNo=";
				url += thisform.getRfpNo();
			}
			//Get replyTo
			ArrayList replyTo = new ArrayList();
			returnValue = logic.getWideUse("SMTP");
			if (returnValue.isError()) {
			} else {
				ArrayList tmpList = (ArrayList) returnValue.getDataValue();
				String returnPath = "";
				for (int i = 0; tmpList != null && i < tmpList.size(); i++) {
					GBS_MWideUse_stBean stBean = (GBS_MWideUse_stBean) tmpList.get(i);
					if ("Return-Path".equals(stBean.getMainKey())) {
						returnPath = stBean.getString1();
						break;
					}
				}
				while (returnPath.lastIndexOf(",") > 0) {
					replyTo.add(returnPath.substring(returnPath.lastIndexOf(",") + 1));
					returnPath = returnPath.substring(0, returnPath.lastIndexOf(","));
				}
				replyTo.add(returnPath);
			}

			String subject = "GBS Alert Mail(\"Reply to Customer\",\"" + thisform.getCustomerName() + "\")";

			if (mailList != null && mailList.size() > 0 && !url.equals("") && !smtpServer.equals("")) {
				SendMail sendMail = new SendMail();
				sendMail.sendMailList(
					mailList,
					thisform.getLoginEmail(),
					smtpServer,
					subject,
					url,
					mailUser,
					mailPasswd,
					replyTo);
			}
		}

		this.setSuccessInfo(
			request,
			"00000006",
			"./GBS_reply.do?method=init&customerID=" + thisform.getCustomerID() + "&rfpNo=" + thisform.getRfpNo());
		return (mapping.findForward(success));
	}

	/**
	 * subPageSubmit
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward subPageSubmit(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception {

		log.info("[location info]GBS_ReplyFromAction.subPageSubmit method!");

		GBS_ReplyFromForm requestForm = (GBS_ReplyFromForm) form;

		//get login user info from session
		this.setUserInfoFromSession(request, requestForm);

		ArrayList replyAttachment = (ArrayList) this.getFromSession(request, REPLYATTACHLIST);
		ArrayList searchList = new ArrayList();
		String replyKbn = requestForm.getReply();
		for (int i = 0; replyAttachment != null && i < replyAttachment.size(); i++) {
			GBS_ReplyList_stBean replyListBean = (GBS_ReplyList_stBean) replyAttachment.get(i);
			if (!replyListBean.getRecordDeleteFlg() && replyKbn.equals(replyListBean.getReplyKbn())) {
				searchList.add(replyListBean);
			}
		}
		requestForm.setReplyList(searchList);
		return (mapping.findForward(nextview));
	}

	/**
	 * 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_ReplyFromAction.download method!");
		GBS_ReplyFromForm thisForm = (GBS_ReplyFromForm) form;
		this.setUserInfoFromSession(request, thisForm);

		String lineNo = thisForm.getLineNo();
		String seqNo = thisForm.getSeqNo();
		String customerID = thisForm.getCustomerID();
		String rfpNo = thisForm.getRfpNo();
		String replyKbn = thisForm.getReplyKbn();
		String subCode = thisForm.getSubCode();
		GBS_ReplyList_stBean replyListBean = null;

		if ((lineNo != null && !lineNo.equals("")) || (seqNo != null && !seqNo.equals(""))) {
			//read data from session;
			ArrayList replyAttachList = (ArrayList) this.getFromSession(request, REPLYATTACHLIST);
			for (int i = 0; replyAttachList != null && i < replyAttachList.size(); i++) {
				replyListBean = (GBS_ReplyList_stBean) replyAttachList.get(i);
				if (lineNo.equals(replyListBean.getLineNo())
					&& customerID.equals(replyListBean.getCustomerID())
					&& rfpNo.equals(replyListBean.getRfpNo())
					&& replyKbn.equals(replyListBean.getReplyKbn())
					&& subCode.equals(replyListBean.getSubCode())
					&& seqNo.equals(replyListBean.getSeqNo())) {
					break;
				}
			}
		}

		// read data 
		GBS_ReplyFromActionLogic logic = new GBS_ReplyFromActionLogic(this.getDataSource(request));
		ReturnValue returnValue = logic.getAttachmentFile(replyListBean, response);

		//		String replyKbn=thisForm.getReply();
		//		ArrayList replyAttachment = ( ArrayList ) this.getFromSession( request, REPLYATTACHLIST);
		//		ArrayList searchList = new ArrayList();
		//		for ( int i = 0 ; replyAttachment != null && i < replyAttachment.size(); i ++ ){
		//			GBS_ReplyList_stBean replyBean = ( GBS_ReplyList_stBean ) replyAttachment.get( i );
		//			if ( !replyListBean.getRecordDeleteFlg() && replyKbn.equals(replyListBean.getReplyKbn())) {
		//				searchList.add( replyBean );
		//			}
		//		}		
		//		thisForm.setReplyList( searchList );	
		return (null);
	}

	/**
	 * changeReplyKbn
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward changeReplyKbn(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception {

		log.info("[location info]GBS_ReplyFromAction.subPageSubmit method!");

		GBS_ReplyFromForm requestForm = (GBS_ReplyFromForm) form;

		//get login user info from session
		this.setUserInfoFromSession(request, requestForm);
		String replyKbn = requestForm.getReply();
		ArrayList replyAttachment = (ArrayList) this.getFromSession(request, REPLYATTACHLIST);
		ArrayList searchList = new ArrayList();
		for (int i = 0; replyAttachment != null && i < replyAttachment.size(); i++) {
			GBS_ReplyList_stBean replyListBean = (GBS_ReplyList_stBean) replyAttachment.get(i);
			if (!replyListBean.getRecordDeleteFlg() && replyKbn.equals(replyListBean.getReplyKbn())) {
				searchList.add(replyListBean);
			}
		}
		requestForm.setReplyList(searchList);

		ArrayList subsidiaryCodeList = new ArrayList();
		ReturnValue returnValue = new ReturnValue();
		GBS_ReplyFromActionLogic logic = new GBS_ReplyFromActionLogic(this.getDataSource(request));
		returnValue = (ReturnValue) logic.getRfpCountryInfo(requestForm.getCustomerID(), requestForm.getRfpNo());
		if (returnValue.isError()) {
			if (returnValue.isBussinessError()) {
				this.setMessage(returnValue.getMessageList());
			}
			//getErrorCode,getErrorMessage proc
		} else {
			ArrayList RfpCountryList = (ArrayList) returnValue.getDataValue();
			//get ParticipatingSubsidiaries
			for (int i = 0; RfpCountryList != null && i < RfpCountryList.size(); i++) {
				GBS_RfpCountry_stBean RfpCountry_stBean = (GBS_RfpCountry_stBean) RfpCountryList.get(i);
				subsidiaryCodeList.add(RfpCountry_stBean.getSubsidiaryCode());
			}
		}
		//get OriginatingSubsidiaryCode
		String OriginatingSubsidiaryCode = "";
		returnValue = (ReturnValue) logic.getRfpInfo(requestForm.getCustomerID(), requestForm.getRfpNo());
		if (returnValue.isError()) {
			if (returnValue.isBussinessError()) {
				this.setMessage(returnValue.getMessageList());
			}
			//getErrorCode,getErrorMessage proc
		} else {
			GBS_RFP_stBean RFP_stBean = (GBS_RFP_stBean) returnValue.getDataValue();
			if (RFP_stBean != null) {
				OriginatingSubsidiaryCode = RFP_stBean.getRfpSubsidiaryCode();
			}
		}
		//whether Edit Button can show or not 
		if("1".equals(requestForm.getSubFlag())){
			for (int i = 0; i < subsidiaryCodeList.size(); i++) {
				if (requestForm.getLoginSubsidiaryCode2().equals(subsidiaryCodeList.get(i))) {
					requestForm.setEditflag(true);
					break;
				}else{
					requestForm.setEditflag(false);
				}
			}
		}else{
			if (requestForm.getLoginSubsidiaryCode2().equals(OriginatingSubsidiaryCode)) {
				requestForm.setEditflag(true);
			}else{
				requestForm.setEditflag(false);
			}
		}
		return (mapping.findForward(nextview));
	}

}

⌨️ 快捷键说明

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