当前位置:   article > 正文

IDEA+Java+SSM+Mysql+Layui实现Web学生成绩管理系统【建议收藏】_javaweb成绩管理页面

javaweb成绩管理页面

DROP TABLE IF EXISTS teacher;

CREATE TABLE teacher (

id int(11) NOT NULL AUTO_INCREMENT,

username varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,

password varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,

teaname varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL,

PRIMARY KEY (id) USING BTREE

) ENGINE = MyISAM AUTO_INCREMENT = 9 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;


– Records of teacher


INSERT INTO teacher VALUES (3, ‘root’, ‘123456’, ‘李老师’);

INSERT INTO teacher VALUES (7, ‘a’, ‘123456’, ‘孟老师’);

INSERT INTO teacher VALUES (5, ‘b’, ‘123456’, ‘赵老师’);

INSERT INTO teacher VALUES (6, ‘c’, ‘123456’, ‘李老师’);

SET FOREIGN_KEY_CHECKS = 1;

5.工程截图


二、系统展示

=======

1.登录系统


2.学生-主页面


3.学生-我的成绩


4.学生-修改密码


5.教师-主页面


6.教师-录入成绩


7.教师-修改密码


8.管理员-主页面


9.管理员-学生管理-增加学生


10.管理员–学生管理-管理学生


11.管理员-老师管理-增加老师


12.管理员-老师管理-管理老师


三、部分代码

======

AdminController


package com.hhtc.controller;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;

import org.springframework.web.bind.annotation.ResponseBody;

import org.springframework.web.servlet.ModelAndView;

import com.hhtc.po.Page;

import com.hhtc.po.Student;

import com.hhtc.po.Teacher;

import com.hhtc.service.AdminService;

import net.sf.json.JSONArray;

import net.sf.json.JSONObject;

@Controller

