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

📄 lostaction.java

📁 关于ssh的整合,希望对大家有帮助
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package crm.web.action.cst;



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

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

import crm.biz.cst.LostBiz;
import crm.entity.cst.LostEntity;
import crm.web.form.cst.LostForm;

/** 
 * MyEclipse Struts
 * Creation date: 09-23-2008
 * 
 * XDoclet definition:
 * @struts.action path="/lost" name="lostForm" parameter="flag" scope="request" validate="true"
 */
public class LostAction extends DispatchAction {

	private LostBiz lostBiz=null;
	
	
	/**
	 * 客户流失管理  跳转到 youzi/lost/list.jsp 页面
	 */
	public ActionForward list(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		request.getSession().setAttribute("list", lostBiz.findAll());
		return mapping.findForward("list");
	}

	/**
	 * 确认流失  在 youzi/lost/list.jsp页面。经过confirm()方法。
	 *          程序跳转到 youzi/lost/confirm.jsp 页面
	 */
	public ActionForward confirm(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		String id=request.getParameter("id");
		System.out.println("确认流失编号:"+id);
		request.getSession().setAttribute("lost",lostBiz.findById(Long.parseLong(id)));
		return mapping.findForward("confirm");
	}
	
	/**
	 * 执行保存。在youzi/lost/confirm.jsp页面执行保存.并跳转到 youzi/lost/list.jsp 页面
	 */
	public ActionForward baocun(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		HttpSession session=request.getSession();
		//session.getAttribute("lost") 从session中取出流失客户的信息。强制转换成LostEntity类型
		LostEntity le=(LostEntity)session.getAttribute("lost");
		//从页面获得流失原因,将其放到le.setLstReason()方法里;
		String lstReason=request.getParameter("lstReason");
		le.setLstReason(lstReason);
		lostBiz.update(le);
		return mapping.findForward("tolist");
		
	}
	
	
	/**
	 * 查询  在 youzi/lost/list.jsp 页面进行查询
	 */
	public ActionForward search(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		LostForm lf = (LostForm) form;  //from里封装了表单里的数据
		request.setAttribute("list", lostBiz.doQuery(lf.getEntity()));
		//根据 "list" 在 struts-config.xml 找到对应的Action 并跳转到对应的JSP页面 
		return mapping.findForward("list");
	}
	

	/**
	 * 执行暂缓流失。并跳转到 youzi/lost/relay.jsp 页面
	 */
	public ActionForward relay(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		String id=request.getParameter("id");
		System.out.println("relay方法里流失编号 :"+id);
		request.getSession().setAttribute("lost",lostBiz.findById(Long.parseLong(id)));
		return mapping.findForward("relay");
	}
	
	/**
	 * 暂缓流失-->保存 relay.jsp页面  并跳转到youzi/lost/list.jsp页面
	 */
	public ActionForward save(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		//从relay.jsp页面获得暂缓措施
		String lstDelay=request.getParameter("lstDelay");
		HttpSession session=request.getSession();
//		session.getAttribute("lost") 从session中取出流失客户的信息。强制转换成LostEntity类型
		LostEntity le=(LostEntity)session.getAttribute("lost");
		le.setLstDelay(lstDelay);
		lostBiz.update(le);
		return mapping.findForward("tolist");
	}
	
	
	public void setLostBiz(LostBiz lostBiz) {
		this.lostBiz = lostBiz;
	}
	
	
}

⌨️ 快捷键说明

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