项目介绍
管理员操作包含以下功能:
管理员登录,学生管理,成绩管理,教师信息管理,课程信息管理,学院管理,专业管理,班级信息管理,用户管理等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7版本;
技术栈
- 后端:Spring+SpringMVC+Mybatis
- 前端:HTML+CSS+JavaScript+jsp
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
- 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
- 将项目中application.yml配置文件中的数据库配置改为自己的配置;
- 运行项目,输入localhost:8080/ 登录
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
}
} catch (Exception e) {
e.printStackTrace();
return "删除失败!参数出错!";//
}
return "删除失败!";
}
}
基础信息管理控制层:
@Controller
@RequestMapping(value="/basecourse")
public class BaseCourseController {
@Autowired
private BaseCourseService baseCourseService;
@ResponseBody
@RequestMapping(value="/list")
public String getBaseCourseList(@RequestParam(defaultValue="0")int curr,@RequestParam(defaultValue="10")int nums,
} else {
res = courseService.updateCourse(course);
if (res > 0) return StrUtil.RESULT_TRUE;
return "修改失败!";
}
}
@ResponseBody
@RequestMapping(value="/complete")
public String complete(Course course) {
int res = courseService.completeCourse(course);
if (res > 0) return StrUtil.RESULT_TRUE;
return "操作失败!";
@RequestMapping(value="/list")
public String getCourseList(@RequestParam(defaultValue="0")int curr,
@RequestParam(defaultValue="20")int nums,
@RequestParam(defaultValue="")String searchKey) {
Pagination<Course> page = new Pagination<Course>();
page.setTotalItemsCount(courseService.getTotalItemsCount(searchKey));
page.setPageSize(nums);
page.setPageNum(curr);
List<Course> list = courseService.getCourseList(page,searchKey);
String jsonStr = StrUtil.RETURN_JONS_PRE_STR
+ page.getTotalItemsCount()
+ StrUtil.RETURN_JONS_MID_STR
+ JSON.toJSONString(list)
return "添加失败";
} else {
res = courseService.updateCourse(course);
if (res > 0) return StrUtil.RESULT_TRUE;
return "修改失败!";
}
}
@ResponseBody
@RequestMapping(value="/complete")
public String complete(Course course) {
int res = courseService.completeCourse(course);
if (res > 0) return StrUtil.RESULT_TRUE;
return "操作失败!";
}
@ResponseBody
@RequestMapping(value="/delete")
public String deleteStudnet(Course c) {
if (courseService.deleteCourse(c) > 0) return StrUtil.RESULT_TRUE;
return "删除失败!";
}
System.out.println(jsonStr);
return jsonStr;
}
/**
* 返回教师自己教的课程列表
*/
@ResponseBody
@RequestMapping(value="/getMyCourse")
public String getMyCourse(@RequestParam(defaultValue="0")int curr,
@RequestParam(defaultValue="10")int nums, HttpSession session) {
Pagination<Course> page = new Pagination<Course>();
Teacher t = (Teacher) session.getAttribute(StrUtil.USER);
page.setTotalItemsCount(courseService.getTotalItemsCountByTid(t.getId()));
@ResponseBody
@RequestMapping(value="/resetPswd")
public String resetPasswrd(String id) {
Student stu = new Student();
stu.setId(id);
stu.setPassword(MD5Util.MD5("123456"));
if (studentService.updateStudent(stu) > 0) return StrUtil.RESULT_TRUE;
return "修改失败!";
}
@ResponseBody
@RequestMapping(value="/delete")
public String deleteStudnet(Student stu) {
if (studentService.deleteStudent(stu) > 0) return StrUtil.RESULT_TRUE;
public class BaseCourseController {
@Autowired
private BaseCourseService baseCourseService;
@ResponseBody
@RequestMapping(value="/list")
public String getBaseCourseList(@RequestParam(defaultValue="0")int curr,@RequestParam(defaultValue="10")int nums,
@RequestParam(defaultValue="")String searchKey) {
Pagination<BaseCourse> page = new Pagination<BaseCourse>();
page.setTotalItemsCount(baseCourseService.getTotalItemsCount(searchKey));
page.setPageSize(nums);
page.setPageNum(curr);
List<BaseCourse> list = baseCourseService.getBaseCourse(page, searchKey);
String jsonStr = StrUtil.RETURN_JONS_PRE_STR + page.getTotalItemsCount()
+ StrUtil.RETURN_JONS_MID_STR
+ JSON.toJSONString(list) + StrUtil.RETURN_JONS_END_STR;
System.out.println(jsonStr);
return jsonStr;
}
@ResponseBody
@RequestMapping(value="/listForSelect")
}
}
}
学生管理控制层:
@Controller
@RequestMapping(value="/student")
public class StudentController {
@Autowired
private StudentService studentService;
@ResponseBody
@RequestMapping(value="/list")
public String getStudentList(@RequestParam(defaultValue="0")int curr,
@RequestParam(defaultValue="20")int nums,
@RequestParam(defaultValue="")String searchKey) {
} catch (IOException e) {
e.printStackTrace();
}
}
}
@RequestMapping(value="/courses")
public ModelAndView toChoiceCoursePage() {
return new ModelAndView("choiceCourse");
}
}
课程管理控制层:
@Controller
@RequestMapping(value="/course")
public class CourseController {
@Autowired
CourseService courseService;
@ResponseBody
@RequestMapping(value="/list")
public String getCourseList(@RequestParam(defaultValue="0")int curr,
}
if (res > 0)
return StrUtil.RESULT_TRUE;
return "添加失败";
} else {
res = courseService.updateCourse(course);
if (res > 0) return StrUtil.RESULT_TRUE;
return "修改失败!";
}
}
@ResponseBody
@RequestMapping(value="/complete")
public String complete(Course course) {
int res = courseService.completeCourse(course);
if (res > 0) return StrUtil.RESULT_TRUE;
return "操作失败!";
}
@ResponseBody
@RequestMapping(value="/delete")
public String deleteStudnet(Course c) {
if (courseService.deleteCourse(c) > 0) return StrUtil.RESULT_TRUE;
return "删除失败!";
}
e.printStackTrace();
System.out.println("添加失败!");
return "添加失败!";
}
if (res > 0)
return StrUtil.RESULT_TRUE;
return "添加失败";
} else {
res = courseService.updateCourse(course);
if (res > 0) return StrUtil.RESULT_TRUE;
return "修改失败!";
}
}
@ResponseBody
@RequestMapping(value="/complete")
public String complete(Course course) {