public class AdminController {

@Autowired

private AdminService adminService;

@RequestMapping(“/welcome”)

public ModelAndView welcome(Model model) {

ModelAndView mav = new ModelAndView(“admin/welcome”);

return mav;

}

//学生

//学生数据分页

@RequestMapping(value = “/liststudent”,method = {RequestMethod.POST, RequestMethod.GET},produces =“application/json;charset=UTF-8”)

@ResponseBody

public String liststudent(Page page) {

List list=adminService.stumanage();

page.caculatestart();

List list2=adminService.liststudent(page);

JSONObject jsonobj=new JSONObject();

jsonobj.put(“code”, 0);

jsonobj.put(“msg”, “成功”);

jsonobj.put(“count”,list.size());

JSONArray jsonobj2=new JSONArray();

JSONObject jsonobj3=new JSONObject();

for(Student student:list2) {

jsonobj3.put(“id”,student.getId());

jsonobj3.put(“username”,student.getUsername());

jsonobj3.put(“password”,student.getPassword());

jsonobj3.put(“stuclass”,student.getStuclass());

jsonobj3.put(“stuname”,student.getStuname());

jsonobj3.put(“stuno”,student.getStuno());

jsonobj2.add(jsonobj3);

}

jsonobj.put(“data”, jsonobj2);

return jsonobj.toString();

}

@RequestMapping(“/addstudent”)

public ModelAndView addstu(Student student,Model model) {

adminService.addStudent(student);

ModelAndView mav = new ModelAndView(“admin/stumanage”);

return mav;

}

@RequestMapping(“/delstu”)

public ModelAndView delstu(String id,Model model) {

adminService.delstudnet(id);

ModelAndView mav = new ModelAndView(“admin/stumanage”);

return mav;

}

@RequestMapping(“/updatestu”)

public ModelAndView updatestu(String id,Student student,Model model) {

student.setId(Integer.parseInt(id));

adminService.updatestu(student);

ModelAndView mav = new ModelAndView(“admin/stumanage”);

return mav;

}

@RequestMapping(value = “/mohuname”,method = {RequestMethod.POST, RequestMethod.GET},produces =“application/json;charset=UTF-8”)

@ResponseBody

public String mohuname(HttpSession session) {

@SuppressWarnings(“unchecked”)

List list=(List) session.getAttribute(“list”);

JSONObject jsonobj=new JSONObject();

jsonobj.put(“code”, 0);

jsonobj.put(“msg”, “成功”);

jsonobj.put(“count”,list.size());

JSONArray jsonobj2=new JSONArray();

JSONObject jsonobj3=new JSONObject();

for(Student student:list) {

jsonobj3.put(“id”,student.getId());

jsonobj3.put(“username”,student.getUsername());

jsonobj3.put(“password”,student.getPassword());

jsonobj3.put(“stuclass”,student.getStuclass());

jsonobj3.put(“stuname”,student.getStuname());

jsonobj3.put(“stuno”,student.getStuno());

jsonobj2.add(jsonobj3);

}

jsonobj.put(“data”, jsonobj2);

return jsonobj.toString();

}

//老师

@RequestMapping(“/addtea”)

public ModelAndView addteacher(Teacher teacher,Model model) {

adminService.addteacher(teacher);

ModelAndView mav = new ModelAndView(“admin/teamanage”);

return mav;

}

@RequestMapping(value = “/teamanage”,method = {RequestMethod.POST, RequestMethod.GET},produces =“application/json;charset=UTF-8”)

@ResponseBody

public String teamanage(Model model) {

List list=adminService.teamanage();

JSONObject jsonobj=new JSONObject();

jsonobj.put(“code”, 0);

jsonobj.put(“msg”, “成功”);

jsonobj.put(“count”,list.size());

JSONArray jsonobj2=new JSONArray();

JSONObject jsonobj3=new JSONObject();

for(Teacher teacher:list) {

jsonobj3.put(“id”,teacher.getId());

jsonobj3.put(“username”,teacher.getUsername());

jsonobj3.put(“password”,teacher.getPassword());

jsonobj3.put(“teaname”,teacher.getTeaname());

jsonobj2.add(jsonobj3);

}

jsonobj.put(“data”, jsonobj2);

return jsonobj.toString();

}

@RequestMapping(“/deltea”)

public ModelAndView deltea(String id,Model model) {

adminService.delteacher(id);

ModelAndView mav = new ModelAndView(“admin/teamanage”);

return mav;

}

@RequestMapping(“/updatetea”)

public ModelAndView updatetea(String id,Teacher teacher,Model model) {

teacher.setId(Integer.parseInt(id));

adminService.updatetea(teacher);

ModelAndView mav = new ModelAndView(“admin/teamanage”);

return mav;

}

@RequestMapping(value = “/mohunametea”,method = {RequestMethod.POST, RequestMethod.GET},produces =“application/json;charset=UTF-8”)

@ResponseBody

public String mohunametea(HttpSession session) {

@SuppressWarnings(“unchecked”)

List list=(List) session.getAttribute(“tealist”);

JSONObject jsonobj=new JSONObject();

jsonobj.put(“code”, 0);

jsonobj.put(“msg”, “成功”);

jsonobj.put(“count”,list.size());

JSONArray jsonobj2=new JSONArray();

JSONObject jsonobj3=new JSONObject();

for(Teacher teacher:list) {

jsonobj3.put(“id”,teacher.getId());

jsonobj3.put(“username”,teacher.getUsername());

jsonobj3.put(“password”,teacher.getPassword());

jsonobj3.put(“teaname”,teacher.getTeaname());

jsonobj2.add(jsonobj3);

}

jsonobj.put(“data”, jsonobj2);

return jsonobj.toString();

}

}

HrefController


package com.hhtc.controller;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.servlet.ModelAndView;

import com.hhtc.po.Student;

import com.hhtc.po.Teacher;

import com.hhtc.service.AdminService;

@Controller

