基于javaweb+mysql的ssm选课管理系统(java+ssm+layui+jsp+jquery+mysql)

基于javaweb+mysql的ssm选课管理系统(java+ssm+layui+jsp+jquery+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb+mysql的SSM选课管理系统(java+ssm+layui+jsp+jquery+mysql)

项目介绍

基于SSM的选课管理系统

管理员:个人申心、公告信息管理、学生管理、教师管理、院系管理、专业管理、班级管理、课程信息管理、学生选课管理、课程成绩管理

学生:个人中心、公告信息管理、课程信息管理、学生选课管理、课程成绩管理

教师:个人中心、公告信息管理、课程信息管理、学生选课管理课程成绩管理

环境需要

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项目:是;

技术栈

后端:SSM(Spring+SpringMVC+Mybatis) 前端:JSP+CSS+JS+JQUERY+Layui

使用说明

项目运行: 1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;

return Msg.fail();

//System.out.println("=="+username+"==");

PageInfo<SelectableCourse> pageInfo = new PageInfo<>(list);

map.put("totalPage" , pageInfo.getPages());  //总页数

map.put("totalCount" , pageInfo.getTotal());  //总条数

map.put("currentPage" , page);  //当前页数。

map.put("data" , pageInfo.getList()); //获得的数据量

map.put("tCase",username);

return JSON.toJSON(map);

}catch(Exception e){

e.printStackTrace();

return JSON.toJSON(map);

管理员管理控制层:

@Controller

@Api

public class AdminController{

@Autowired

AdminService adminService;

/**

* Excel表格导出接口

* http://localhost:8080/ExcelDownload

* @param response response对象

*/


@Autowired

UserService userService;

@RequestMapping("/login")

public String login(){

return "login";

@GetMapping("/")

public String index() {

return "success";

@GetMapping("/manager")

@PreAuthorize("hasAuthority('admin')")

public String manager(){

return "manager";

//@RequestMapping("/error")


* @param page

* @param limit

* @param username

* @return

*/

@PostMapping("studentInfo")

@PreAuthorize("hasAuthority('admin') or hasAuthority('student')")

public Object studentInfo(@RequestParam(value = "page", defaultValue = "1") int page ,

@RequestParam(value = "limit", defaultValue = "10") int limit ,

@RequestParam("username")String username){

try{

Map<String,Object> map = new HashMap<>();

PageHelper.startPage(page , limit);
try{

Map<String,Object> map = new HashMap<>();

PageHelper.startPage(page , limit);

List<SelectableCourse> list = selectableCourseDAO.selectByUser(username);

if(list == null){

return Msg.fail();

//System.out.println("=="+username+"==");

PageInfo<SelectableCourse> pageInfo = new PageInfo<>(list);

map.put("totalPage" , pageInfo.getPages());  //总页数

map.put("totalCount" , pageInfo.getTotal());  //总条数

map.put("currentPage" , page);  //当前页数。

map.put("data" , pageInfo.getList()); //获得的数据量

map.put("tCase",username);


return JSON.toJSON(map);

}catch(Exception e){

e.printStackTrace();

return Msg.fail();

//测试。

@PostMapping("cc")

public Object cc(){

Map<String,Object> map = new HashMap<>();

try{

selectableCourseDAO.updateMinCourseStock(1);

return true;

}catch(Exception e){

if(e instanceof DataIntegrityViolationException){


* @param courseId

* @param username

* @return

*/

@PostMapping("cancel")

@PreAuthorize("hasAuthority('student')")

public Object cancelCourse(@RequestParam("courseId") Integer courseId ,

@RequestParam("username") String username){

return userCourseService.cancelCourse(courseId,username);

/**

* 获取学生所选全部课程


* Excel表格导出接口

* http://localhost:8080/ExcelDownload

* @param response response对象

*/

@GetMapping("/ExcelDownload")

@PreAuthorize("hasAuthority('admin')")

public void excelDownload(HttpServletResponse response) throws IOException{

adminService.excelOut(response);

/**

* 课程管理

* @return

* Excel表格导出接口

* http://localhost:8080/ExcelDownload

* @param response response对象

*/

@GetMapping("/ExcelDownload")

@PreAuthorize("hasAuthority('admin')")

public void excelDownload(HttpServletResponse response) throws IOException{

adminService.excelOut(response);

/**

* 课程管理

* @return

*/

@GetMapping("/courseManage")


*/

@PostMapping("studentInfo")

@PreAuthorize("hasAuthority('admin') or hasAuthority('student')")

public Object studentInfo(@RequestParam(value = "page", defaultValue = "1") int page ,

@RequestParam(value = "limit", defaultValue = "10") int limit ,

@RequestParam("username")String username){

try{

Map<String,Object> map = new HashMap<>();

PageHelper.startPage(page , limit);

List<SelectableCourse> list = selectableCourseDAO.selectByUser(username);

if(list == null){

return Msg.fail();

//System.out.println("=="+username+"==");

PageInfo<SelectableCourse> pageInfo = new PageInfo<>(list);

*/

@PostMapping("cancel")

@PreAuthorize("hasAuthority('student')")

public Object cancelCourse(@RequestParam("courseId") Integer courseId ,

@RequestParam("username") String username){

return userCourseService.cancelCourse(courseId,username);

/**

* 获取学生所选全部课程

* @param page

* @param limit


map.put("msg","该课程已经被抢完啦。");

}else{

map.put("msg","出现其他异常,选课失败!");

map.put("flag",false);

return JSON.toJSON(map);

管理员管理控制层:

@Controller

@Api

public class AdminController{

@Autowired

AdminService adminService;

/**


@RequestParam("username") String username){

Map<String,Object> map = new HashMap<>();

try{

return userCourseService.chooseCourse(courseId , username);

}catch(Exception e){

if(e instanceof DataIntegrityViolationException){

map.put("msg","该课程已经被抢完啦。");

}else{

map.put("msg","出现其他异常,选课失败!");

map.put("flag",false);

return JSON.toJSON(map);

/**

@PostMapping("cc")

public Object cc(){

Map<String,Object> map = new HashMap<>();

try{

selectableCourseDAO.updateMinCourseStock(1);

return true;

}catch(Exception e){

if(e instanceof DataIntegrityViolationException){

map.put("msg","该课程已经被抢完啦。");

}else{

map.put("msg","出现其他异常,选课失败!");

map.put("flag",false);

return JSON.toJSON(map);

管理员管理控制层:
@PreAuthorize("hasAuthority('admin')")

public void excelDownload(HttpServletResponse response) throws IOException{

adminService.excelOut(response);

/**

* 课程管理

* @return

*/

@GetMapping("/courseManage")

@PreAuthorize("hasAnyAuthority('admin')")

public String courseManage(){


map.put("data" , pageInfo.getList()); //获得的数据量

map.put("tCase",username);

return JSON.toJSON(map);

}catch(Exception e){

e.printStackTrace();

return Msg.fail();

//测试。

@PostMapping("cc")

public Object cc(){

Map<String,Object> map = new HashMap<>();

try{

selectableCourseDAO.updateMinCourseStock(1);

return true;

* @param response response对象

*/

@GetMapping("/ExcelDownload")

@PreAuthorize("hasAuthority('admin')")

public void excelDownload(HttpServletResponse response) throws IOException{

adminService.excelOut(response);

/**

* 课程管理

* @return

*/

@GetMapping("/courseManage")

@PreAuthorize("hasAnyAuthority('admin')")

public String courseManage(){

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值