当前位置:网站首页>Educational administration management system of SSM (free source code)
Educational administration management system of SSM (free source code)
2022-07-01 05:34:00 【Code garden of Azhou】
ssm- Educational administration system
Introduce
Adopted spring mvc,spring,mybatis frame , Front end use js,html, The main functions include : Course management , Student management , Teacher management , Account password reset and other functions
Installation tutorial
Put the project in idea
Pay attention to modifying the connected database information to your own
To configure tomcat
Import dependence , If some red hot conductors can't go in, you can choose to change them maven Version to try
package com.system.controller; import com.system.exception.CustomException; import com.system.po.*; import com.system.service.*; 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 javax.annotation.Resource; import java.util.List; @Controller @RequestMapping("/admin") public class AdminController { @Resource private StudentService studentService; @Resource private TeacherService teacherService; @Resource private CourseService courseService; @Resource private CollegeService collegeService; @Resource private UserloginService userloginService; /*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Student operation >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ // Student information shows @RequestMapping("/showStudent") public String showStudent(Model model, Integer page) throws Exception { List<StudentCustom> list = null; // Page number object PagingVO pagingVO = new PagingVO(); // Set the total number of pages pagingVO.setTotalCount(studentService.getCountStudent()); if (page == null || page == 0) { pagingVO.setToPageNo(1); list = studentService.findByPaging(1); } else { pagingVO.setToPageNo(page); list = studentService.findByPaging(page); } model.addAttribute("studentList", list); model.addAttribute("pagingVO", pagingVO); return "admin/showStudent"; } // The add student information page displays @RequestMapping(value = "/addStudent", method = {RequestMethod.GET}) public String addStudentUI(Model model) throws Exception { List<College> list = collegeService.finAll(); model.addAttribute("collegeList", list); return "admin/addStudent"; } // Add student information operation @RequestMapping(value = "/addStudent", method = {RequestMethod.POST}) public String addStudent(StudentCustom studentCustom, Model model) throws Exception { Boolean result = studentService.save(studentCustom); if (!result) { model.addAttribute("message", " Repeat the student number "); return "error"; } // After successful addition , Also added to the login table Userlogin userlogin = new Userlogin(); userlogin.setUsername(studentCustom.getUserid().toString()); userlogin.setPassword("123"); userlogin.setRole(2); userloginService.save(userlogin); // Redirect return "redirect:/admin/showStudent"; } // Modify the student information page display @RequestMapping(value = "/editStudent", method = {RequestMethod.GET}) public String editStudentUI(Integer id, Model model) throws Exception { if (id == null) { // Join without taking students id If you come in, you will return to the student display page return "redirect:/admin/showStudent"; } StudentCustom studentCustom = studentService.findById(id); if (studentCustom == null) { throw new CustomException(" The student was not found "); } List<College> list = collegeService.finAll(); model.addAttribute("collegeList", list); model.addAttribute("student", studentCustom); return "admin/editStudent"; } // Modify student information processing @RequestMapping(value = "/editStudent", method = {RequestMethod.POST}) public String editStudent(StudentCustom studentCustom) throws Exception { studentService.updataById(studentCustom.getUserid(), studentCustom); // Redirect return "redirect:/admin/showStudent"; } // Delete students @RequestMapping(value = "/removeStudent", method = {RequestMethod.GET} ) private String removeStudent(Integer id) throws Exception { if (id == null) { // Join without taking students id If you come in, you will return to the student display page return "admin/showStudent"; } studentService.removeById(id); userloginService.removeByName(id.toString()); return "redirect:/admin/showStudent"; } // Search students @RequestMapping(value = "selectStudent", method = {RequestMethod.POST}) private String selectStudent(String findByName, Model model) throws Exception { List<StudentCustom> list = studentService.findByName(findByName); model.addAttribute("studentList", list); return "admin/showStudent"; } // The password of this account is reset @RequestMapping("/passwordRest") public String passwordRestUI() throws Exception { return "admin/passwordRest"; } }
Educational administration management system download link https://gitee.com/wuyanzua/blog-applet
边栏推荐
- Rust基础入门之变量绑定与解构
- Dynamic verification of new form items in El form; El form verifies that the dynamic form V-IF does not take effect;
- JDBC常见面试题
- Vmware workstation network card settings and three common network modes
- Web Security (x) what is OAuth 2.0?
- QT等待框制作
- 如何选择导电滑环材料
- 移动端常用解决方案
- Numeric amount plus comma; JS two methods of adding three digits and a comma to numbers; JS data formatting
- 3D建模與處理軟件簡介 劉利剛 中國科技大學
猜你喜欢
Data consistency between redis and database
Mongodb學習篇:安裝後的入門第一課
智慧运维:基于 BIM 技术的可视化管理系统
Spanner 论文小结
LevelDB源码分析之memtable
CockroachDB: The Resilient Geo-Distributed SQL Database 论文阅读笔记
ssm+mysql二手交易网站(论文+源码获取链接)
How to meet the requirements of source code confidentiality and source code security management
Rainbow combines neuvector to practice container safety management
How to create a progress bar that changes color according to progress
随机推荐
小程序常用组件小结
Is it safe for a novice to open a securities account?
Fiber Bragg grating (FBG) notes [1]: waveguide structure and Bragg wavelength derivation
Intelligent operation and maintenance: visual management system based on BIM Technology
rust猜数字游戏
And search: the suspects (find the number of people related to the nth person)
busybox生成的东西
2/15 (awk, awk conditions, awk processing design can perform additional tasks, and use awk array +for loop to realize advanced search)
如何创建一个根据进度改变颜色的进度条
工业导电滑环的应用
Ebpf cilium practice (2) - underlying network observability
Introduction to 3D modeling and processing software Liu Ligang University of science and technology of China
Leetcode top 100 questions 1 Sum of two numbers
Vérification simple de la lecture et de l'écriture de qdatastream
[SRS] use of Vhost isolated stream: push / pull Stream Address
[ffmpeg] [reprint] image mosaic: picture in picture with wheat
云原生存储解决方案Rook-Ceph与Rainbond结合的实践
CockroachDB 分布式事务源码分析之 TxnCoordSender
LevelDB源码分析之LRU Cache
导电滑环使用的注意事项