收藏关注不迷路!!
🌟文末获取源码+数据库🌟
感兴趣的可以先收藏起来,还有大家在毕设选题(免费咨询指导选题),项目以及论文编写等相关问题都可以给我留言咨询,希望帮助更多的人
文章目录
摘要
本学生网上请假系统是针对目前学生网上请假系统的实际需求,从实际工作出发,对过去的学生网上请假系统存在的问题进行分析,结合计算机系统的结构、概念、模型、原理、方法,在计算机各种优势的情况下,采用目前最流行的ssm框架和eclipse编辑器、mysql数据库设计并实现的 。本学生网上请假系统主要包括登录模块、基础信息模块、班级信息管理模块、用户权限管理模块、和退出模块等多个模块。它帮助学生网上请假系统实现了信息化、网络化,通过测试,实现了系统设计目标,相比传统的管理模式,本系统合理的利用了网络数据资源,有效的减少了学生网上请假系统的经济投入,大大提高了学生网上请假系统的效率。
关键词:ssm;mysql;学生网上请假系统
一、开发技术介绍
- SSM
- MySQL
- Java
- B/S 架构
二、功能介绍
系统设计主要是管理员登录后对整个系统相关操作进行处理,可进行管理员的添加和删除,班级信息管理、学生请假管理、基础信息、用户权限管理等操作管理。
系统的功能结构图如下图所示。
三、代码展示
package com.controller;
import java.io.File;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.PrintWriter;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import com.entity.Xueshengxinxi;
import com.server.XueshengxinxiServer;
import com.util.PageBean;
import net.sf.json.JSONObject;
import com.util.db;
import java.sql.SQLException;
import java.sql.*;
@Controller
public class XueshengxinxiController {
@Resource
private XueshengxinxiServer xueshengxinxiService;
@RequestMapping("addXueshengxinxi.do")
public String addXueshengxinxi(HttpServletRequest request,Xueshengxinxi xueshengxinxi,HttpSession session) throws SQLException{
Timestamp time=new Timestamp(System.currentTimeMillis());
xueshengxinxi.setAddtime(time.toString().substring(0, 19));
xueshengxinxiService.add(xueshengxinxi);
session.setAttribute("backxx", "添加成功");
session.setAttribute("backurl", request.getHeader("Referer"));
//session.setAttribute("backurl", "xueshengxinxiList.do");
return "redirect:postback.jsp";
//return "redirect:xueshengxinxiList.do";
}
// 处理编辑
@RequestMapping("doUpdateXueshengxinxi.do")
public String doUpdateXueshengxinxi(int id,ModelMap map,Xueshengxinxi xueshengxinxi){
xueshengxinxi=xueshengxinxiService.getById(id);
map.put("xueshengxinxi", xueshengxinxi);
return "xueshengxinxi_updt";
}
@RequestMapping("doUpdateXueshengxinxi2.do")
public String doUpdateXueshengxinxi2(ModelMap map,Xueshengxinxi xueshengxinxi,HttpServletRequest request){
xueshengxinxi=xueshengxinxiService.getById(Integer.parseInt((String)request.getSession().getAttribute("uid")));
map.put("xueshengxinxi", xueshengxinxi);
return "xueshengxinxi_updt2";
}
@RequestMapping("updateXueshengxinxi2.do")
public String updateXueshengxinxi2(int id,ModelMap map,Xueshengxinxi xueshengxinxi){
xueshengxinxiService.update(xueshengxinxi);
return "redirect:doUpdateXueshengxinxi2.do";
}
// 后台详细
@RequestMapping("xueshengxinxiDetail.do")
public String xueshengxinxiDetail(int id,ModelMap map,Xueshengxinxi xueshengxinxi){
xueshengxinxi=xueshengxinxiService.getById(id);
map.put("xueshengxinxi", xueshengxinxi);
return "xueshengxinxi_detail";
}
// 前台详细
@RequestMapping("xsxxDetail.do")
public String xsxxDetail(int id,ModelMap map,Xueshengxinxi xueshengxinxi){
xueshengxinxi=xueshengxinxiService.getById(id);
map.put("xueshengxinxi", xueshengxinxi);
return "xueshengxinxidetail";
}
//
@RequestMapping("updateXueshengxinxi.do")
public String updateXueshengxinxi(int id,ModelMap map,Xueshengxinxi xueshengxinxi,HttpServletRequest request,HttpSession session){
xueshengxinxiService.update(xueshengxinxi);
session.setAttribute("backxx", "修改成功");
session.setAttribute("backurl", request.getHeader("Referer"));
return "redirect:postback.jsp";
//String url = request.getHeader("Referer");
//return "redirect:"+url;
//return "redirect:xueshengxinxiList.do";
}
// 分页查询
@RequestMapping("xueshengxinxiList.do")
public String xueshengxinxiList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Xueshengxinxi xueshengxinxi, String xuehao, String mima, String xingming, String xingbie, String yuanxi, String banji, String lianxidianhua, String jianjie){
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page), 15);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", 15);
if(xuehao==null||xuehao.equals("")){pmap.put("xuehao", null);}else{pmap.put("xuehao", xuehao);}
if(mima==null||mima.equals("")){pmap.put("mima", null);}else{pmap.put("mima", mima);}
if(xingming==null||xingming.equals("")){pmap.put("xingming", null);}else{pmap.put("xingming", xingming);}
if(xingbie==null||xingbie.equals("")){pmap.put("xingbie", null);}else{pmap.put("xingbie", xingbie);}
if(yuanxi==null||yuanxi.equals("")){pmap.put("yuanxi", null);}else{pmap.put("yuanxi", yuanxi);}
if(banji==null||banji.equals("")){pmap.put("banji", null);}else{pmap.put("banji", banji);}
if(lianxidianhua==null||lianxidianhua.equals("")){pmap.put("lianxidianhua", null);}else{pmap.put("lianxidianhua", lianxidianhua);}
if(jianjie==null||jianjie.equals("")){pmap.put("jianjie", null);}else{pmap.put("jianjie", jianjie);}
int total=xueshengxinxiService.getCount(pmap);
pageBean.setTotal(total);
List<Xueshengxinxi> list=xueshengxinxiService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "xueshengxinxi_list";
}
@RequestMapping("xsxxList.do")
public String xsxxList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Xueshengxinxi xueshengxinxi, String xuehao, String mima, String xingming, String xingbie, String yuanxi, String banji, String lianxidianhua, String jianjie){
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page), 15);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", 15);
if(xuehao==null||xuehao.equals("")){pmap.put("xuehao", null);}else{pmap.put("xuehao", xuehao);}
if(mima==null||mima.equals("")){pmap.put("mima", null);}else{pmap.put("mima", mima);}
if(xingming==null||xingming.equals("")){pmap.put("xingming", null);}else{pmap.put("xingming", xingming);}
if(xingbie==null||xingbie.equals("")){pmap.put("xingbie", null);}else{pmap.put("xingbie", xingbie);}
if(yuanxi==null||yuanxi.equals("")){pmap.put("yuanxi", null);}else{pmap.put("yuanxi", yuanxi);}
if(banji==null||banji.equals("")){pmap.put("banji", null);}else{pmap.put("banji", banji);}
if(lianxidianhua==null||lianxidianhua.equals("")){pmap.put("lianxidianhua", null);}else{pmap.put("lianxidianhua", lianxidianhua);}
if(jianjie==null||jianjie.equals("")){pmap.put("jianjie", null);}else{pmap.put("jianjie", jianjie);}
int total=xueshengxinxiService.getCount(pmap);
pageBean.setTotal(total);
List<Xueshengxinxi> list=xueshengxinxiService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "xueshengxinxilist";
}
@RequestMapping("deleteXueshengxinxi.do")
public String deleteXueshengxinxi(int id,HttpServletRequest request){
xueshengxinxiService.delete(id);
String url = request.getHeader("Referer");
return "redirect:"+url;
//return "redirect:xueshengxinxiList.do";
}
@RequestMapping("quchongXueshengxinxi.do")
public void quchongXueshengxinxi(Xueshengxinxi xueshengxinxi,HttpServletResponse response){
Map<String,Object> map=new HashMap<String,Object>();
map.put("xuehao", xueshengxinxi.getXuehao());
System.out.println("xuehao==="+xueshengxinxi.getXuehao());
System.out.println("xuehao222==="+xueshengxinxiService.quchongXueshengxinxi(map));
JSONObject obj=new JSONObject();
if(xueshengxinxiService.quchongXueshengxinxi(map)!=null){
obj.put("info", "ng");
}else{
obj.put("info", "学号可以用!");
}
response.setContentType("text/html;charset=utf-8");
PrintWriter out=null;
try {
out=response.getWriter();
out.print(obj);
out.flush();
} catch (IOException e) {
e.printStackTrace();
}finally{
out.close();
}
}
}
四、效果图
五 、源码获取
下方名片联系我即可!!
大家点赞、收藏、关注、评论啦 、查看👇🏻获取联系方式👇🏻