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

📄 planaction.java

📁 crm系统 有源码 及相关文档sql2005 数据库 客户反馈模块
💻 JAVA
字号:
package org.jb.y272.team0.web.action;

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 org.jb.common.web.action.BaseAction;

import org.jb.y272.team0.biz.ChanceBiz;
import org.jb.y272.team0.biz.PlanBiz;
import org.jb.y272.team0.entity.SalChance;
import org.jb.y272.team0.web.form.PlanForm;

/**
 *  Action Bean
 * @author hailong.liu
 */
public class PlanAction extends BaseAction {
	/**
	 * 制定计划
	 */
	public ActionForward toMake(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception{
		PlanForm myForm = (PlanForm)form;		
		String id = request.getParameter("id");
		SalChance item = this.chanceBiz.getWithPlans(Long.parseLong(id));
		myForm.setChance(item);
		return mapping.findForward("make");
	}
	/**
	 * 执行计划
	 */
	public ActionForward toExec(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception{
		PlanForm myForm = (PlanForm)form;		
		String id = request.getParameter("id");
		SalChance item = this.chanceBiz.getWithPlans(Long.parseLong(id));
		myForm.setChance(item);
		return mapping.findForward("exec");	
	}
	public ActionForward doExec(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception{
		PlanForm myForm = (PlanForm)form;
		this.planBiz.exec(myForm.getItem());
		String id = request.getParameter("id");
		response.sendRedirect("plan.do?o=toExec&id="+id);
		return null;
	}
	/**
	 * 开发成功
	 */
	public ActionForward doSuc(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception{
		String id = request.getParameter("id");
		this.chanceBiz.succes(Long.parseLong(id));
		response.sendRedirect("plan.do?o=toList");
		return null;
	}
	/**
	 * 开发失败
	 */
	public ActionForward doFail(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception{
		String id = request.getParameter("id");
		this.chanceBiz.fail(Long.parseLong(id));
		response.sendRedirect("plan.do?o=toList");
		return null;
	}
	/**
	 * 转到 查询页面
	 */
	public ActionForward toList(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception{
		PlanForm myForm = (PlanForm)form;
		myForm.getChance().setChcStatus("非新建");
		this.chanceBiz.search(myForm.getChance(), myForm.getPageResult());
		return mapping.findForward("list");
	}
	
	/**
	 * 执行 新建操作
	 */
	public ActionForward doAdd(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception{
		PlanForm myForm = (PlanForm)form;
		this.planBiz.add(myForm.getItem());
		String id = request.getParameter("id");
		response.sendRedirect("plan.do?o=toMake&id="+id);
		return null;
	}

	/**
	 * 执行 编辑操作
	 */
	public ActionForward doEdit(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception{
		PlanForm myForm = (PlanForm)form;
		this.planBiz.update(myForm.getItem());
		String id = request.getParameter("id");
		response.sendRedirect("plan.do?o=toMake&id="+id);
		return null;
	}
	
	/**
	 * 执行 删除操作
	 */
	public ActionForward doDel(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception{
		String pid = request.getParameter("pid");
		this.planBiz.del(Long.parseLong(pid));
		String id = request.getParameter("id");
		response.sendRedirect("plan.do?o=toMake&id="+id);
		return null;
	}
	
	/**
	 * 转到 明细页面
	 */
	public ActionForward doDetail(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception{
		PlanForm myForm = (PlanForm)form;		
		String id = request.getParameter("id");
		SalChance item = this.chanceBiz.getWithPlans(Long.parseLong(id));
		myForm.setChance(item);
		return mapping.findForward("detail");
	}
	
	/*	注入Biz方法 */
	private PlanBiz planBiz = null;
	public void setPlanBiz(PlanBiz planBiz){
		this.planBiz = planBiz; 
	}
	private ChanceBiz chanceBiz = null;
	public void setChanceBiz(ChanceBiz chanceBiz){
		this.chanceBiz = chanceBiz;  
	}
}

⌨️ 快捷键说明

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