本系统采用B/S模式,主要实现的功能如下:
系统管理:该模块实现的功能有系统属性、管理员维护、修改密码。主要是对系统的维护信息的分析;
贫困户管理:该模块实现的功能有村镇管理、添加村镇、贫困户管理、添加贫困户;
扶贫管理:该模块主要是扶贫管理、添加扶贫、统计汇总;
工作人员管理:该模块主要是工作人员管理和添加工作人员。
package com.action;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.directwebremoting.WebContext;
import org.directwebremoting.WebContextFactory;
import com.dao.DB;
import com.orm.Tongji;
import com.orm.TongjiA;
import com.orm.TAdmin;
import com.orm.Tpinkunhu;
import com.orm.Tfupin;
import com.orm.Yuangong;
import com.service.liuService;
public class tongji_servlet extends HttpServlet
{
public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException
{
String type=req.getParameter("type");
if(type.endsWith("tongjiMana"))
{
tongjiMana(req, res);
}
}
public void tongjiMana(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
List tongjiList=new ArrayList();
String sql="SELECT COUNT(pinkunhu_id) as fupin,t_pinkunhu.`name` FROM t_fupin LEFT JOIN t_pinkunhu ON t_pinkunhu.id=t_fupin.pinkunhu_id GROUP BY pinkunhu_id";
Object[] params={};
DB mydb=new DB();
try
{
mydb.doPstm(sql, params);
ResultSet rs=mydb.getRs();
while(rs.next())
{
TongjiA tongji=new TongjiA();
tongji.setName(rs.getString("name"));
tongji.setFupin(rs.getString("fupin"));
tongjiList.add(tongji);
}
rs.close();
}
catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();
req.setAttribute("tongjiList", tongjiList);
req.getRequestDispatcher("admin/tongji/tongjiMana.jsp").forward(req, res);
}
public void tongjiMana2(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
List tongjiList =new ArrayList();
List<Integer> pinkunhu_id_list=liuService.getAllPinkunhu_id();
for(int i=0;i<pinkunhu_id_list.size();i++)
{
int pinkunhu_id=pinkunhu_id_list.get(i);
int tongjiShuliang=liuService.getPinkunhufupinShuliang(pinkunhu_id)-liuService.getPinkunhuChukuShuliang(pinkunhu_id);
Tongji tongji=new Tongji();
tongji.setPinkunhu_id(pinkunhu_id);
tongji.setTongji(tongjiShuliang);
tongji.setPinkunhu_name(liuService.getPinkunhuName(pinkunhu_id));
tongjiList.add(tongji);
}
req.setAttribute("tongjiList", tongjiList);
req.getRequestDispatcher("admin/tongji/tongjiMana.jsp").forward(req, res);
}
public void dispatch(String targetURI,HttpServletRequest request,HttpServletResponse response)
{
RequestDispatcher dispatch = getServletContext().getRequestDispatcher(targetURI);
try
{
dispatch.forward(request, response);
return;
}
catch (ServletException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
}
public void init(ServletConfig config) throws ServletException
{
super.init(config);
}
public void destroy()
{
}
}