基于JSP實現(xiàn)的項目管理平臺系統(tǒng)
作者主頁:
?簡介:Java領域優(yōu)質創(chuàng)作者、CSDN博客專家? Java項目、簡歷模板、學習資料、面試題庫、技術互助
文末獲取源碼
項目編號:BS-XX-022
本系統(tǒng)基于JSP,SERVLET實現(xiàn)開發(fā),前端采用layui框架實現(xiàn),數(shù)據(jù)庫采用MYSQL,開發(fā)工具采用IDEA或ECLIPSE。主要實現(xiàn)如下功能:
從管理員角度看:
用戶登入系統(tǒng)后,可以修改管理員的密碼。同時具有以下功能:
1、管理員可以管理具體項目信息。
2、管理員可以管理項目經(jīng)費信息。
3、管理員可以管理項目資源信息。
4、管理員可以管理項目進度信息。
5、管理員可以管理項目成果信息。
部分展示功能如下:admin / admin
后臺管理主界面

項目信息管理

項目經(jīng)費管理

項目資源管理

項目進度管理

項目成果管理

本項目基本功能完整,運行無誤,適合做畢業(yè)設計使用。
部門核心代碼:
package com.action;import java.io.IOException;import java.sql.ResultSet;import java.util.ArrayList;import java.util.Date;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 com.dao.DB;import com.orm.TChengguo;import com.util.DateUtils;public class chengguo_servlet extends HttpServlet{ public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException
{
? ? ? ?String type=req.getParameter("type"); if(type.endsWith("chengguoAdd"))
{
chengguoAdd(req, res);
} if(type.endsWith("chengguoMana"))
{
chengguoMana(req, res);
}
} public void chengguoAdd(HttpServletRequest req,HttpServletResponse res)
{
String xiangmu_id=req.getParameter("xiangmu_id");
String shijian=DateUtils.formatDate2Str(new Date(), "yyyy-MM-dd HH:mm:ss");
String mingcheng=req.getParameter("mingcheng");
String miaoshu=req.getParameter("miaoshu");
String fujian=req.getParameter("fujian");
String fujianYuanshiming=req.getParameter("fujianYuanshiming");
String sql="insert into t_chengguo (xiangmu_id,mingcheng,miaoshu,shijian,fujian,fujianYuanshiming)" + ? "values(?,?,?,?,?,?)";
Object[] params={xiangmu_id,mingcheng,miaoshu,shijian,fujian,fujianYuanshiming};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("message", "操作成功");
req.setAttribute("path", "chengguo?type=chengguoMana");
? ? ? ?String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
}
public void chengguoMana(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
String sql="select ta.*,tb.mingcheng xmmc from t_chengguo ta,t_xiangmu tb " + ? "where ta.xiangmu_id=tb.id and del='no'";
List chengguoList=new ArrayList();
Object[] params={};
DB mydb=new DB(); try
{
mydb.doPstm(sql, params);
ResultSet rs=mydb.getRs(); while(rs.next())
{
TChengguo chengguo=new TChengguo();
chengguo.setId(rs.getInt("id"));
chengguo.setXmmc(rs.getString("xmmc"));
chengguo.setShijian(rs.getString("shijian"));
chengguo.setMingcheng(rs.getString("mingcheng"));
chengguo.setMiaoshu(rs.getString("miaoshu"));
chengguo.setFujian(rs.getString("fujian"));
chengguo.setFujianYuanshiming(rs.getString("fujianYuanshiming"));
chengguoList.add(chengguo);
? ?}
rs.close();
} catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();
req.setAttribute("chengguoList", chengguoList);
req.getRequestDispatcher("admin/chengguo/chengguoMana.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()
{
}
}
package com.action;import java.io.IOException;import java.sql.ResultSet;import java.util.ArrayList;import java.util.Date;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 com.dao.DB;import com.orm.TJindu;import com.util.DateUtils;public class jindu_servlet extends HttpServlet{ public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException
{
? ? ? ?String type=req.getParameter("type"); if(type.endsWith("jinduAdd"))
{
jinduAdd(req, res);
} if(type.endsWith("jinduMana"))
{
jinduMana(req, res);
}
} public void jinduAdd(HttpServletRequest req,HttpServletResponse res)
{
String xiangmu_id=req.getParameter("xiangmu_id");
String shijian=req.getParameter("shijian");
String miaoshu=req.getParameter("miaoshu");
String baifenbi=req.getParameter("baifenbi");
String sql="insert into t_jindu (xiangmu_id,shijian,miaoshu,baifenbi) values(?,?,?,?)";
Object[] params={xiangmu_id,shijian,miaoshu,baifenbi};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("message", "操作成功");
req.setAttribute("path", "jindu?type=jinduMana");
? ? ? ?String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
}
public void jinduMana(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
String sql="select ta.*,tb.mingcheng from t_jindu ta,t_xiangmu tb " + ? "where ta.xiangmu_id=tb.id and del='no'";
List jinduList=new ArrayList();
Object[] params={};
DB mydb=new DB(); try
{
mydb.doPstm(sql, params);
ResultSet rs=mydb.getRs(); while(rs.next())
{
TJindu jindu=new TJindu();
jindu.setId(rs.getInt("id"));
jindu.setXmmc(rs.getString("mingcheng"));
jindu.setShijian(rs.getString("shijian"));
jindu.setMiaoshu(rs.getString("miaoshu"));
jindu.setBaifenbi(rs.getString("baifenbi"));
jinduList.add(jindu);
? ?}
rs.close();
} catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();
req.setAttribute("jinduList", jinduList);
req.getRequestDispatcher("admin/jindu/jinduMana.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()
{
}
}
package com.action;import java.io.IOException;import java.sql.ResultSet;import java.util.ArrayList;import java.util.Date;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 com.dao.DB;import com.orm.TJingfei;import com.util.DateUtils;public class jingfei_servlet extends HttpServlet{ public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException
{
? ? ? ?String type=req.getParameter("type"); if(type.endsWith("jingfeiAdd"))
{
jingfeiAdd(req, res);
} if(type.endsWith("jingfeiMana"))
{
jingfeiMana(req, res);
} if(type.endsWith("jingfeiDel"))
{
jingfeiDel(req, res);
}
} public void jingfeiAdd(HttpServletRequest req,HttpServletResponse res)
{
String xiangmu_id=req.getParameter("xiangmu_id");
String shijian=req.getParameter("shijian");
String jine=req.getParameter("jine");
String sql="insert into t_jingfei (xiangmu_id,jine,shijian) values(?,?,?)";
Object[] params={xiangmu_id,jine,shijian};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("message", "操作成功");
req.setAttribute("path", "jingfei?type=jingfeiMana");
? ? ? ?String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
} public void jingfeiDel(HttpServletRequest req,HttpServletResponse res)
{
String id=req.getParameter("id");
String sql="update t_jingfei set del='yes' where id=?";
Object[] params={id};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("message", "操作成功");
req.setAttribute("path", "jingfei?type=jingfeiMana");
? ? ? ?String targetURL = "/common/success.jsp";
dispatch(targetURL, req, res);
}
public void jingfeiMana(HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException
{
String sql="select ta.*,tb.mingcheng from t_jingfei ta,t_xiangmu tb " + ? "where ta.xiangmu_id=tb.id and del='no'";
List jingfeiList=new ArrayList();
Object[] params={};
DB mydb=new DB(); try
{
mydb.doPstm(sql, params);
ResultSet rs=mydb.getRs(); while(rs.next())
{
TJingfei jingfei=new TJingfei();
jingfei.setId(rs.getInt("id"));
jingfei.setXmmc(rs.getString("mingcheng"));
jingfei.setShijian(rs.getString("shijian"));
jingfei.setJine(rs.getString("jine"));
jingfeiList.add(jingfei);
? ?}
rs.close();
} catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();
req.setAttribute("jingfeiList", jingfeiList);
req.getRequestDispatcher("admin/jingfei/jingfeiMana.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()
{
}
}
package com.action;import com.jspsmart.upload.SmartUpload;import com.jspsmart.upload.SmartUploadException;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import java.io.IOException;public class SmartDownloadServlet extends HttpServlet { ? ?
? ?protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { ? ? ? ?this.doPost(req, resp);
? ?} ? ?
? ?protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { ? ? ? ?String filename = req.getParameter("filename"); ? ? ? ?SmartUpload su = new SmartUpload();
? ? ? ?su.initialize(getServletConfig(), req, resp); ? ? ? ?// 設置響應類型
? ? ? ?su.setContentDisposition(null); ? ? ? ?try {
? ? ? ? ? ?su.downloadFile(filename);
? ? ? ?} catch (SmartUploadException e) {
? ? ? ? ? ?e.printStackTrace();
? ? ? ?}
? ?}
}