计算机毕设大作业《基于SpringBoot的实验室管理系统》

编程入门 行业动态 更新时间:2024-10-26 00:32:29

计算机毕设大作业《基于SpringBoot的实验室<a href=https://www.elefans.com/category/jswz/34/1769858.html style=管理系统》"/>

计算机毕设大作业《基于SpringBoot的实验室管理系统》

项目背景

社会的发展和科学技术的进步,互联网技术越来越受欢迎。网络计算机的生活方式逐渐受到广大人民群众的喜爱,也逐渐进入了每个用户的使用。互联网具有便利性,速度快,效率高,成本低等优点。 因此,构建符合自己要求的操作系统是非常有意义的。
本文从用户的功能要求出发,建立了实验室管理系统,系统中的功能模块主要是实现管理员;首页、个人中心、实验室管理、用户管理、实验室申请管理、设备管理、设备报备管理、设备申请管理、消耗品管理、消耗品领取管理、论坛管理、系统管理,用户前台;首页、实验室、设备、消耗品、论坛信息、新闻资讯、我的、跳转到后台,用户后台;首页、个人中心、实验室申请管理、设备报备管理、设备申请管理、消耗品领取管理,等功能部分;经过认真细致的研究,精心准备和规划,最后测试成功,系统可以正常使用。分析功能调整与实验室管理系统实现的实际需求相结合,讨论了JSP开发实验室管理系统的使用。

功能设计

功能模块图

系统功能图

设备报备管理实体属性图

用户信息实体属性图

实验室申请管理实体属性图

功能截图

前台首页功能

用户通过网址进入到网站界面,进行填写自己的用户名和密码等信息输入完成后用户登录成功,如果用户没有自己的账户信息,则需要用户进行在线注册,用户注册时根据需求可以通过注册界面提示的文本框信息进行在线填写自己的基本信息内容,信息编辑完成后核对信息无误后进行在线提交,新的用户注册完成。


用户登录进入到网站界面,可以进行查看首页、实验室、设备、消耗品、论坛信息、新闻资讯、我的、跳转到后台等功能模块,进行相对应操作,通过个人中心进行查看用户名、用户姓名、密码、性别、身份等信息,进行查看操作。

用户通过点击实验室可以进行查看实验室编号、位置、用户名、用户姓名、身份等信息,进行查看等操作,如图5-4所示。用户点击设备页面,可以进行填写设备编号、设备名称、数量、用户名、用户姓名、身份等信息,进行提交设备操作。


消耗品,用户通过点击消耗品可以进行查看用户名、用户姓名、身份、联系电话、申请时间、等信息。

用户后台功能

用户通过点击后台管理,进入页面可以进行首页、个人中心、实验室申请管理、设备报备管理、设备申请管理、消耗品领取管理等功能模块,进行相对应操作。

实验室申请管理:通过实验室申请管理可以进行获取索引、实验室编号、位置、用户名、用户姓名、身份、联系电话、申请时间、审核回复、审核等信息。

设备报备管理:用户通过列表可以获取索引、设备编号、设备名称、数量、位置、用户名、用户姓名、身份、报备时间、审核回复、审核等信息,进行查看等信息操作。

消耗品领取管理:用户通过列表可以获取消耗品编号、消耗品名称、数量、用户名、身份、联系电话、申请时间等信息,进行查看等信息操作。

管理员功能

管理员通过后台登录窗口进行输入自己的账号、密码等信息,进行登录。

个人信息,管理员通过列表进行查看用户名等信息,进行查看、修改或删除操作。

实验室管理,管理员通过实验室管理可以在线查看实验室编号、图片、容纳人数、位置等信息,进行详情或修改、删除操作。
实验室申请管理,管理员通过实验室申请管理可以在线查看实验室编号、位置、用户名、用户姓名、身份、联系电话等信息,进行查看或修改、删除操作。
设备报备管理,管理员通过设备报备管理可以在线查看索引、设备编号、设备名称、数量、位置、用户名、用户姓名、身份、报备时间、审核回复、审核等信息,进行查看或添加修改或删除。

设备申请管理:通过列表可以获取设备编号、设备名称、数量、用户名、用户姓名、身份等信息,进行查看、详情、修改或删除操作。

消耗品管理:通过列表可以获取消耗品编号、消耗品名称、图片、数量、位置等信息,进行查看、详情、修改或删除操作 。

消耗品领取管理:通过列表可以获取消耗品编号、消耗品名称、数量、用户名、用户姓名、身份、联系电话等信息,进行查看、详情、修改或删除操作。

论坛管理:通过列表可以获取帖子标题、用户名、状态等信息,进行查看、详情、修改或删除操作。

相关代码

数据库配置
# Tomcat
server:tomcat:uri-encoding: UTF-8port: 8080servlet:context-path: /springbootr1tjfspring:datasource:driverClassName: com.mysql.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/springbootr1tjf?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8username: rootpassword: 123456#        driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
#        url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=springbootr1tjf
#        username: sa
#        password: 123456servlet:multipart:max-file-size: 10MBmax-request-size: 10MBresources:static-locations: classpath:static/,file:static/#mybatis
mybatis-plus:mapper-locations: classpath*:mapper/*.xml#实体扫描,多个package用逗号或者分号分隔typeAliasesPackage: com.entityglobal-config:#主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";id-type: 1#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"field-strategy: 2#驼峰下划线转换db-column-underline: true#刷新mapper 调试神器refresh-mapper: true#逻辑删除配置logic-delete-value: -1logic-not-delete-value: 0#自定义SQL注入器sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjectorconfiguration:map-underscore-to-camel-case: truecache-enabled: falsecall-setters-on-nulls: true#springboot 项目mybatis plus 设置 jdbcTypeForNull (oracle数据库需配置JdbcType.NULL, 默认是Other)jdbc-type-for-null: 'null' 
控制层(controller)
package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null) {return R.error("账号不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密码已重置为:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", userService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {return R.error("用户名已存在。");}userService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}
业务层(Service)

package com.service;import java.util.List;
import java.util.Map;import org.apache.ibatis.annotations.Param;import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.entity.UserEntity;
import com.utils.PageUtils;/*** 系统用户*/
public interface UserService extends IService<UserEntity> {PageUtils queryPage(Map<String, Object> params);List<UserEntity> selectListView(Wrapper<UserEntity> wrapper);PageUtils queryPage(Map<String, Object> params,Wrapper<UserEntity> wrapper);}
数据访问层(Dao)
package com.dao;import java.util.List;import org.apache.ibatis.annotations.Param;import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.UserEntity;/*** 用户*/
public interface UserDao extends BaseMapper<UserEntity> {List<UserEntity> selectListView(@Param("ew") Wrapper<UserEntity> wrapper);List<UserEntity> selectListView(Pagination page,@Param("ew") Wrapper<UserEntity> wrapper);}

更多推荐

计算机毕设大作业《基于SpringBoot的实验室管理系统》

本文发布于:2024-03-11 19:48:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1729766.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:管理系统   作业   实验室   计算机   毕设大

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!