public class HrefController {

@Autowired

private AdminService adminService;

@RequestMapping(“/index”)

public ModelAndView index(Model model) {

ModelAndView mav = new ModelAndView(“index”);

return mav;

}

//学生

@RequestMapping(“/hrefaddstu”)

public ModelAndView addstu(Model model) {

ModelAndView mav = new ModelAndView(“admin/addstu”);

return mav;

}

@RequestMapping(“/hrefmohuname”)

public ModelAndView hrefmohuname(String stuname,Model model,HttpSession session) {

List list=adminService.selectbyname(stuname);

session.setAttribute(“list”, list);

ModelAndView mav = new ModelAndView(“admin/mohuname”);

return mav;

}

@RequestMapping(“/hrefxiustu”)

public String xiustu(String id,Model model) {

Student student=adminService.selectone(id);

model.addAttribute(“student”,student);

return “admin/updatestu”;

}

@RequestMapping(“/hrefstumanage”)

public ModelAndView hrefstumanage(Model model) {

ModelAndView mav = new ModelAndView(“admin/stumanage”);

return mav;

}

//老师

@RequestMapping(“/hrefaddtea”)

public ModelAndView hrefaddtea(Model model) {

ModelAndView mav = new ModelAndView(“admin/addtea”);

return mav;

}

@RequestMapping(“/hrefteamanage”)

public ModelAndView hrefteamanage(Model model) {

ModelAndView mav = new ModelAndView(“admin/teamanage”);

return mav;

}

@RequestMapping(“/hrefmohunametea”)

public ModelAndView hrefmohunametea(String teaname,Model model,HttpSession session) {

List list=adminService.selectbynametea(teaname);

session.setAttribute(“tealist”,list);

ModelAndView mav = new ModelAndView(“admin/mohuname2”);

return mav;

}

@RequestMapping(“/hrefxiutea”)

public String hrefxiutea(String id,Model model) {

Teacher teacher=adminService.selectonetea(id);

model.addAttribute(“teacher”,teacher);

return “admin/updatetea”;

}

}

LoginController


package com.hhtc.controller;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.servlet.ModelAndView;

import com.hhtc.po.Admin;

import com.hhtc.po.Student;

import com.hhtc.po.Teacher;

import com.hhtc.service.LoginService;

@Controller

public class LoginController {

@Autowired

private LoginService loginService;

@RequestMapping(“/login”)

public ModelAndView findCustomerById(String username,String password,String people,Model model,HttpSession session) {

if(“student”.equals(people)) {

Student student=new Student();

student.setUsername(username);

student.setPassword(password);

Student student2=loginService.findStuTeachByUsername(student);

if(student2!=null) {

session.setAttribute(“student”, student2);

ModelAndView mav = new ModelAndView(“/student/indexs”);

return mav;

}else {

ModelAndView mav = new ModelAndView(“error”);

return mav;

}

}else if(“teacher”.equals(people)){

Teacher teacher=new Teacher();

teacher.setUsername(username);

teacher.setPassword(password);

Teacher teacher2=loginService.findTeachByUsername(teacher);

if(teacher2!=null) {

session.setAttribute(“teacher”, teacher2);

ModelAndView mav = new ModelAndView(“/teacher/indext”);

return mav;

}else {

ModelAndView mav = new ModelAndView(“error”);

return mav;

}

}else if(“manage”.equals(people)){

Admin admin =new Admin();

admin.setUsername(username);

admin.setPassword(password);

if(loginService.findAdminById(admin)!=null) {

ModelAndView mav = new ModelAndView(“/admin/index”);

return mav;

}else {

ModelAndView mav = new ModelAndView(“error”);

return mav;

}

}

ModelAndView mav = new ModelAndView(“error”);

return mav;

}

@RequestMapping(“/out”)

public ModelAndView out(HttpServletResponse response,HttpSession session,Model model) {

ModelAndView mav = new ModelAndView(“index”);

return mav;

}

}

StudentController


package com.hhtc.controller;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.servlet.ModelAndView;

import com.hhtc.po.Student;

import com.hhtc.service.GeneraService;

@Controller

public class StudentController {

@Autowired

private GeneraService generaService;

//学生

@RequestMapping(“/hrefstuinfo”)

public ModelAndView hrefstuinfo(Model model) {

ModelAndView mav = new ModelAndView(“student/stuinfo”);

return mav;

}

@RequestMapping(“/hrefupdatepws”)

public ModelAndView hrefupdatepws(Model model) {

ModelAndView mav = new ModelAndView(“student/updatepws”);

return mav;

}

@RequestMapping(“/updatepws”)

public ModelAndView updatepws(Student student,Model model) {

this.generaService.updatepws(student);

ModelAndView mav = new ModelAndView(“success”);

return mav;

}

}

