作者主页:夜未央5788
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
Springboot学生成绩管理系统为前后端分离的项目,
主要分为管理员、教师、学生三种角色。
管理员角色主要功能如下:
课程表:编辑、录入、查询;
成绩查询:编辑、录入、导出、查询;
成绩详情:饼状图、折线图、柱状图等;
课程录入:课程新增、编辑、删除等;
用户管理:学生、教师、管理员信息管理;
账号管理:学生、教师、管理员账号编辑、删除等;
教师主要功能如下:
课程表查看、成绩查询、成绩详情等;
学生主要功能如下:
课程表查看、成绩查询、成绩详情等
使用人群:
正在做毕设的学生,或者需要项目实战练习的Java学习者
由于本程序规模不大,可供课程设计,毕业设计学习演示之用
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+axios
后端项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 控制台提示运行成功后再运行前端项目;
前端项目运行:
1.命令行cd进入 前端目录 sms;
2.执行命令 npm install 下载依赖;
3.执行命令 npm run dev 启动;
4.运行项目,在浏览器中输入地址:http://localhost:8080/
管理员账号、密码:root/password
教师账号、密码:3890001/159357
学生账号、密码:3168901101/123456
ScoreController
package com.zjh.sms.controller.Score;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zjh.sms.dto.Course;
import com.zjh.sms.dto.Score;
import com.zjh.sms.service.Score.ScoreService;
import com.zjh.sms.utils.PagingResult;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* Description 成绩查询控制层
* Author: zjh
* Date2020/3/13 15:25
**/
@RestController
@RequestMapping("/api/sms/score")
public class ScoreController {
@Autowired
private ScoreService scoreService;
@GetMapping("/getCourseList")
public PagingResult getCourseList (@RequestParam Map condition,
@RequestParam(required = false, name = "$limit", defaultValue = "10") Integer limit,
@RequestParam(required = false, name = "$offset", defaultValue = "0") Integer offset) {
RowBounds rowBounds = new RowBounds(offset, limit);
return scoreService.getCourseList(rowBounds, condition);
}
@PostMapping
private void addEntry(@RequestBody JSONArray UserScore) {
List list = JSONObject.parseArray(UserScore.toJSONString(), Score.class);
scoreService.addEntry(list);
}
@GetMapping("/export")
public List getExportList (@RequestParam Map condition) {
return scoreService.getExportList(condition);
}
@GetMapping("/getUserNum")
public List
TeacherCourseController
package com.zjh.sms.controller.TeacherCourse;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zjh.sms.domain.TeacherCourse;
import com.zjh.sms.service.TeacherCourse.TeacherCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* Description 教师课程控制层
* Author: zjh
* Date2020/3/29 15:03
**/
@RestController
@RequestMapping("/api/sms/teacher/course")
public class TeacherCourseController {
@Autowired
private TeacherCourseService teacherCourseService;
@PostMapping
public void add(@RequestBody JSONArray teacherCourseInfo) {
List list = JSONObject.parseArray(teacherCourseInfo.toJSONString(), TeacherCourse.class);
teacherCourseService.add(list);
}
@DeleteMapping("/{ids}")
public void delete(@PathVariable("ids") Integer[] ids) {
List idsList = Arrays.asList(ids);
teacherCourseService.delete(idsList);
}
@PutMapping
public void update(@RequestBody TeacherCourse teacherCourse) {
teacherCourseService.update(teacherCourse);
}
@GetMapping("/getCourseListById/{id}")
public List getCourseListById(@PathVariable("id") String id) {
return teacherCourseService.getCourseListById(id);
}
@GetMapping("/getProfessionInfoByTeacher/{teacherId}")
public List
TimetableController
package com.zjh.sms.controller.Timetable;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zjh.sms.domain.CourseInfo;
import com.zjh.sms.domain.WeekCourse;
import com.zjh.sms.service.Timetable.TimetableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* Description 课程表控制层
* Author: zjh
* Date2020/4/7 14:02
**/
@RestController
@RequestMapping("/api/sms/timetable")
public class TimetableController {
@Autowired
private TimetableService timetableService;
@PostMapping
public void add(@RequestBody JSONArray WeekCourseList) {
List list = JSONObject.parseArray(WeekCourseList.toJSONString(), WeekCourse.class);
timetableService.add(list);
}
@GetMapping("/getTimetable")
public List getStudentList (@RequestParam Map condition) {
return timetableService.getTimetable(condition);
}
@GetMapping("/getTimetableByStudent")
public List getTimetableByStudent (@RequestParam Map condition) {
return timetableService.getTimetableByStudent(condition);
}
@GetMapping("/getTimetableByTeacher")
public List getTimetableByTeacher (@RequestParam Map condition) {
return timetableService.getTimetableByTeacher(condition);
}
@PostMapping("/updateCourseInfo")
public void updateCourseInfo(@RequestBody CourseInfo courseInfo) {
timetableService.updateCourseInfo(courseInfo);
}
}
UserController
package com.zjh.sms.controller.User;
import com.zjh.sms.dto.User;
import com.zjh.sms.service.User.UserService;
import com.zjh.sms.utils.PassToken;
import com.zjh.sms.utils.UserLoginToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;
/**
* Description 登陆用户控制层
* Author: zjh
* Date2019/10/21 21:00
**/
@RestController
@UserLoginToken
@RequestMapping("/api/sms/user")
public class UserController {
@Autowired
private UserService userService;
@GetMapping("/login")
@PassToken
public User getStudentInfo (@RequestParam Map condition) {
Map map = new HashMap<>();
map.put("username", condition.get("username").toString());
map.put("password", condition.get("password").toString());
map.put("level", condition.get("level"));
User user = userService.getStudentInfo(map);
// String token = userService.getToken(user, 60* 60 * 1000); // 有效期1h
String token = userService.getToken(user, 24*60* 60 * 1000);
String refreshToken = userService.getToken(user, 24*60*60*1000); // 有效期一天
user.setToken(token);
user.setRefreshToken(refreshToken);
return user;
}
@GetMapping("/edit/password")
public boolean update (@RequestParam Map condition) {
Map map = new HashMap<>();
map.put("username", condition.get("username").toString());
map.put("password", condition.get("password").toString());
map.put("passwordAgain", condition.get("passwordAgain").toString());;
map.put("level", condition.get("level").toString());
return userService.update(map);
}
@GetMapping("/getTree")
public List
AdminController
package com.zjh.sms.controller.User;
import com.zjh.sms.dto.User;
import com.zjh.sms.service.User.AdminService;
import com.zjh.sms.utils.PagingResult;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.List;
/**
* Description 管理员账户控制层
* Author: zjh
* Date2020/3/28 11:05
**/
@RestController
@RequestMapping("/api/sms/user/admin")
public class AdminController {
@Autowired
private AdminService adminService;
@PostMapping
public void addAdmin(@RequestBody User user) {
adminService.add(user);
}
@DeleteMapping("/{ids}")
public void delete(@PathVariable("ids") Integer[] ids) {
List idsList = Arrays.asList(ids);
adminService.delete(idsList);
}
@PutMapping
public void update(@RequestBody User user) {
adminService.update(user);
}
@GetMapping("/getAdminList")
public PagingResult getAdminList (@RequestParam Map condition,
@RequestParam(required = false, name = "$limit", defaultValue = "10") Integer limit,
@RequestParam(required = false, name = "$offset", defaultValue = "0") Integer offset) {
RowBounds rowBounds = new RowBounds(offset, limit);
return adminService.getAdminList(rowBounds, condition);
}
}
如果也想学习本系统,下面领取。关注并回复:167springboot