一、项目简介
学生管理系统是一种基于计算机技术实现的学生信息管理工具,能够方便地对学生信息进行录入、查询、修改和删除。该项目采用 Java 语言编写,使用 Spring MVC 框架和 MySQL 数据库,实现了以上所述的主要功能,该学生管理系统可以应用于学校、培训机构、教育机构等场景,能够大大提升学生信息的管理效率和工作效率,为学校及相关教育机构提供快捷、准确的信息服务。
二、项目采用技术
数据库Mysql,WEB技术,MVC架构技术,duird连接池,Javascript/Ajax/jQuery
三、功能需求分析
1.学生信息管理:包括学生姓名、学号、性别、出生日期等信息。
2.课程信息管理:包括课程名称、课程编号、授课教师等信息。
3.成绩录入︰教师可以录入学生的成绩,包括考试成绩和平时成绩。
4.成绩查询:学生和教师可以查询自己或其他人的成绩。
5.统计分析∶系统可以对成绩进行统计分析,例如班级平均分、最高分最低分等。
四、项目亮点
模糊查询,支持分别对所有学生各科成绩画出柱状分布图,采用了 Web 技术,具有良好的用户界面和交互体验,管理员和教师还有学生需要输入密码才能登录系统,保障信息安全性。
五、系统演示操作
学生管理系统主页面
管理员添加学生
管理员添加教师
管理员查看班级科目成绩
教师页面查看学生信息
教师端查看班级科目对比柱形图
学生端查看个人成绩
六、负责模块
根据学生姓名查找学生成绩
@RequestMapping("/getStuByName")// 声明请求映射路径
@ResponseBody// 告诉Spring MVC将返回结果转换为JSON格式并发送给客户端
public String getStuByName(@RequestParam("key[id]") String name, @RequestParam("limit") String limit,
@RequestParam("page") String page) {
int lim = Integer.parseInt(limit);
int start = (Integer.parseInt(page) - 1) * lim;
if (name.equals("")) {
Map<String, Object> map = new HashMap<>();
map.put("start", start);
map.put("pagesize", lim);
List<Stu> stuList = stuService.findAllStu(map);// 调用业务逻辑层的方法查询学生信息
int total = stuService.stuCount();
Layui l = Layui.data(total, stuList);
return JSON.toJSONString(l);
} else {
List<Stu> stuList = stuService.findStuByName(name, start, lim);
int total = stuList.size();
Layui l = Layui.data(total, stuList);
System.out.println("学生信息:"+JSON.toJSONString(l));
return JSON.toJSONString(l);
}
}
支持用户登录、验证操作
@ResponseBody// 告诉Spring MVC将返回结果转换为JSON格式并发送给客户端
@RequestMapping(value = "/dealLogin")// 声明请求映射路径
public String getInfo(@RequestParam(value = "num") String num, @RequestParam(value = "psw") String psw,
@RequestParam(value = "identify") String identify, HttpSession httpSession) {
String dataJson = "fail";
if (Integer.parseInt(identify) == 0) {
List<Admin> adminList = new ArrayList<>();
adminList = adminService.findAdmin(num, SecureUtil.md5(psw));// 调用业务逻辑层的方法查询管理员信息
if (adminList.size() > 0) {
String account = adminList.get(0).getAccount();
String name = adminList.get(0).getName();
httpSession.setAttribute("account", account);
httpSession.setAttribute("name", name);
httpSession.setAttribute("photo", "admin.png");
httpSession.setAttribute("role", "admin");
dataJson = JSON.toJSONString(adminList);
return dataJson;
}
} else if (Integer.parseInt(identify) == 1) {
List<Teacher> teaList = new ArrayList<>();
teaList = teacherService.findTeacher(num, SecureUtil.md5(psw));
if (teaList.size() > 0) {
String name = teaList.get(0).getName();
String photo = teaList.get(0).getPhoto();
String account = teaList.get(0).getTeachno();
httpSession.setAttribute("account", account);
httpSession.setAttribute("name", name);
httpSession.setAttribute("photo", photo);
httpSession.setAttribute("role", "teacher");
dataJson = JSON.toJSONString(teaList);
return dataJson;
}
} else if (Integer.parseInt(identify) == 2) {
List<Stu> stuList = new ArrayList<>();
stuList = stuService.findStu(num, SecureUtil.md5(psw)); // 调用业务逻辑层的方法查询学生信息
if (stuList.size() > 0) {
String name = stuList.get(0).getName();
String photo = stuList.get(0).getPhoto();
String account = stuList.get(0).getStuno();
httpSession.setAttribute("account", account);
httpSession.setAttribute("name", name);
httpSession.setAttribute("photo", photo);
httpSession.setAttribute("role", "stu");
dataJson = JSON.toJSONString(stuList);
return dataJson;
}
}
return "fail";
}