——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot大学生入学审核系统(java+springboot+mybaits+vue+mysql)
项目介绍
基于Springboot + vue实现的大学生入学审核系统
系统包含管理员和学生两个角色。
管理员功能有个人中心,学生管理,学籍信息管理,入学办理管理等。
学生功能有个人中心,学籍信息管理,入学办理管理等
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7/8.0版本均可;
5.是否Maven项目:是;
技术栈
后端:SpringBoot+Mybaits
前端:Vue + elementui
使用说明
项目运行:
使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令;
将项目中application.yml配置文件中的数据库配置改为自己的配置;
运行项目,在浏览器中输入地址:
后台登录页面
http://localhost:8080/springboot1hme0/admin/dist/index.html
管理员:abo 密码:abo
学生:学生1 密码:123456
注意项目文件路径中不能含有中文、空格、特殊字符等,否则图片会上传不成功。
文档结构展示:
修改个人信息展示页面:
学生管理展示页面:
个人信息展示页面:
学籍信息管理展示页面:
入学办理展示页面:
——————————CodeStart——————————
学生管理控制层:
@Controller
@RequestMapping(value=”/student”)
public class StudentController {
@Autowired
private StudentService studentService;
@ResponseBody
@RequestMapping(value=”/list”)
public String getStudentList(@RequestParam(defaultValue=”0”)int curr,
@RequestParam(defaultValue=”20”)int nums,
@RequestParam(defaultValue=””)String searchKey) {
Pagination
page.setTotalItemsCount(studentService.getTotalItemsCount(searchKey));
page.setPageSize(nums);
page.setPageNum(curr);
List
String jsonStr = StrUtil.RETURN_JONS_PRE_STR
page.getTotalItemsCount()
StrUtil.RETURN_JONS_MID_STR
JSON.toJSONString(list)
StrUtil.RETURN_JONS_END_STR;
return jsonStr;
/**
返回选修了我课程的学生列表
@return
*/
@ResponseBody
@RequestMapping(value=”/stulist”)
public String getMyStudentList(@RequestParam(defaultValue=”0”)int curr,
@RequestParam(defaultValue=”20”)int nums,
@RequestParam(required=false) Integer cId, HttpSession session) {
Teacher t = (Teacher) session.getAttribute(StrUtil.USER);
Pagination
page.setTotalItemsCount(studentService.getTotalItemsCountByTid(t.getId(), cId));
page.setPageSize(nums);
page.setPageNum(curr);
List
String jsonStr = StrUtil.RETURN_JONS_PRE_STR
page.getTotalItemsCount()
StrUtil.RETURN_JONS_MID_STR
JSON.toJSONString(list)
StrUtil.RETURN_JONS_END_STR;
System.out.println(jsonStr);
return jsonStr;
@RequestMapping(value=”/addPage”)
public ModelAndView toAddPage() {
return new ModelAndView(“/studentAdd”);
/**
增加,或者修改studnet
@param opType
@param stu
@return
*/
@ResponseBody
@RequestMapping(value=”/add”)
public String addStudent(@RequestParam(defaultValue=”2”) int opType, Student stu) {
int res = 0;
if (opType == 0) {
try {
stu.setPassword(stu.getPassword().toUpperCase());
res = studentService.addStudent(stu);
} catch (Exception e) {
System.out.println(“添加失败!学号重复!”);
return “添加失败!学号重复!”;
if (res > 0)
return StrUtil.RESULT_TRUE;
return “添加失败”;
} else if (opType == 1) {
stu.setPassword(null);
res = studentService.updateStudent(stu);
if (res > 0) return StrUtil.RESULT_TRUE;
return “修改失败!”;
return “error”;
/**
重置密码
@param stu
@return
*/
@ResponseBody
@RequestMapping(value=”/resetPswd”)
public String resetPasswrd(String id) {
Student stu = new Student();
stu.setId(id);
stu.setPassword(MD5Util.MD5(“123456”));
if (studentService.updateStudent(stu) > 0) return StrUtil.RESULT_TRUE;
return “修改失败!”;
@ResponseBody
@RequestMapping(value=”/delete”)
public String deleteStudnet(Student stu) {
if (studentService.deleteStudent(stu) > 0) return StrUtil.RESULT_TRUE;
return “删除失败!”;
/**
批量删除
@param stuIds
@return
*/
@ResponseBody
@RequestMapping(value=”/deleteList”)
public String deleteStudnetList(String stuIds) {
List
try {
String[] ids = stuIds.split(“,”);
for (String id: ids) {
list.add(id);
if (studentService.deleteStudent(list) > 0) {
return StrUtil.RESULT_TRUE;
} catch (Exception e) {
e.printStackTrace();
return “删除失败!参数出错!”;//
return “删除失败!”;
@ResponseBody
@RequestMapping(“/import”)
public String impotr(HttpServletRequest request, MultipartFile file) {
//获取上传的文件
InputStream in = null;
try {
in = file.getInputStream();
//数据导入
int res = studentService.importExcelInfo(in,file);
if (res > 0) {
return StrUtil.RETURN_JONS_PRE_STR+”0”
+StrUtil.RETURN_JONS_MID_STR+”true”
+StrUtil.RETURN_JONS_END_STR;
} else {
return StrUtil.RETURN_JONS_PRE_STR+”0”
+StrUtil.RETURN_JONS_MID_STR+”false”
+StrUtil.RETURN_JONS_END_STR;
} catch (Exception e) {
e.printStackTrace();
return StrUtil.RETURN_JONS_PRE_STR+”0”
+StrUtil.RETURN_JONS_MID_STR+”error”
+StrUtil.RETURN_JONS_END_STR;
} finally {
if (in != null)
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
@RequestMapping(value=”/courses”)
public ModelAndView toChoiceCoursePage() {
return new ModelAndView(“choiceCourse”);
成绩管理控制层:
@Controller
@RequestMapping(value=”/score”)
public class ScoreController {
@Autowired
private ScoreService scoreService;
@ResponseBody
@RequestMapping(value=”/list”)
public String getScoreList(Integer curr, Integer nums, ScoreVo scoreVo) {
System.out.println(scoreVo);
Pagination
page.setTotalItemsCount(scoreService.getTotalItemsCount(scoreVo));
page.setPageSize(nums);
page.setPageNum(curr);
List
String jsonStr = StrUtil.RETURN_JONS_PRE_STR
page.getTotalItemsCount()
StrUtil.RETURN_JONS_MID_STR
JSON.toJSONString(list)
StrUtil.RETURN_JONS_END_STR;
System.out.println(jsonStr);
return jsonStr;
@ResponseBody
@RequestMapping(“/export”)
public void export(HttpServletRequest request, HttpServletResponse response, ScoreVo scoreVo)
throws ClassNotFoundException, IntrospectionException,
IllegalAccessException, ParseException, InvocationTargetException {
response.reset(); // 清除buffer缓存
// 设置文件名
response.setHeader(“Content-Disposition”, “attachment;filename=”
- System.currentTimeMillis() + “.xls”);
response.setContentType(“application/vnd.ms-excel;charset=UTF-8”);
response.setHeader(“Pragma”, “no-cache”);
response.setHeader(“Cache-Control”, “no-cache”);
response.setDateHeader(“Expires”, 0);
XSSFWorkbook workbook = null;
// 导出Excel对象
workbook = scoreService.exportExcelInfo(scoreVo);
OutputStream output;
try {
output = response.getOutputStream();
BufferedOutputStream bufferedOutPut = new BufferedOutputStream(output);
bufferedOutPut.flush();
workbook.write(bufferedOutPut);
bufferedOutPut.close();
} catch (IOException e) {
e.printStackTrace();
/**
学生查成绩列表
@param curr
@param nums
@param searchKey
@return
*/
@ResponseBody
@RequestMapping(value=”/stuScore”)
public String getScoreList(@RequestParam(defaultValue=”0”)int curr,
@RequestParam(defaultValue=”20”)int nums,
HttpSession session, Integer result) {
Student stu = (Student) session.getAttribute(StrUtil.USER);
Pagination
page.setTotalItemsCount(scoreService.getTotalItemsCount(stu.getId(), result));
page.setPageSize(nums);
page.setPageNum(curr);
List
String jsonStr = StrUtil.RETURN_JONS_PRE_STR
page.getTotalItemsCount()
StrUtil.RETURN_JONS_MID_STR
JSON.toJSONString(list)
StrUtil.RETURN_JONS_END_STR;
System.out.println(jsonStr);
return jsonStr;
/**
学生选课
@param session
@param id
@return
*/
@ResponseBody
@RequestMapping(value=”/choiceCourse”)
public String choiceCourse(HttpSession session,
@RequestParam(defaultValue=””)Integer id) {
if (id != null) {
Student s = (Student) session.getAttribute(StrUtil.USER);
Score score = new Score();
score.setsId(s.getId());
score.setcId(id);
int res = scoreService.choiceCourse(score);
if (res > 0) return StrUtil.RESULT_TRUE;
else return StrUtil.RESULT_FALSE;
return “参数错误!”;
/**
学生取消选课
@param id
@return
*/
@ResponseBody
@RequestMapping(value=”/delete”)
public String deleteCourse(@RequestParam(defaultValue=””)Integer id, HttpSession session) {
Student stu = (Student) session.getAttribute(StrUtil.USER);
Score s = new Score();
s.setcId(id);
s.setsId(stu.getId());
if (id != null) {
int res = scoreService.deleteScore(s);
if (res > 0) return StrUtil.RESULT_TRUE;
else return StrUtil.RESULT_FALSE;
return “参数错误!”;
/**
评分
@param score
@return
*/
@ResponseBody
@RequestMapping(value=”/update”)
public String updateScore(Score score) {
int res = scoreService.updateScore(score);
if (res > 0) return StrUtil.RESULT_TRUE;
else return StrUtil.RESULT_FALSE;
@ResponseBody
@RequestMapping(value=”/updateList”)
public String updateScoreList(String scoreListStr) {
List
System.out.println(scoreList);
int res = scoreService.updateScore(scoreList);
if (res > 0) return StrUtil.RESULT_TRUE;
else return StrUtil.RESULT_FALSE;
登录管理控制层:
@Controller
@RequestMapping(value=”/login”)
public class LoginController {
@Autowired
AuthService authService;
@Autowired
AdminService adminServiceImpl;
@Autowired
TeacherService teacherServiceImpl;
@Autowired
StudentService studentServiceImpl;
@RequestMapping(value=”/loginPage”)
public ModelAndView toLoginPage() {
return new ModelAndView(“login”);
@ResponseBody
@RequestMapping(value=”/doLogin”)
public String doLogin(@RequestParam(defaultValue=””) String username,
@RequestParam(defaultValue=””) String password,
@RequestParam(defaultValue=”0”) int userType,
@RequestParam(defaultValue=””) String verifyCode, HttpSession session) {
//比较验证码
String sessionVerifyCode = (String) session.getAttribute(StrUtil.VERIFY_CODE);
if (sessionVerifyCode == null || !sessionVerifyCode.equals(verifyCode.toUpperCase()) ) {
return StrUtil.CODE_ERROR;
Login loginUser = null;
if (userType == 1) {
loginUser = (Login) adminServiceImpl;
} else if(userType == 2) {
loginUser = (Login) teacherServiceImpl;
} else if(userType == 3) {
loginUser = (Login) studentServiceImpl;
User user = loginUser.loginValidate(username, password.toUpperCase());//获得验证后user对象
if (user != null) {
//List
List
user.setUrlList(urlList);
//user.setMenuList(menuList);
session.setAttribute(StrUtil.USER, user);
return JSON.toJSONString(user);
return StrUtil.RESULT_FALSE;
@RequestMapping(value=”/out”)
public ModelAndView loginOut(HttpSession session) {
session.invalidate();//销毁sessions
//请求重定向到主页(login页)
return new ModelAndView(“redirect:/“);
@RequestMapping(value=”/getVerifyCode”)
public void getVerifyCode(HttpServletResponse response, HttpSession session) {
ByteArrayOutputStream output = new ByteArrayOutputStream();
session.setAttribute(“verifyCode”, drawCodeImg(output));
try {
ServletOutputStream out = response.getOutputStream();
output.writeTo(out);
} catch (IOException e) {
e.printStackTrace();
/**
绘出验证码
@param output
@return
*/
private String drawCodeImg(ByteArrayOutputStream output) {
String code = “”;
for (int i = 0; i < 4; i++) {
code += randomChar();
int width = 70;
int height = 36;
BufferedImage bImage = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);
Font font = new Font(“Times New Roman”, Font.PLAIN, 20);
Graphics2D graphics = bImage.createGraphics();
graphics.setFont(font);
graphics.setColor(new Color(66,2,82));
graphics.setBackground(new Color(226,226,240));
graphics.clearRect(0, 0, width, height);
FontRenderContext context = graphics.getFontRenderContext();
Rectangle2D bounds = font.getStringBounds(code, context);
double x = (width - bounds.getWidth()) / 2;
double y = (height - bounds.getHeight()) / 2;
double ascent = bounds.getY();
double baseY = y - ascent;
graphics.drawString(code, (int) x, (int) baseY);
graphics.dispose();
try {
ImageIO.write(bImage, “jpg”, output);
} catch (IOException e) {
e.printStackTrace();
return code;
/**
返回一个随机字符
@return
*/
private char randomChar() {
Random r = new Random();
String str = “ABCDEFGHJKLMNPRSTUVWXYZ0123456789”;
return str.charAt(r.nextInt(str.length()));
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=401524512608201nl
https://javayms.pages.dev?id=401524512608201nl