——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven实验室预约维修管理系统(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/ 登录
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 @ResponseBody @GetMapping("selectAllAdminList") public Object selectAllAdminList (Integer pageNo, Integer pageSize, String stunumber, String phone, String classs, String realname, Integer userId) { return userService.selectAllAdminList(pageNo, pageSize, stunumber, phone, classs, realname, userId); } @ResponseBody @GetMapping("selectAllUserListByPrimaryKey") public Object selectAllUserListByPrimaryKey (Integer id) { return userService.selectAllUserListByPrimaryKey(id); } @ResponseBody @PutMapping("updateByPrimaryKeySelective") public Object updateByPrimaryKeySelective (UserXO userXO) { int i = userService.updateByPrimaryKeySelective(userXO); if (i > 0 ) { map.put("resultCode" , "200" ); map.put("resultMessage" , "信息修改成功" ); } else { map.put("resuleCode" , "201" ); map.put("resultMessage" , "信息修改失败" ); } return map;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 * @return */ @ResponseBody @GetMapping("validatePhone") public Object validatePhone (String phone) { int i = userService.validatePhone(phone); if (i == 1 ) { map.put("resultCode" , "200" ); } else { map.put("resultCode" , "201" ); } return map; } @ResponseBody @DeleteMapping("deleteByPrimaryKey") public Object deleteByPrimaryKey (Integer id) { int i = userService.deleteByPrimaryKey(id); if (i > 0 ) { map.put("resultCode" , "200" ); } else { map.put("resultCode" , "201" ); } return map; } @ResponseBody @PutMapping("changePassword") public Object changePassword (Integer id, String oldPassword, String password) { int i = userService.changePassword(id, oldPassword, password); if (i > 0 ) { map.put("resultCode" , "200" ); map.put("resultMessage" , "密码修改成功!" ); } else { map.put("resultCode" , "201" ); map.put("resultMessage" , "原密码错误,修改失败!" ); } return map; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 } return map; } @ResponseBody @RequestMapping(value = "exportExcel", method = RequestMethod.GET) public void exportExcel (String ids, HttpServletResponse response) { try { Collection collection = equipmentService.selectEquipmentInfoExcel(ids); ExcelUtil.getExcel(response, collection, "equipment.xlsx" ); } catch (Exception e) { e.printStackTrace(); } } @ResponseBody @GetMapping("exportVehicleInfo") public void downLoadTemplate (HttpServletRequest request, HttpServletResponse response) { InputStream inputStream = null ; OutputStream outputStream = null ; try { String realPath = request.getServletContext().getRealPath("" ); File file = new File(realPath + "/file/" + "设备新增模板.xls" ); response.setContentLength((int ) file.length()); response.setContentType("application/octet-stream;charset=utf-8" ); response.setHeader("Content-Disposition" , "attachment;filename=" + URLEncoder.encode(file.getName(), "UTF-8" )); inputStream = new FileInputStream(file); outputStream = response.getOutputStream(); IOUtils.copy(inputStream, outputStream);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 System.out.println("复制文件成功:" + srcFile.getName() + " -> " + destFile.getName()); } catch (Exception e) { System.out.println("Error:复制文件失败:" + srcFile.getName() + " -> " + destFile.getName()); } finally { if (inputChannel != null ) { inputChannel.close(); } if (outputChannel != null ) { outputChannel.close(); } } } } @Controller @RequestMapping("InformManagement") public class InformManagementController { @Autowired private InformManagementService informManagementService; private Map<String, Object> map = new HashMap<String, Object>();
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 @Autowired private InformManagementService informManagementService;private Map<String, Object> map = new HashMap<String, Object>();@RequestMapping("toInformManagement") public ModelAndView toInformManagement () { ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("InformManagement" ); return modelAndView; } @ResponseBody @GetMapping("getAllNotice") public Object getAllNotice (Integer pageNo, Integer pageSize, String name, HttpServletRequest request) { return informManagementService.getAllNotice(pageNo, pageSize, name); } @ResponseBody @GetMapping("getAllNoticeById") public Object getAllNotice (Integer id) { return informManagementService.getAllNoticeById(id);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 * 用户注册Controller */ @Controller @RequestMapping("register") public class RegisterController { public Map<String, Object> map = new HashMap<>(); @Autowired private UserService userService; @ResponseBody @PostMapping("verify") public Map registerUserValidate (String userAccount) { int i = userService.validatePhone(userAccount); if (i > 0 ) { map.put("resultCode" , "200" ); } else { map.put("resultCode" , "201" ); map.put("resultMessage" , "手机号已被注册!" ); } return map; } @ResponseBody @PostMapping("register") public Map register (User user) { int i = userService.registerUser(user); if (i > 0 ) { map.put("resultCode" , "200" ); map.put("resultMessage" , "注册成功,等待管理员审核成功之后才能进行登录!" );
——————————PayStart——————————
项目链接: https://javayms.github.io?id=351122522008200ou https://javayms.pages.dev?id=351122522008200ou