基于SpringBoot的实习管理系统
末尾获取源码
开发语言:Java
Java开发工具:JDK1.8
后端框架:SpringBoot
前端:Vue、HTML
数据库:MySQL5.7和Navicat管理工具结合
服务器:Tomcat8.5
开发软件:IDEA / Eclipse
是否Maven项目:是
目录
一、项目简介
二、系统功能
三、系统项目截图
3.1前台首页
3.2后台管理
四、核心代码
4.1登录相关
4.2文件上传
4.3封装
一、项目简介
基于SpringBoot的实习管理系统利用网络沟通、计算机信息存储管理,有着与传统的方式所无法替代的优点。比如计算检索速度特别快、可靠性特别高、存储容量特别大、保密性特别好、可保存时间特别长、成本特别低等。在工作效率上,能够得到极大地提高,延伸至服务水平也会有好的收获,有了网络,基于SpringBoot的实习管理系统的各方面的管理更加科学和系统,更加规范和简便。
二、系统功能
基于SpringBoot的实习管理系统主要包括四大功能模块,即管理员、教师、实习单位和学生。
(1)管理员模块:首页、个人中心、班级管理、学生管理、教师管理、实习单位管理、实习作业管理、教师评分管理、单位成绩管理、系统管理。
(2)教师:首页、个人中心、实习作业、教师评分。
(3)实习单位:首页、个人中心、实习作业管理、单位成绩管理。
(4)学生:首页、个人中心、实习作业管理、教师评分管理、单位成绩管理。
三、系统项目截图
3.1前台首页
前台学生注册页面
教师、学生和实习单位登录页面
登录以后可以在前台个人中心查看自己的信息,还有首页、系统公告、后台管理这几个功能。
在学生的后台中有首页、个人中心、实习作业管理、教师评分管理、单位成绩管理。
在实习作业学生可以通过这个模块上传自己的实习报告。
3.2后台管理
管理员后台登录。
管理员登录以后有首页、个人中心、班级管理、学生管理、教师管理、实习单位管理、实习作业管理、教师评分管理、单位成绩管理、系统管理。
管理员可以查看目前已经有的实习单位并且可以对实习单位进行增删查改。
四、核心代码
4.1登录相关
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.MD5Util;
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);userService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}
4.2文件上传
package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
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.RestController;
import org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上传文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{@Autowiredprivate ConfigService configService;/*** 上传文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {if (file.isEmpty()) {throw new EIException("上传文件不能为空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath()+"/"+fileName);file.transferTo(dest);FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));if(StringUtils.isNotBlank(type) && type.equals("1")) {ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));if(configEntity==null) {configEntity = new ConfigEntity();configEntity.setName("faceFile");configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put("file", fileName);}/*** 下载文件*/@IgnoreAuth@RequestMapping("/download")public ResponseEntity<byte[]> download(@RequestParam String fileName) {try {File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}File file = new File(upload.getAbsolutePath()+"/"+fileName);if(file.exists()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403);}*/HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); headers.setContentDispositionFormData("attachment", fileName); return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);}}
4.3封装
package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回数据*/
public class R extends HashMap<String, Object> {private static final long serialVersionUID = 1L;public R() {put("code", 0);}public static R error() {return error(500, "未知异常,请联系管理员");}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r = new R();r.put("code", code);r.put("msg", msg);return r;}public static R ok(String msg) {R r = new R();r.put("msg", msg);return r;}public static R ok(Map<String, Object> map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}
基于SpringBoot的实习管理系统相关推荐
- 基于Springboot的实习管理系统的设计与实现
1.1 研究背景 科学技术日新月异的如今,计算机在生活各个领域都占有重要的作用,尤其在信息管理方面,在这样的大背景下,学习计算机知识不仅仅是为了掌握一种技能,更重要的是能够让它真正地使用到实践中去,以 ...
- (免费分享)基于springboot校园实习管理系统
项目介绍 本系统的用户可以分为三种:管理员.教师.学生.三种角色登录后会有不同菜单界面: 管理员主要功能: 信息管理 学生信息管理.教师信息管理.生产实习信息管理.顶岗实习信息管理: 生产实习 生产实 ...
- 若依(基于SpringBoot的权限管理系统)集成MobileIMSDK实现IM服务端的搭建
场景 若依(基于SpringBoot的权限管理系统)的快速搭建: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/111030441 ...
- 若依(基于SpringBoot的权限管理系统)的快速搭建
场景 若依管理系统 基于SpringBoot的权限管理系统 官网地址: http://www.ruoyi.vip/ 下载地址: https://gitee.com/y_project/RuoYi 注: ...
- 基于SpringBoot的库存管理系统
基于SpringBoot的库存管理系统 库存管理系统 项目简介 功能简介 技术选型 数据库设计 代码结构 界面设计 代码获取 库存管理系统 项目简介 本项目为库存管理系统,实现了供销管理.进退货管理. ...
- 基于springboot的在线商城管理系统
1.项目介绍 基于springboot的在线商城管理系统3拥有两种角色,分别为管理员和用户 管理员:用户信息管理.商品信息管理.类型管理.订单管理.留言管理等 用户:商品查看.购买.购物车.订单详情. ...
- 基于 SpringBoot 的人事管理系统的设计与实现
1,项目介绍 基于 SpringBoot 的人事管理系统拥有两种角色,分别为管理员和用户.. 本系统为职工人事管理系统.系统分为七大模块:职工管理,部门管理,岗位管理,招聘管理,奖惩管理,薪资管理,培 ...
- 基于SpringBoot的毕业论文管理系统的设计与实现(开题报告)
基于Spring Boot的毕业论文管理系统 研究的背景与意义 随着信息化时代的到来,高校的管理工作也面临着信息化改革.目前,各大高校纷纷引入教务管理信息系统来加强和改善对学生.教师以及各种教务信息的 ...
- 基于springboot的电影院管理系统
1.项目介绍 基于springboot的电影院管理系统拥有三种角色,介绍如下: 账户管理员:添加管理员和用户账号 普通管理员:电影管理.排片管理.活动管理.退票策略管理.影院管理.优惠券管理等 用户: ...
最新文章
- 线上内核_线上研讨会 |了解图书馆转型动态,建设智慧图书馆
- 使用pip来安装pyOpenSSL
- PHP自动加载spl_autoload_register()
- hive集群部署以及beeline和hive
- LeetCode 987. 二叉树的垂序遍历(递归/循环)
- css-bootstrap的安装与使用
- UserDetailsService详解
- easyui不同的jsp页面之间混乱_JSP+SSM+Mysql实现的图书馆预约占座管理系统
- -webkit-filter是神马?
- sql server 多条记录数据合并为一条_面试必备sql知识点——MySQL基础
- 网上图书商城Web页面
- 简单Git入门本地仓库同步到远程GitHub仓库
- Android数据库增删改查
- 自然语言处理NLP中的N-gram模型
- 【经验教程】google谷歌Gmail邮箱帐号被停用怎么恢复Gmail邮箱google谷歌账号?
- 浅谈Windows API编程 (这个经典)
- 了解云桌面,看这一篇文章就够了
- 关于WinForm中Pannel的定位问题 May 18th, 2010
- 【头歌】共享单车之数据存储
- 《第一桶金怎么赚——淘宝开店创业致富一册通》一一1.1 创业者需具备的素质...