基于javaweb+mysql的ssm实验室预约维修管理系统(java+ssm+freemarker+bootstrap+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM实验室预约维修管理系统(java+ssm+freemarker+bootstrap+mysql)
项目介绍
本项目分为超级管理员、管理员、学生三种角色, 超级管理员角色包含以下功能: 通知管理、用户管理、实验室管理、实验室预约记录、设备管理、设备借用管理、设备维修管理等功能。
管理员角色包含以下功能: 通知管理、用户管理、实验室管理、实验室预约记录、实验室预约、设备管理、设备借用管理、设备维修管理等功能。
普通学生角色包含以下功能:
通知管理、用户管理、实验室管理、设备借用管理等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 8.0版本; 6.是否Maven项目:是;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:freemarker+bootstrap
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中config.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录
map.put("list", list);
session.setAttribute("p", 1);
return "admin/user_list";
// 模糊查询并分页
@RequestMapping("admin/userListQuery.do")
public String useListQuery(@RequestParam(value = "page", required = false) String page, HttpSession session,
ModelMap map,Sysuser user) {
if (page == null || page.equals("")) {
page = "1";
PageBean pageBean = new PageBean(Integer.parseInt(page), PageBean.PAGESIZE);
Map<String, Object> pmap = new HashMap<String, Object>();
pmap.put("pageno", pageBean.getStart());
shiYan.setIsdel("1");
shiYan.setPubtime(time.toString().substring(0, 19));
ShiYanService.add(shiYan);
return "redirect:HaoCaiList.do";
@RequestMapping("admin/doUpdateHaoCai.do")
public String doUpdateHaoCai(ModelMap map,int id){
map.put("sy", ShiYanService.getById(id));
return "admin/update_HaoCai";
@RequestMapping("admin/updateHaoCai.do")
public String updateHaoCai(HttpServletRequest request,ShiYan ShiYan){
ShiYanService.update(ShiYan);
public String addReg(Sysuser user, HttpSession session) {
user.setIsdel("1");
user.setUtype("会员");
Timestamp time=new Timestamp(System.currentTimeMillis());
user.setPubtime(time.toString());
userService.add(user);
return "fore_login";
// 添加用户
@RequestMapping("admin/addUser.do")
public String addUser(Sysuser user, HttpSession session) {
user.setIsdel("1");
Timestamp time=new Timestamp(System.currentTimeMillis());
user.setPubtime(time.toString());
} else {
map.put("errorInfo", "用户名或者密码错误!");
return "admin/login";
// 后台注销登录
@RequestMapping("admin/loginout.do")
public String adminLoginOut(HttpSession session) {
session.removeAttribute("auser");
return "redirect:login.do";
// 前台注销登录
@RequestMapping("loginout.do")
return "admin/list_HaoCai";
@RequestMapping("admin/deleteHaoCai.do")
public String deleteHaoCai(int id){
ShiYanService.delete(id);
return "redirect:HaoCaiList.do";
公告管理控制层:
@Controller
public class NewsController {
@Resource
private NewsServer newsService;
@Resource
private ForderServer ForderService;
@Resource
page="1";
PageBean pageBean=new PageBean(Integer.parseInt(page), PageBean.PAGESIZE);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", pageBean.getPageSize());
Map<String, Object> cmap=new HashMap<String, Object>();
pmap.put("ftype", null);
cmap.put("name", null);
cmap.put("ftype", "耗材");
pmap.put("ftype", "耗材");
int total=ShiYanService.getCount(cmap);
pageBean.setTotal(total);
List<ShiYan> list=ShiYanService.getByPage(pmap);
List<ShiYan> list=ShiYanService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "admin/list_ShiYan";
// 分页模糊查询
@RequestMapping("admin/vagueShiYanList.do")
public String vagueShiYanList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,ShiYan cd){
if(page==null||page.equals("")){
System.out.println("file==="+file);
String fileName=file.getOriginalFilename();
System.out.println("fileName==="+fileName);
File targetFile=new File(path,fileName);
if(!targetFile.exists()){
targetFile.mkdirs();
try {
file.transferTo(targetFile);
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
PrintWriter out=null;
try {
out=response.getWriter();
out.print(obj);
out.flush();
} catch (IOException e) {
e.printStackTrace();
}finally{
out.close();
// 验证用户名是否存在
@RequestMapping("checkUname.do")
public void checkReg(Sysuser user,HttpServletResponse response){
Map map=new HashMap();
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
String pa=request.getContextPath()+"/upload/"+fileName;
System.out.println("path==="+pa);
if(fileName!=null&&!fileName.equals("")){
img=fileName;
}else{
img="zanwu.jpg";
return img;
public String checkLogin(ModelMap map,Sysuser user, HttpSession session) {
Map<String,Object> u=new HashMap<String,Object>();
System.out.println("name===" + user.getUname());
System.out.println("pwd===" + user.getPwd());
u.put("uname",user.getUname());
u.put("utype", user.getUtype());
u.put("pwd",user.getPwd());
user = userService.adminLogin(u);
if (user != null) {
session.setAttribute("auser", user);
System.out.println("auser=" + user);
System.out.println("uname233333333333===");
obj.put("info", "ng");
}else{
System.out.println("uname255555555555555===");
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) {
pmap.put("pageSize", pageBean.getPageSize());
int total=newsService.getCount(null);
pageBean.setTotal(total);
List<News> list=newsService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 2);
return "admin/list_news";
@RequestMapping("admin/deleteNews.do")
public String deleteNews(int id){
newsService.delete(id);
return "redirect:newsList.do";
File targetFile=new File(path,fileName);
if(!targetFile.exists()){
targetFile.mkdirs();
try {
file.transferTo(targetFile);
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
String pa=request.getContextPath()+"/upload/"+fileName;
System.out.println("path==="+pa);
if(fileName!=null&&!fileName.equals("")){
img=fileName;
@RequestMapping("admin/doUpdateSheBei.do")
public String doUpdateSheBei(ModelMap map,int id){
map.put("sy", ShiYanService.getById(id));
return "admin/update_SheBei";
// 处理申请设备
@RequestMapping("admin/doAddForderSheBei.do")
public String doAddForderSheBei(ModelMap map,int id){
map.put("sy", ShiYanService.getById(id));
return "admin/add_order_sheBei";
// 处理申请耗材
@RequestMapping("admin/doAddForderHaoCai.do")
public String doAddForderHaoCai(ModelMap map,int id){
map.put("sy", ShiYanService.getById(id));
return "admin/add_order_haoCai";
news.setGgpic(img);
newsService.update(news);
return "redirect:newsList.do";
// 分页
@RequestMapping("fnewsList.do")
public String newsList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session){
if(page==null||page.equals("")){
page="1";
PageBean pageBean=new PageBean(Integer.parseInt(page), PageBean.PAGESIZE);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
img=null;
return img;
// 后台登录
@RequestMapping("admin/alogin.do")
public String checkLogin(ModelMap map,Sysuser user, HttpSession session) {
Map<String,Object> u=new HashMap<String,Object>();
System.out.println("name===" + user.getUname());
System.out.println("pwd===" + user.getPwd());
u.put("uname",user.getUname());
u.put("utype", user.getUtype());
u.put("pwd",user.getPwd());
user = userService.adminLogin(u);