基于JSP实现的项目管理平台系统

简介: 基于JSP实现的项目管理平台系统

 项目编号:BS-XX-022


本系统基于JSP,SERVLET实现开发,前端采用layui框架实现,数据库采用MYSQL,开发工具采用IDEA或ECLIPSE。主要实现如下功能:


从管理员角度看:


用户登入系统后,可以修改管理员的密码。同时具有以下功能:


1、管理员可以管理具体项目信息。


2、管理员可以管理项目经费信息。


3、管理员可以管理项目资源信息。


4、管理员可以管理项目进度信息。


5、管理员可以管理项目成果信息。


部分展示功能如下:admin / admin


http://localhost/login.jsp


后台管理主界面

image.png

项目信息管理

image.png

项目经费管理

image.png

项目资源管理

image.png

项目进度管理

image.png

项目成果管理

image.png

本项目基本功能完整,运行无误,适合做毕业设计使用。

部门核心代码:

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 {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req, resp);
    }
    @Override
    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();
        }
    }
}
相关文章
|
1月前
|
前端开发 Java 关系型数据库
JSP实现网上招标系统
JSP实现网上招标系统
|
1月前
|
Java 数据安全/隐私保护
基于JSP实现网上商城系统
基于JSP实现网上商城系统
|
1月前
|
Java 数据安全/隐私保护 计算机视觉
基于JSP/SERVLET实现的人脸识别考勤系统(二)
基于JSP/SERVLET实现的人脸识别考勤系统
|
1月前
|
Java 关系型数据库 数据库
基于JSP/SERVLET实现的人脸识别考勤系统(一)
基于JSP/SERVLET实现的人脸识别考勤系统
|
1月前
|
安全 Java
javaweb实训第四天下午——员工管理系统-JSP&Servlet&JDBC综合练习-CRUD
1.课程介绍 Servlet细节; (掌握) 员工信息相关的CRUD; (掌握) 部门信息相关的CRUD; (掌握) 2.Servlet细节 2.1.多种匹配方式
32 0
|
1月前
|
前端开发 Java BI
Servlet+Jsp+JDBC实现房屋租赁管理系统(源码+数据库+论文+系统详细配置指导+ppt)
Servlet+Jsp+JDBC实现房屋租赁管理系统(源码+数据库+论文+系统详细配置指导+ppt)
|
1月前
|
XML 安全 Java
JavaWeb有机果蔬商城系统有机蔬菜水果商城系统(分前后台javaWeb+jsp+jstl+css+js+mysql)
JavaWeb有机果蔬商城系统有机蔬菜水果商城系统(分前后台javaWeb+jsp+jstl+css+js+mysql)
|
2月前
|
设计模式 前端开发 Java
了解 Spring MVC 架构、Dispatcher Servlet 和 JSP 文件的关键作用
Spring MVC 是 Spring 框架的一部分,是一个 Web 应用程序框架。它旨在使用 Model-View-Controller(MVC) 设计模式轻松构建Web应用程序。
39 0
|
8天前
|
Java
jsp页面中使用jstl标签报错:javax.servlet.jsp.JspTagException
jsp页面中使用jstl标签报错:javax.servlet.jsp.JspTagException
7 0
|
1月前
|
存储 前端开发 Java
JavaWeb:servlet+jsp+mybatis商品管理增删改查
商品管理通常包括增加(添加)、删除、修改和查询商品信息
30 1
JavaWeb:servlet+jsp+mybatis商品管理增删改查

相关产品

  • 云迁移中心
  • 相关课程

    更多