TeachController


package com.hhtc.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;

import org.springframework.web.bind.annotation.ResponseBody;

import org.springframework.web.servlet.ModelAndView;

import com.hhtc.po.Page;

import com.hhtc.po.Student;

import com.hhtc.po.Teacher;

import com.hhtc.service.AdminService;

import com.hhtc.service.GeneraService;

import net.sf.json.JSONArray;

import net.sf.json.JSONObject;

@Controller

public class TeachController {

@Autowired

private AdminService adminService;

@Autowired

private GeneraService generaService;

@RequestMapping(“/hrefaddscore”)

public ModelAndView hrefaddscore(Model model) {

ModelAndView mav = new ModelAndView(“teacher/addscore”);

return mav;

}

@RequestMapping(“/hrefupdatepw”)

public ModelAndView hrefupdatepw(Model model) {

ModelAndView mav = new ModelAndView(“teacher/updatepw”);

return mav;

}

@RequestMapping(value = “/stuscore”,method = {RequestMethod.POST, RequestMethod.GET},produces =“application/json;charset=UTF-8”)

@ResponseBody

public String stuscoree(Page page,Model model) {

List list=adminService.stumanage();

page.caculatestart();

List list2=adminService.liststudent(page);

JSONObject jsonobj=new JSONObject();

jsonobj.put(“code”, 0);

jsonobj.put(“msg”, “成功”);

jsonobj.put(“count”,list.size());

JSONArray jsonobj2=new JSONArray();

JSONObject jsonobj3=new JSONObject();

for(Student student:list2) {

jsonobj3.put(“id”,student.getId());

jsonobj3.put(“stuno”, student.getStuno());

jsonobj3.put(“stuname”,student.getStuname());

jsonobj3.put(“stuclass”,student.getStuclass());

jsonobj3.put(“score”,student.getScore());

jsonobj2.add(jsonobj3);

}

jsonobj.put(“data”, jsonobj2);

return jsonobj.toString();

}

@RequestMapping(“/updatepw”)

public ModelAndView updatepw(Teacher teacher,Model model) {

this.generaService.updatepw(teacher);

ModelAndView mav = new ModelAndView(“success”);

return mav;

}

@RequestMapping(“/updatescore”)

public ModelAndView updatescore(String id,String score,Model model) {

Student student=new Student();

student.setId(Integer.parseInt(id));

student.setScore(score);

this.generaService.updatescore(student);

ModelAndView mav = new ModelAndView(“teacher/addscore”);

return mav;

}

}

四、其他

====

1.其他系统实现


1.JavaWeb系统系列实现

Java+JSP实现学生图书管理系统

Java+JSP实现学生信息管理系统

Java+JSP实现用户信息管理系统

Java+Servlet+JSP实现航空订票系统

Java+Servlet+JSP实现新闻发布系统

Java+Servlet+JSP实现图书管理系统

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数前端工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。

img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:前端)

最后

正值金三银四招聘旺季,很多小伙伴都询问我有没有前端方面的面试题,特地整理出来赠送给大家!

资料领取方式:点击这里前往获取

dent);

ModelAndView mav = new ModelAndView(“teacher/addscore”);

return mav;

}

}

四、其他

====

1.其他系统实现


1.JavaWeb系统系列实现

Java+JSP实现学生图书管理系统

Java+JSP实现学生信息管理系统

Java+JSP实现用户信息管理系统

Java+Servlet+JSP实现航空订票系统

Java+Servlet+JSP实现新闻发布系统

Java+Servlet+JSP实现图书管理系统

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数前端工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。

[外链图片转存中…(img-lDNyd5fX-1712886511229)]

[外链图片转存中…(img-hbVR4tKV-1712886511229)]

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!

[外链图片转存中…(img-xqwtU7tD-1712886511230)]

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:前端)

最后

正值金三银四招聘旺季,很多小伙伴都询问我有没有前端方面的面试题,特地整理出来赠送给大家!

资料领取方式:点击这里前往获取

前端资料图.PNG

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/758897
推荐阅读
相关标签
  

闽ICP备14008679号