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

📄 reportaction.java

📁 主要实现管理客户以及客户信息和其公司的服务管理
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package web.action;

import java.util.List;
import java.util.Map;

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

import org.apache.log4j.Logger;
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 web.condition.customers.CustomersCondition;
import web.form.ReportForm;
import biz.customers.CustomerBiz;
import biz.lost.ILostBIZ;
import biz.report.IReportBIZ;
import entity.Customers;
import entity.Lost;

/** 
 * MyEclipse Struts
 * Creation date: 10-25-2008
 * 
 * XDoclet definition:
 * @struts.action path="/report" name="reportForm" input="/html/~rept/contr.jsp" scope="request"
 */
public class ReportAction extends DispatchAction {
	/*
	 * Generated Methods
	 */
	Logger log = Logger.getLogger(ReportAction.class);
private IReportBIZ pbiz = null;
ILostBIZ lbiz = null;
CustomerBiz cbiz = null;
	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward toCustr(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		ReportForm reportForm = (ReportForm) form;// TODO Auto-generated method stub
		String name = reportForm.getName();
		String year = reportForm.getYear();
	
		Map<Customers,String> map = pbiz.contributeAnalyse(name,year);
		log.info("数据集合:"+map.size());
		request.setAttribute("map", map);
		return mapping.findForward("tocontr");
	}
	public ActionForward toCons(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		ReportForm reportForm = (ReportForm) form;// TODO Auto-generated method stub
		String type = reportForm.getType();
		Map<Object,String> map = pbiz.composingAnalyse(type);
		log.info("数据集合:"+map.size());
		request.setAttribute("map", map);
		return mapping.findForward("tocons");
	}
	public ActionForward toSer(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		ReportForm reportForm = (ReportForm) form;// TODO Auto-generated method stub
		String year  =reportForm.getYear();
		Map<String,Integer> map = pbiz.serviceAnalyse(year);
		log.info("数据集合:"+map.size());
		request.setAttribute("map", map);
		return mapping.findForward("toser");
	}
	public ActionForward toLost(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		ReportForm reportForm = (ReportForm) form;// TODO Auto-generated method stub
		Lost lost  =reportForm.getLost();
		lost.setStatus("3");
		if(lost.getMancondition()!=null&&""!=lost.getMancondition()){
			log.info("按客户经理查询...");
			CustomersCondition condition = new CustomersCondition();
			condition.setManager(lost.getMancondition());
			List list = cbiz.SearchList(condition);
			lost.setCondition(list);
		}
		log.info("状态:"+lost.getStatus());
		log.info("查询条件——客户:"+lost.getCuscondition());
		log.info("查询条件--客户经理:"+lost.getMancondition());
		/*加载暂缓流失客户信息*/
		List lostlist = lbiz.searchByCondition(lost);
		request.setAttribute("lostlist", lostlist);
		/*加载记录数*/
		int count = lbiz.getCount(lost);
		int flag = count%Integer.parseInt(lost.getMaxResults());
		int pages =count/Integer.parseInt(lost.getMaxResults());
		if(flag!=0){
			pages+=1;
		}
		request.setAttribute("count", count);
		request.setAttribute("pages", pages);
		log.info("当前页:"+lost.getPageNo());
		return mapping.findForward("tolost");
	}
	public IReportBIZ getPbiz() {
		return pbiz;
	}
	public void setPbiz(IReportBIZ pbiz) {
		this.pbiz = pbiz;
	}
	public ILostBIZ getLbiz() {
		return lbiz;
	}
	public void setLbiz(ILostBIZ lbiz) {
		this.lbiz = lbiz;
	}
	public CustomerBiz getCbiz() {
		return cbiz;
	}
	public void setCbiz(CustomerBiz cbiz) {
		this.cbiz = cbiz;
	}
}

⌨️ 快捷键说明

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